[dali_1.2.30] Merge branch 'devel/master' 67/118467/1
authorDavid Steele <david.steele@samsung.com>
Fri, 10 Mar 2017 15:02:08 +0000 (15:02 +0000)
committerDavid Steele <david.steele@samsung.com>
Fri, 10 Mar 2017 15:02:08 +0000 (15:02 +0000)
Change-Id: I78de0c8a24b7c9abdf6d43b86f03e804abc9ef0a

80 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp
automated-tests/src/dali-toolkit-styling/default-theme.json
automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/dictionary.h
dali-toolkit/internal/builder/style.cpp
dali-toolkit/internal/builder/style.h
dali-toolkit/internal/controls/buttons/radio-button-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.h
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.h
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.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-addon.spec
packaging/dali-toolkit.spec
plugins/dali-swig/Makefile.am
plugins/dali-swig/SWIG/devel-properties.i
plugins/dali-swig/SWIG/events/actor-event.i
plugins/dali-swig/examples/dali-test.cs
plugins/dali-swig/examples/date-picker-using-json.cs
plugins/dali-swig/manual/cpp/devel-property-wrap.cpp
plugins/dali-swig/manual/cpp/view-wrapper-impl-wrap.cpp
plugins/dali-swig/manual/cpp/view-wrapper-impl-wrap.h
plugins/dali-swig/manual/csharp/CustomView.cs
plugins/dali-swig/manual/csharp/ManualPINVOKE.cs
plugins/dali-swig/manual/csharp/View.cs [new file with mode: 0644]
plugins/dali-swig/manual/csharp/ViewRegistry.cs
plugins/dali-swig/manual/csharp/ViewWrapperImpl.cs
plugins/dali-swig/views/spin.cs

index b92f090..9b8217b 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.
@@ -437,3 +437,36 @@ int UtcDaliTextControllerSetGetAutoScrollEnabled(void)
   tet_result(TET_PASS);
   END_TEST;
 }
+
+int UtcDaliTextControllerSetGetCheckProperty(void)
+{
+  tet_infoline(" UtcDaliTextControllerSetGetCheckProperty");
+  ToolkitTestApplication application;
+
+  // Creates a text controller.
+  ControllerPtr controller = Controller::New();
+
+  DALI_TEST_CHECK( controller );
+
+  // Enable the text input.
+  // Creates a decorator.
+  Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller );
+
+  // Enables the text input.
+  controller->EnableTextInput( decorator );
+
+  DALI_TEST_CHECK( !controller->IsInputModePassword() );
+
+  // Set the text input to password.
+  controller->SetInputModePassword( true );
+
+  DALI_TEST_CHECK( controller->IsInputModePassword() );
+
+  // Unset the text input to password.
+  controller->SetInputModePassword( false );
+
+  DALI_TEST_CHECK( !controller->IsInputModePassword() );
+
+  tet_result(TET_PASS);
+  END_TEST;
+}
index aea0422..4f9fb77 100644 (file)
             {
               "visuals":
               {
-                "foregroundVisual":
+                "testVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"0001.png"
+                },
+                "testVisual2":
                 {
                   "visualType":"GRADIENT",
                   "startPosition": [-1, -1],
                   "spreadMethod": "REPEAT",
                   "stopOffset": [0.2, 0.8],
                   "stopColor": [ [ 1,0,0,1], [0,1,0,1] ]
+                },
+                "foregroundVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"theSameImage.png"
+                },
+                "labelVisual":
+                {
+                  "visualType":"TEXT",
+                  "pointSize":8,
+                  "text":"Some text"
                 }
               }
             },
             {
               "visuals":
               {
-                "foregroundVisual":
+                "testVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"0002.png"
+                },
+                "testVisual2":
                 {
                   "visualType":"COLOR",
                   "mixColor": [ 1,0,0,1]
+                },
+                "foregroundVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"theSameImage.png"
+                },
+                "labelVisual":
+                {
+                  "visualType":"TEXT",
+                  "pointSize":8,
+                  "text":"Some different text"
                 }
               }
             }
             },
             "focusVisual":
             {
-              "visualType":"IMAGE",
-              "url": "focus.png"
+              "visualType":"NPATCH",
+              "url": "focus.9.png"
             }
           },
           "entryTransition":
         },
         "DISABLED":
         {
+          "states":
+          {
+            "SELECTED":
+            {
+              "visuals":
+              {
+                "testVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"0001.png"
+                },
+                "testVisual2":
+                {
+                  "visualType":"GRADIENT",
+                  "startPosition": [-1, -1],
+                  "endPosition": [1, 1],
+                  "spreadMethod": "REPEAT",
+                  "stopOffset": [0.2, 0.8],
+                  "stopColor": [ [ 1,0,0,1], [0,1,0,1] ]
+                }
+              }
+            }
+          },
           "visuals":
           {
             "foregroundVisual":
               "spreadMethod": "REPEAT",
               "stopOffset": [0.2, 0.8],
               "stopColor": [ [ 1,0,0,1], [0,1,0,1] ]
+            },
+            "labelVisual":
+            {
+              "visualType":"TEXT",
+              "pointSize":8,
+              "textColor":[1,0,1,1]
             }
           }
         },
               "stopOffset": [0.3, 0.9],
               "stopColor": [ [ 0,0,1,1], [0,1,1,1] ]
             },
+            "labelVisual":
+            {
+              "visualType":"TEXT",
+              "pointSize":10
+            },
             "focusVisual":
             {
               "visualType":"IMAGE",
             {
               "visualType":"COLOR",
               "mixColor": [1,0,0,1]
+            },
+            "labelVisual":
+            {
+              "visualType":"TEXT",
+              "pointSize":9,
+              "textColor":[1,1,1,1]
             }
           }
         }
           }
         }
       ]
+    },
+    "NoStateStyle":
+    {
+      "testVisual2":
+      {
+        "visualType":"COLOR",
+        "mixColor":[1,1,1,1]
+      }
     }
   }
 }
index 34f604a..6a81e06 100644 (file)
@@ -29,6 +29,8 @@
 #include <toolkit-style-monitor.h>
 #include <dummy-control.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 
 using namespace Dali;
@@ -56,6 +58,54 @@ void dali_style_manager_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+
+Visual::Base CheckVisual( Impl::DummyControl& dummyImpl, Property::Index visualId, int type, const char* location )
+{
+    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(visualId), true, location);
+    Visual::Base visual = dummyImpl.GetVisual(visualId);
+    DALI_TEST_EQUALS( (bool)visual, true, location );
+    Property::Map map;
+    visual.CreatePropertyMap( map );
+    Property::Value* value = map.Find( Visual::Property::TYPE );
+    DALI_TEST_EQUALS( value != NULL, true, location );
+
+    int visualType;
+    value->Get( visualType );
+    DALI_TEST_EQUALS( visualType, type, location );
+    return visual;
+}
+
+
+Integration::Bitmap* CreateBitmap( unsigned int imageWidth, unsigned int imageHeight, unsigned int initialColor, Pixel::Format pixelFormat )
+{
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
+  Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
+  unsigned int bytesPerPixel = GetBytesPerPixel( pixelFormat );
+
+  memset( pixbuffer, initialColor, imageHeight * imageWidth * bytesPerPixel );
+
+  return bitmap;
+}
+
+Integration::ResourcePointer CustomizeNinePatch( TestApplication& application,
+                                                 unsigned int ninePatchImageWidth,
+                                                 unsigned int ninePatchImageHeight)
+{
+  TestPlatformAbstraction& platform = application.GetPlatform();
+
+  Pixel::Format pixelFormat = Pixel::RGBA8888;
+
+  tet_infoline("Create Bitmap");
+  platform.SetClosestImageSize(Vector2( ninePatchImageWidth, ninePatchImageHeight));
+  Integration::Bitmap* bitmap = CreateBitmap( ninePatchImageWidth, ninePatchImageHeight, 0xFF, pixelFormat );
+
+  tet_infoline("Getting resource");
+  Integration::ResourcePointer resourcePtr(bitmap);
+  platform.SetSynchronouslyLoadedResource( resourcePtr);
+
+  return resourcePtr;
+}
+
 int UtcDaliStyleManagerConstructorP(void)
 {
   ToolkitTestApplication application;
@@ -884,17 +934,38 @@ int UtcDaliStyleManagerSetState01(void)
   Stage::GetCurrent().Add(actor);
 
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
 
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
   Visual::Base visual1 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+  Visual::Base labelVisual1 = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  Property::Map labelMap;
+  labelVisual1.CreatePropertyMap( labelMap );
+  labelMap[TextVisual::Property::TEXT] = "New text";
+  VisualFactory factory = VisualFactory::Get();
+  labelVisual1 = factory.CreateVisual(labelMap);
+  dummyImpl.UnregisterVisual(DummyControl::Property::LABEL_VISUAL );
+  dummyImpl.RegisterVisual(DummyControl::Property::LABEL_VISUAL, labelVisual1 );
 
   actor.SetProperty( DevelControl::Property::STATE, DevelControl::FOCUSED );
 
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOCUS_VISUAL), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::LABEL_VISUAL), true, TEST_LOCATION);
 
   Visual::Base visual2 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+  Visual::Base labelVisual2 = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
   DALI_TEST_CHECK( visual1 != visual2 );
+  DALI_TEST_CHECK( labelVisual1 != labelVisual2 );
+  labelMap.Clear();
+  labelVisual2.CreatePropertyMap( labelMap );
+  Property::Value* textValue = labelMap.Find( Toolkit::TextVisual::Property::TEXT, "text");
+  DALI_TEST_CHECK( textValue );
+  Property::Value* pointSizeValue = labelMap.Find( Toolkit::TextVisual::Property::POINT_SIZE, "pointSize");
+  tet_infoline( "Check that the instance data has been copied to the new text visual\n");
+  DALI_TEST_EQUALS( textValue->Get<std::string>(), "New text", TEST_LOCATION );
+  DALI_TEST_EQUALS( pointSizeValue->Get<int>(), 10, TEST_LOCATION );
+
 
   actor.SetProperty( DevelControl::Property::STATE, DevelControl::DISABLED );
 
@@ -908,6 +979,17 @@ int UtcDaliStyleManagerSetState01(void)
   DALI_TEST_CHECK( visual1 != visual3 );
   DALI_TEST_CHECK( visual2 != visual3 );
 
+  Visual::Base labelVisual3 = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  DALI_TEST_CHECK( labelVisual2 != labelVisual3 );
+
+  labelVisual2.CreatePropertyMap( labelMap );
+  textValue = labelMap.Find(Toolkit::TextVisual::Property::TEXT, "text");
+  DALI_TEST_CHECK( textValue );
+  pointSizeValue = labelMap.Find(Toolkit::TextVisual::Property::POINT_SIZE, "pointSize");
+  tet_infoline( "Check that the instance data has been copied to the new text visual\n");
+  DALI_TEST_EQUALS( textValue->Get<std::string>(), "New text", TEST_LOCATION );
+  DALI_TEST_EQUALS( pointSizeValue->Get<int>(), 10, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -928,6 +1010,7 @@ int UtcDaliStyleManagerSetState02(void)
   Stage::GetCurrent().Add(actor);
 
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
 
   int state = actor.GetProperty<int>( DevelControl::Property::STATE );
   DALI_TEST_EQUALS( state, (int) DevelControl::NORMAL, TEST_LOCATION );
@@ -956,9 +1039,16 @@ int UtcDaliStyleManagerSetState02(void)
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
 
   Visual::Base visual3 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-  Visual::Base focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
-  DALI_TEST_CHECK( !focusVisual );
-  DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOCUS_VISUAL), false, TEST_LOCATION);
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  DALI_TEST_CHECK( !testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( !testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL2);
+  DALI_TEST_CHECK( !testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  DALI_TEST_CHECK( testVisual );
+
 
   DALI_TEST_CHECK( visual1 != visual3 );
   DALI_TEST_CHECK( visual2 != visual3 );
@@ -974,7 +1064,7 @@ int UtcDaliStyleManagerSetState02(void)
   visual1 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
   DALI_TEST_CHECK( visual1 );
 
-  focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  Visual::Base focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
   DALI_TEST_CHECK( !focusVisual );
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOCUS_VISUAL), false, TEST_LOCATION);
 
@@ -983,7 +1073,104 @@ int UtcDaliStyleManagerSetState02(void)
 }
 
 
-int UtcDaliStyleManagerSetSubState(void)
+int UtcDaliStyleManagerSetState03N(void)
+{
+  tet_infoline("Instantiate dummy control and test state transition without state style" );
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
+                                          defaultTheme );
+
+  ToolkitTestApplication application;
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  DummyControl actor = DummyControl::New(true);
+  actor.SetStyleName("NoStyles");
+  Stage::GetCurrent().Add(actor);
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  VisualFactory factory = VisualFactory::Get();
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  int state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::NORMAL, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "FOCUSED" ).Add("withTransitions", false));
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::FOCUSED, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "DISABLED" ).Add("withTransitions", false));
+
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::DISABLED, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerSetState04N(void)
+{
+  tet_infoline("Instantiate dummy control and test state transition with style without state" );
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
+                                          defaultTheme );
+
+  ToolkitTestApplication application;
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  DummyControl actor = DummyControl::New(true);
+  actor.SetStyleName("NoStateStyle");
+  Stage::GetCurrent().Add(actor);
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  VisualFactory factory = VisualFactory::Get();
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  int state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::NORMAL, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "FOCUSED" ).Add("withTransitions", false));
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::FOCUSED, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "DISABLED" ).Add("withTransitions", false));
+
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::DISABLED, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliStyleManagerSetSubState01(void)
 {
   tet_infoline("Instantiate dummy control and test state/visual/transition capture" );
   Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
@@ -1001,53 +1188,97 @@ int UtcDaliStyleManagerSetSubState(void)
   actor.SetStyleName("ComplexControl");
   Stage::GetCurrent().Add(actor);
 
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
+
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
 
-  {
-    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
-    Visual::Base visual = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-    DALI_TEST_CHECK( visual );
-    Property::Map map;
-    visual.CreatePropertyMap( map );
-    Property::Value* value = map.Find( Visual::Property::TYPE );
-    DALI_TEST_CHECK( value );
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
 
-    int visualType;
-    value->Get( visualType );
-    DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::GRADIENT, TEST_LOCATION );
-  }
+  actor.SetProperty(DevelControl::Property::SUB_STATE, "UNSELECTED");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::COLOR, TEST_LOCATION);
+
+  actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerSetSubState02(void)
+{
+  tet_infoline("Instantiate complex control and test state/substate change" );
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
+                                          defaultTheme );
+
+  ToolkitTestApplication application;
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  DummyControl actor = DummyControl::New(true);
+  actor.SetProperty(DevelControl::Property::STATE, "NORMAL");
+  actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
+  tet_infoline( "Setting state to NORMAL/SELECTED before re-styling\n");
+
+  actor.SetStyleName("ComplexControl");
+  Stage::GetCurrent().Add(actor);
+
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
 
   actor.SetProperty(DevelControl::Property::SUB_STATE, "UNSELECTED");
+  tet_infoline( "Changing substate to UNSELECTED - check visual changes\n");
 
-  {
-    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
-    Visual::Base visual = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-    DALI_TEST_CHECK( visual );
-    Property::Map map;
-    visual.CreatePropertyMap( map );
-    Property::Value* value = map.Find( Visual::Property::TYPE );
-    DALI_TEST_CHECK( value );
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::COLOR, TEST_LOCATION);
 
-    int visualType;
-    value->Get( visualType );
-    DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::COLOR, TEST_LOCATION );
-  }
+  actor.SetProperty(DevelControl::Property::STATE, "FOCUSED");
+  tet_infoline( "Changing state to FOCUSED - check visual changes\n");
+
+  Visual::Base fgVisual1 = CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+  Visual::Base focusVisual1 = CheckVisual( dummyImpl, DummyControl::Property::FOCUS_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
 
   actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
+  tet_infoline( "Changing  substate to SELECTED - Expect no change\n");
 
-  {
-    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
-    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
-    Visual::Base visual = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-    DALI_TEST_CHECK( visual );
-    Property::Map map;
-    visual.CreatePropertyMap( map );
-    Property::Value* value = map.Find( Visual::Property::TYPE );
-    DALI_TEST_CHECK( value );
+  Visual::Base fgVisual2 = CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+  Visual::Base focusVisual2 = CheckVisual( dummyImpl, DummyControl::Property::FOCUS_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+
+  DALI_TEST_CHECK( fgVisual1 == fgVisual2 );
+  DALI_TEST_CHECK( focusVisual1 == focusVisual2 );
+
+  actor.SetProperty(DevelControl::Property::STATE, "NORMAL");
+  tet_infoline( "Changing state to NORMAL - Expect to change to NORMAL/SELECTED \n");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+
+  Visual::Base focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  DALI_TEST_CHECK( ! focusVisual );
+
+  actor.SetProperty(DevelControl::Property::STATE, "DISABLED");
+  tet_infoline( "Changing state to DISABLED - Expect to change to DISABLED/SELECTED \n");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::COLOR, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  DALI_TEST_CHECK( ! testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  DALI_TEST_CHECK( ! testVisual );
 
-    int visualType;
-    value->Get( visualType );
-    DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::GRADIENT, TEST_LOCATION );
-  }
   END_TEST;
 }
index 979e56a..8f70228 100644 (file)
@@ -72,7 +72,7 @@ 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 );
+  typeRegistration, "testVisual2", Dali::Toolkit::DummyControl::Property::TEST_VISUAL2, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
 
 Dali::PropertyRegistration dummyControlVisualProperty03(
   typeRegistration, "foregroundVisual", Dali::Toolkit::DummyControl::Property::FOREGROUND_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
@@ -80,6 +80,9 @@ Dali::PropertyRegistration dummyControlVisualProperty03(
 Dali::PropertyRegistration dummyControlVisualProperty04(
   typeRegistration, "focusVisual", Dali::Toolkit::DummyControl::Property::FOCUS_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
 
+Dali::PropertyRegistration dummyControlVisualProperty05(
+  typeRegistration, "labelVisual", Dali::Toolkit::DummyControl::Property::LABEL_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
+
 }
 
 DummyControl DummyControlImpl::New()
@@ -125,6 +128,12 @@ void DummyControlImpl::RegisterVisual( Property::Index index, Toolkit::Visual::B
 void DummyControlImpl::UnregisterVisual( Property::Index index )
 {
   Control::UnregisterVisual( index );
+
+  VisualIndices::iterator iter = std::find( mRegisteredVisualIndices.begin(), mRegisteredVisualIndices.end(), index );
+  if( iter != mRegisteredVisualIndices.end() )
+  {
+    mRegisteredVisualIndices.erase(iter);
+  }
 }
 
 Toolkit::Visual::Base DummyControlImpl::GetVisual( Property::Index index )
@@ -142,7 +151,6 @@ bool DummyControlImpl::IsVisualEnabled( Property::Index index )
   return Control::IsVisualEnabled( index );
 }
 
-
 Animation DummyControlImpl::CreateTransition( const Toolkit::TransitionData& transition )
 {
   return Control::CreateTransition( transition );
@@ -159,6 +167,7 @@ void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index in
     case Toolkit::DummyControl::Property::TEST_VISUAL2:
     case Toolkit::DummyControl::Property::FOREGROUND_VISUAL:
     case Toolkit::DummyControl::Property::FOCUS_VISUAL:
+    case Toolkit::DummyControl::Property::LABEL_VISUAL:
     {
       Property::Map* map = value.GetMap();
       if( map != NULL )
index 75d3efe..d4b8b18 100644 (file)
@@ -48,7 +48,8 @@ public:
       TEST_VISUAL = PROPERTY_START_INDEX,
       TEST_VISUAL2,
       FOREGROUND_VISUAL,
-      FOCUS_VISUAL
+      FOCUS_VISUAL,
+      LABEL_VISUAL
     };
   };
 
@@ -92,7 +93,7 @@ public:
   void UnregisterVisual( Property::Index index );
   void EnableVisual( Property::Index index, bool enabled );
   bool IsVisualEnabled( Property::Index index );
-
+  int GetVisualCount();
   Toolkit::Visual::Base GetVisual( Property::Index index );
   Animation CreateTransition( const Toolkit::TransitionData& transition );
 
index 11dfca9..edb97ba 100644 (file)
@@ -36,6 +36,8 @@ class ImfManager : public Dali::BaseObject
 public:
   typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
   typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType;
+  typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
+  typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
 
 public:
   static Dali::ImfManager Get();
@@ -54,10 +56,14 @@ public:
   unsigned int GetCursorPosition() const;
   void SetSurroundingText( const std::string& text );
   const std::string& GetSurroundingText() const;
+  void ApplyOptions( const InputMethodOptions& options );
 
 public:  // Signals
   ImfManagerSignalType& ActivatedSignal() { return mActivatedSignal; }
   ImfEventSignalType& EventReceivedSignal() { return mEventSignal; }
+  ImfStatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; }
+  ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+  ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
 
 protected:
   virtual ~ImfManager();
@@ -76,10 +82,13 @@ private:
   std::string mSurroundingText;
   bool mRestoreAfterFocusLost:1;             ///< Whether the keyboard needs to be restored (activated ) after focus regained.
   bool mIdleCallbackConnected:1;             ///< Whether the idle callback is already connected.
+  InputMethodOptions        mOptions;
 
   ImfManagerSignalType      mActivatedSignal;
   ImfEventSignalType        mEventSignal;
-
+  ImfStatusSignalType       mKeyboardStatusSignal;
+  ImfVoidSignalType         mKeyboardResizeSignal;
+  ImfVoidSignalType         mKeyboardLanguageChangedSignal;
 
   static Dali::ImfManager mToolkitImfManager;
 
@@ -195,6 +204,10 @@ const std::string& ImfManager::GetSurroundingText() const
   return mSurroundingText;
 }
 
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+}
+
 } // Adaptor
 
 } // Internal
@@ -271,6 +284,11 @@ void ImfManager::NotifyTextInputMultiLine( bool multiLine )
 {
 }
 
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+  Internal::Adaptor::ImfManager::GetImplementation(*this).ApplyOptions( options );
+}
+
 ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
 {
   return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal();
@@ -281,6 +299,21 @@ ImfManager::ImfEventSignalType& ImfManager::EventReceivedSignal()
   return Internal::Adaptor::ImfManager::GetImplementation(*this).EventReceivedSignal();
 }
 
+ImfManager::StatusSignalType& ImfManager::StatusChangedSignal()
+{
+  return Internal::Adaptor::ImfManager::GetImplementation(*this).StatusChangedSignal();
+}
+
+ImfManager::VoidSignalType& ImfManager::ResizedSignal()
+{
+  return Internal::Adaptor::ImfManager::GetImplementation(*this).ResizedSignal();
+}
+
+ImfManager::VoidSignalType& ImfManager::LanguageChangedSignal()
+{
+  return Internal::Adaptor::ImfManager::GetImplementation(*this).LanguageChangedSignal();
+}
+
 ImfManager::ImfManager(Internal::Adaptor::ImfManager *impl)
   : BaseHandle(impl)
 {
index 7049354..a777d95 100644 (file)
@@ -22,6 +22,7 @@
 #define __DALI_IMF_MANAGER_H__
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/dali-signal.h>
+#include <dali/devel-api/adaptor-framework/input-method-options.h>
 
 namespace Dali DALI_IMPORT_API
 {
@@ -133,6 +134,8 @@ public:
 
   typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal
   typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events
+  typedef Signal< void () > VoidSignalType;
+  typedef Signal< void (bool) > StatusSignalType;
 
 public:
 
@@ -217,6 +220,12 @@ public:
   */
   void NotifyTextInputMultiLine( bool multiLine );
 
+  /**
+   * @brief Set one or more of the Input Method options
+   * @param[in] options The options to be applied
+   */
+  void ApplyOptions( const InputMethodOptions& options );
+
 public:
 
   // Signals
@@ -235,6 +244,27 @@ public:
    */
   ImfEventSignalType& EventReceivedSignal();
 
+  /**
+   * @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
+   *
+   * @return The signal connect to status changed event.
+   */
+  StatusSignalType& StatusChangedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when the virtual keyboard is resized.
+   *
+   * @return The signal to connect to resized event.
+   */
+  VoidSignalType& ResizedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when the virtual keyboard's language is changed.
+   *
+   * @return The signal to connect to language changed event.
+   */
+  VoidSignalType& LanguageChangedSignal();
+
   // Construction & Destruction
 
   /**
index 244f667..79d5cef 100644 (file)
@@ -47,8 +47,6 @@ void utc_dali_toolkit_button_cleanup(void)
 
 namespace
 {
-static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-
 static bool gIsCalledButtonCallback = false;
 
 const int RENDER_FRAME_INTERVAL = 16;
@@ -207,27 +205,29 @@ int UtcDaliButtonDownCastN(void)
   END_TEST;
 }
 
-int UtcDaliButtonSetDisabledP(void)
+int UtcDaliButtonDisabledPropertyP(void)
 {
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
-  button.SetDisabled( true );
 
-  DALI_TEST_CHECK( button.IsDisabled() );
+  button.SetProperty( button.GetPropertyIndex("disabled"), true );
 
-  button.SetDisabled( false );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), true, TEST_LOCATION );
 
-  DALI_TEST_CHECK( !button.IsDisabled() );
+  button.SetProperty( button.GetPropertyIndex("disabled"), false );
 
-  button.SetDisabled( true );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), false, TEST_LOCATION );
 
-  DALI_TEST_CHECK( button.IsDisabled() );
+  button.SetProperty( button.GetPropertyIndex("disabled"), true );
 
-  button.SetDisabled( false );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+
+  button.SetProperty( button.GetPropertyIndex("disabled"), false );
+
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), false, TEST_LOCATION );
 
-  DALI_TEST_CHECK( !button.IsDisabled() );
   END_TEST;
 }
 
@@ -311,23 +311,23 @@ int UtcDaliButtonIsDisabledP(void)
   END_TEST;
 }
 
-int UtcDaliButtonSetAutoRepeatingP(void)
+int UtcDaliButtonAutoRepeatingPropertyP(void)
 {
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
-  button.SetAutoRepeating( true );
+  button.SetProperty( button.GetPropertyIndex("autoRepeating"), true );
 
-  DALI_TEST_CHECK( button.IsAutoRepeating() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
 
-  button.SetAutoRepeating( false );
+  button.SetProperty( button.GetPropertyIndex("autoRepeating"), false );
 
-  DALI_TEST_CHECK( !button.IsAutoRepeating() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
 
-  button.SetAutoRepeating( true );
+  button.SetProperty( button.GetPropertyIndex("autoRepeating"), true );
 
-  DALI_TEST_CHECK( button.IsAutoRepeating() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
 
   button.SetAutoRepeating( false );
 
@@ -411,68 +411,69 @@ int UtcDaliButtonAutoRepeatingP(void)
   END_TEST;
 }
 
-int UtcDaliButtonSetInitialAutoRepeatingDelayP(void)
+int UtcDaliButtonInitialAutoRepeatingDelayPropertyP(void)
 {
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
-  button.SetInitialAutoRepeatingDelay( 0.5f );
+  button.SetProperty( button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.5f );
 
-  DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.5f, TEST_LOCATION );
 
-  button.SetInitialAutoRepeatingDelay( 0.2f );
+  button.SetProperty( button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.2f );
+
+  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.2f, TEST_LOCATION );
 
-  DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliButtonSetNextAutoRepeatingDelayP(void)
+int UtcDaliButtonNextAutoRepeatingDelayPropertyP(void)
 {
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
-  button.SetNextAutoRepeatingDelay( 0.5f );
+  button.SetProperty( button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.5f );
 
-  DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.5f, TEST_LOCATION );
 
-  button.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 0.2f );
+  button.SetProperty( button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.2f );
 
-  DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
+  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.2f, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliButtonSetTogglableButtonP(void)
+int UtcDaliButtonTogglableButtonPropertyP(void)
 {
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
-  button.SetTogglableButton( true );
+  button.SetProperty( button.GetPropertyIndex("togglable"), true );
 
-  DALI_TEST_CHECK( button.IsTogglableButton() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("togglable")), true, TEST_LOCATION );
 
-  button.SetTogglableButton( false );
+  button.SetProperty( button.GetPropertyIndex("togglable"), false );
 
-  DALI_TEST_CHECK( !button.IsTogglableButton() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("togglable")), false, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliButtonSetSelectedP(void)
+int UtcDaliButtonSelectedPropertyP(void)
 {
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
-  button.SetTogglableButton( true );
+  button.SetProperty( button.GetPropertyIndex("togglable"), true );
 
-  button.SetSelected( true );
+  button.SetProperty( button.GetPropertyIndex("selected"), true );
 
-  DALI_TEST_CHECK( button.IsSelected() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("selected")), true, TEST_LOCATION );
 
-  button.SetSelected( false );
+  button.SetProperty( button.GetPropertyIndex("selected"), false );
 
-  DALI_TEST_CHECK( !button.IsSelected() );
+  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("selected")), false, TEST_LOCATION );
   END_TEST;
 }
 
@@ -595,48 +596,6 @@ int UtcDaliButtonSetLabelPropertyP(void)
   END_TEST;
 }
 
-int UtcDaliButtonSetUnselectedImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetUnselectedImageP");
-
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  pushButton.SetUnselectedImage( "Image.jpg" );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( pushButton );
-
-  END_TEST;
-}
-
-int UtcDaliButtonSetSelectedImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetButtonImage");
-
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  pushButton.SetSelectedImage( "Image.jpg" );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( pushButton );
-
-  END_TEST;
-}
-
 int UtcDaliButtonPressedSignalP(void)
 {
   ToolkitTestApplication application;
@@ -843,7 +802,8 @@ int UtcDaliButtonStateChangedSignalP(void)
   tet_infoline(" UtcDaliButtonStateChangedSignalP");
 
   Button button = PushButton::New();
-  button.SetTogglableButton( true );
+
+  button.SetProperty( Button::Property::TOGGLABLE, true);
 
   Stage::GetCurrent().Add( button );
 
@@ -857,7 +817,7 @@ int UtcDaliButtonStateChangedSignalP(void)
   button.ConnectSignal( testTracker, "stateChanged",   CallbackFunctor(&stateChangedSignal) );
 
   gIsCalledButtonCallback = false;
-  button.SetSelected( true );
+  button.SetProperty( Button::Property::SELECTED, true);
 
   DALI_TEST_CHECK( gIsCalledButtonCallback );
   DALI_TEST_CHECK( stateChangedSignal );
@@ -865,8 +825,7 @@ int UtcDaliButtonStateChangedSignalP(void)
   gIsCalledButtonCallback = false;
   stateChangedSignal = false;
 
-  button.SetSelected( false );
-
+  button.SetProperty( Button::Property::SELECTED, false);
   DALI_TEST_CHECK( gIsCalledButtonCallback );
   DALI_TEST_CHECK( stateChangedSignal );
   END_TEST;
@@ -880,469 +839,126 @@ int UtcDaliButtonSetProperty(void)
   PushButton pushButton = PushButton::New();
 
   pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
-  DALI_TEST_CHECK( false == pushButton.IsDisabled() );
-
-  pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
-  DALI_TEST_CHECK( true == pushButton.IsDisabled() );
-
-  END_TEST;
-}
-
-int UtcDaliButtonSize(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSize");
-
-  // First an image is set, then SetSize is called.
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  pushButton.SetBackgroundImage( "Image.jpg" );
-  pushButton.SetSize( 10.f, 10.f );
-
-  application.SendNotification();
-  application.Render();
-
-  Vector3 size = pushButton.GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliButtonSetSelectedBackgroundImageP(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
-
-  try
-  {
-    button.SetSelectedBackgroundImage( "TestImage.jpg");
-    DALI_TEST_CHECK( true );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( false );
-  }
-
-  END_TEST;
-}
-
-int UtcDaliButtonSetSelectedBackgroundImageN(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button;
-
-  try
-  {
-    button.SetSelectedBackgroundImage( "TestImage.jpg");
-    DALI_TEST_CHECK( false );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( true );
-  }
-
-  END_TEST;
-}
-
-int UtcDaliButtonSetDisabledImageP(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
-
-  try
-  {
-    button.SetDisabledImage( "TestImage.jpg");
-    DALI_TEST_CHECK( true );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( false );
-  }
-
-  END_TEST;
-}
-
-int UtcDaliButtonSetDisabledImageN(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button;
-
-  try
-  {
-    button.SetDisabledImage( "TestImage.jpg");
-    DALI_TEST_CHECK( false );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( true );
-  }
-
-  END_TEST;
-}
-
-int UtcDaliButtonSetDisabledSelectedImageP(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
-
-  try
-  {
-    button.SetDisabledSelectedImage( "TestImage.jpg");
-    DALI_TEST_CHECK( true );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( false );
-  }
-
-  END_TEST;
-}
-
-int UtcDaliButtonSetDisabledSelectedImageN(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button;
-
-  try
-  {
-    button.SetDisabledSelectedImage( "TestImage.jpg");
-    DALI_TEST_CHECK( false );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( true );
-  }
-
-  END_TEST;
-}
 
-int UtcDaliButtonSetLabeActorlP(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), false, TEST_LOCATION );
 
-  try
-  {
-    button.SetLabel( TextLabel::New("Hello") );
-    DALI_TEST_CHECK( true );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( false );
-  }
+  pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), true, TEST_LOCATION );
 
   END_TEST;
 }
 
-int UtcDaliButtonSetLabelN(void)
-{
-  ToolkitTestApplication application;
-
-  PushButton button;
-
-  try
-  {
-    button.SetLabel( TextLabel::New("Hello") );
-    DALI_TEST_CHECK( false );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( true );
-  }
+// Deprecated API Tests
 
-  END_TEST;
-}
-
-int UtcDaliButtonSetButtonImageP(void)
+int UtcDaliButtonSetDisabledP(void)
 {
   ToolkitTestApplication application;
 
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
-
-  try
-  {
-    ResourceImage image1 = ResourceImage::New( TEST_IMAGE_ONE );
-    button.SetButtonImage( image1 );
-
-    Property::Value value = button.GetProperty(Button::Property::UNSELECTED_STATE_IMAGE );
-    DALI_TEST_CHECK( value.Get<std::string>() == TEST_IMAGE_ONE );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( false );
-  }
-
-  std::string imageUrl;
-
-  Dali::Actor actor = button.GetButtonImage();
+  Button button = PushButton::New();
 
-  Toolkit::ImageView imageView = Toolkit::ImageView ::DownCast( actor );
+  button.SetDisabled( true );
 
-  tet_infoline(" UtcDaliButtonSetButtonImageP Ensure an ImageView is returned\n");
-  DALI_TEST_CHECK ( imageView )
+  DALI_TEST_CHECK( button.IsDisabled() );
 
-  END_TEST;
-}
+  button.SetDisabled( false );
 
-int UtcDaliButtonSetButtonImageN(void)
-{
-  ToolkitTestApplication application;
+  DALI_TEST_CHECK( !button.IsDisabled() );
 
-  PushButton button;
+  button.SetDisabled( true );
 
-  try
-  {
-    ResourceImage image1 = ResourceImage::New( TEST_IMAGE_ONE );
-    button.SetButtonImage( image1 );
+  DALI_TEST_CHECK( button.IsDisabled() );
 
-    DALI_TEST_CHECK( false );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( true );
-  }
+  button.SetDisabled( false );
 
+  DALI_TEST_CHECK( !button.IsDisabled() );
   END_TEST;
 }
 
-int UtcDaliButtonSetSelectedImageWithImageP(void)
+int UtcDaliButtonSetAutoRepeatingP(void)
 {
   ToolkitTestApplication application;
 
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
-  ResourceImage image1 = ResourceImage::New( TEST_IMAGE_ONE );
-
-  try
-  {
-    button.SetSelectedImage( image1 );
-    Property::Value value = button.GetProperty( Button::Property::SELECTED_STATE_IMAGE );
-    DALI_TEST_CHECK( value.Get<std::string>() == TEST_IMAGE_ONE );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( false );
-  }
-
-  std::string imageUrl;
+  Button button = PushButton::New();
 
-  Dali::Actor actor = button.GetSelectedImage();
+  button.SetAutoRepeating( true );
 
-  Toolkit::ImageView imageView = Toolkit::ImageView::DownCast( actor );
+  DALI_TEST_CHECK( button.IsAutoRepeating() );
 
-  tet_infoline(" UtcDaliButtonSetSelectedImageWithImageP Ensure an ImageView is returned\n");
+  button.SetAutoRepeating( false );
 
-  END_TEST;
-}
+  DALI_TEST_CHECK( !button.IsAutoRepeating() );
 
-int UtcDaliButtonSetSelectedImageWithImageN(void)
-{
-  ToolkitTestApplication application;
+  button.SetAutoRepeating( true );
 
-  PushButton button;
+  DALI_TEST_CHECK( button.IsAutoRepeating() );
 
-  try
-  {
-    button.SetSelectedImage( CreateBufferImage( 10, 10, Color::WHITE ) );
-    DALI_TEST_CHECK( false );
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK( true );
-  }
+  button.SetAutoRepeating( false );
 
+  DALI_TEST_CHECK( !button.IsAutoRepeating() );
   END_TEST;
 }
 
-int UtcDaliButtonSetSelectedColorP(void)
+int UtcDaliButtonSetInitialAutoRepeatingDelayP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetSelectedColorP");
 
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  const Vector4 SET_COLOR = Color::BLUE;
-
-  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
-  pushButton.SetProperty( Button::Property::SELECTED_COLOR, SET_COLOR );
+  Button button = PushButton::New();
 
-  application.SendNotification();
-  application.Render();
+  button.SetInitialAutoRepeatingDelay( 0.5f );
 
-  Vector4 color = pushButton.GetProperty<Vector4>( Button::Property::SELECTED_COLOR );
+  DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
 
-  DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION );
+  button.SetInitialAutoRepeatingDelay( 0.2f );
 
+  DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliButtonSetUnSelectedColorP(void)
+int UtcDaliButtonSetNextAutoRepeatingDelayP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetUnSelectedColorP");
-
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
 
-  const Vector4 SET_COLOR = Color::BLUE;
-
-  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
-  pushButton.SetProperty( Button::Property::UNSELECTED_COLOR, SET_COLOR );
+  Button button = PushButton::New();
 
-  application.SendNotification();
-  application.Render();
+  button.SetNextAutoRepeatingDelay( 0.5f );
 
-  Vector4 color = pushButton.GetProperty<Vector4>( Button::Property::UNSELECTED_COLOR );
+  DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
 
-  DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION );
+  button.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 0.2f );
 
+  DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliButtonResetSelectedColorP(void)
+int UtcDaliButtonSetTogglableButtonP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetSelectedColorP");
-
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  const Vector4 FIRST_COLOR = Color::BLUE;
-  const Vector4 SECOND_COLOR = Color::BLUE;
-
-  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
-  pushButton.SetProperty( Button::Property::SELECTED_COLOR, FIRST_COLOR );
 
-  application.SendNotification();
-  application.Render();
-
-  Vector4 color = pushButton.GetProperty<Vector4>( Button::Property::SELECTED_COLOR );
-
-  DALI_TEST_EQUALS( color, FIRST_COLOR, TEST_LOCATION );
-
-  pushButton.SetProperty( Button::Property::SELECTED_COLOR, SECOND_COLOR );
+  Button button = PushButton::New();
 
-  application.SendNotification();
-  application.Render();
+  button.SetTogglableButton( true );
 
-  color = pushButton.GetProperty<Vector4>( Button::Property::SELECTED_COLOR );
+  DALI_TEST_CHECK( button.IsTogglableButton() );
 
-  DALI_TEST_EQUALS( color, SECOND_COLOR, TEST_LOCATION );
+  button.SetTogglableButton( false );
 
+  DALI_TEST_CHECK( !button.IsTogglableButton() );
   END_TEST;
 }
 
-int UtcDaliButtonSetImagesWithDeprecatedProperties(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetImagesWithDeprecatedProperties");
-
-  PushButton pushButton = PushButton::New();
-
-  Stage::GetCurrent().Add( pushButton );
-
-  Property::Map propertyMap;
-  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
-  propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
-
-  DALI_TEST_EQUALS( pushButton.GetRendererCount(), 0, TEST_LOCATION );
-
-  pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, propertyMap );
-  application.SendNotification();
-  application.Render();
-  DALI_TEST_EQUALS( pushButton.GetRendererCount(), 1, TEST_LOCATION );
-
-  tet_infoline(" Set state to selected and provide SELECTED visual");
-  pushButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, propertyMap );
-  pushButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
-  application.SendNotification();
-  application.Render();
-  DALI_TEST_EQUALS( pushButton.GetRendererCount(), 1, TEST_LOCATION );
-
-  tet_infoline(" Set state to selected, disabled and provide DISABLED_STATE_IMAGE visual");
-  pushButton.SetProperty( Toolkit::Button::Property::SELECTED, false );
-  pushButton.SetProperty( Toolkit::Button::Property::DISABLED, true );
-  pushButton.SetProperty( Toolkit::Button::Property::DISABLED_STATE_IMAGE, propertyMap );
-  application.SendNotification();
-  application.Render();
-  DALI_TEST_EQUALS( pushButton.GetRendererCount(), 1, TEST_LOCATION );
-
-END_TEST;
-}
-
-int UtcDaliButtonSetGetDepreciatedPropertiesWithURL(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetGetDepreciatedPropertiesWithURL");
-
-  PushButton button = PushButton::New();
-  Stage::GetCurrent().Add( button );
-
-  tet_infoline(" Set state to selected, disabled and provide DISABLED_STATE_IMAGE visual");
-  button.SetProperty( Toolkit::Button::Property::DISABLED, true );
-  button.SetProperty( Toolkit::Button::Property::DISABLED_STATE_IMAGE, TEST_IMAGE_ONE );
-
-  Property::Value value = button.GetProperty(Button::Property::DISABLED_STATE_IMAGE );
-  DALI_TEST_EQUALS( value.Get<std::string>(),  TEST_IMAGE_ONE, TEST_LOCATION );
-
-END_TEST;
-}
-
-int UtcDaliButtonSetLabelTextDeprecatedPropertyP(void)
+int UtcDaliButtonSetSelectedP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetLabelTextDeprecatedPropertyP");
-
-  const std::string TEST_LABEL1 = "test label one";
-  const std::string TEST_LABEL2 = "test label two";
 
   Button button = PushButton::New();
+  button.SetTogglableButton( true );
 
-  button.SetProperty( Toolkit::Button::Property::LABEL,
-                        Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
-                                       .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
-                     );
-
-  button.SetProperty( Button::Property::LABEL_TEXT, TEST_LABEL1 );
-
-  std::string labelText = button.GetProperty<std::string>( Button::Property::LABEL_TEXT );
-
-  DALI_TEST_EQUALS( labelText, TEST_LABEL1,  TEST_LOCATION );
-
-  Property::Map propertyMap;
-  propertyMap.Insert( Toolkit::Visual::Property::TYPE,  Toolkit::DevelVisual::TEXT );
-  propertyMap.Insert( Toolkit::TextVisual::Property::TEXT,  TEST_LABEL2 );
-  propertyMap.Insert( Toolkit::TextVisual::Property::TEXT_COLOR, Color::BLUE );
-  propertyMap.Insert( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
-  button.SetProperty( Button::Property::LABEL, propertyMap );
+  button.SetSelected( true );
 
-  labelText = button.GetProperty<std::string>( Button::Property::LABEL_TEXT );
+  DALI_TEST_CHECK( button.IsSelected() );
 
-  DALI_TEST_EQUALS( labelText, TEST_LABEL2,  TEST_LOCATION );
+  button.SetSelected( false );
 
+  DALI_TEST_CHECK( !button.IsSelected() );
   END_TEST;
 }
index 1606d71..443dd30 100644 (file)
@@ -34,13 +34,29 @@ namespace
 static bool gCheckBoxButtonState = false;
 bool CheckBoxButtonClicked( Button button )
 {
-  gCheckBoxButtonState = button.IsSelected();
+  gCheckBoxButtonState = button.GetProperty<bool>(button.GetPropertyIndex("selected")) ;
   return true;
 }
 
 static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
 const Vector2 TEST_IMAGE_SIZE = Vector2( 66.0f, 66.0f );
 
+static std::string GetButtonText( Button button )
+{
+  Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+
+  Property::Map *labelProperty = value.GetMap();
+
+  std::string textLabel;
+
+  if ( labelProperty )
+  {
+    Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
+    value->Get( textLabel );
+  }
+
+  return textLabel;
+}
 
 } // namespace
 
@@ -129,7 +145,7 @@ int UtcDaliCheckBoxButtonDownCastN(void)
   END_TEST;
 }
 
-int UtcDaliCheckBoxButtonSetGetSelected(void)
+int UtcDaliCheckBoxButtonSelectedPropertyP(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliCheckBoxButtonSetGetSelected");
@@ -140,19 +156,19 @@ int UtcDaliCheckBoxButtonSetGetSelected(void)
   // global var used to check if CheckBoxButtonClicked is called;
   gCheckBoxButtonState = false;
 
-  checkBoxButton.SetSelected( true );
+  checkBoxButton.SetProperty( checkBoxButton.GetPropertyIndex("selected"), true );
 
-  DALI_TEST_CHECK( checkBoxButton.IsSelected() );
+  DALI_TEST_EQUALS( checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), true, TEST_LOCATION );
   DALI_TEST_CHECK( gCheckBoxButtonState );
 
-  checkBoxButton.SetSelected( false );
+  checkBoxButton.SetProperty( checkBoxButton.GetPropertyIndex("selected"), false );
 
-  DALI_TEST_CHECK( !checkBoxButton.IsSelected() );
+  DALI_TEST_EQUALS( checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), false, TEST_LOCATION );
   DALI_TEST_CHECK( !gCheckBoxButtonState );
 
-  checkBoxButton.SetSelected( true );
+  checkBoxButton.SetProperty( checkBoxButton.GetPropertyIndex("selected"), true );
 
-  DALI_TEST_CHECK( checkBoxButton.IsSelected() );
+  DALI_TEST_EQUALS( checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), true, TEST_LOCATION );
   DALI_TEST_CHECK( gCheckBoxButtonState );
   END_TEST;
 }
@@ -171,11 +187,11 @@ int UtcDaliCheckBoxSetLabelP(void)
 
   checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
 
-  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented
+  DALI_TEST_EQUALS( GetButtonText( checkBox ) , "activate", TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliCheckBoxSetLabelDisabledP(void)
+int UtcDaliCheckBoxSetDisabledPropertyP(void)
 {
   TestApplication application;
 
@@ -183,7 +199,7 @@ int UtcDaliCheckBoxSetLabelDisabledP(void)
   Stage::GetCurrent().Add( checkBox );
 
   checkBox.SetSize( Vector2( 20.0f, 20.0f ) );
-  checkBox.SetDisabledBackgroundImage( "Image.jpg" );
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabledUnselectedBackgroundVisual"),  "Image.jpg" );
 
   application.SendNotification();
   application.Render();
@@ -197,8 +213,8 @@ int UtcDaliCheckBoxSetLabelDisabledP(void)
   checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
   checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
 
-  DALI_TEST_CHECK(  checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
-  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GetProperty once that code is implemented
+  DALI_TEST_EQUALS( checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( GetButtonText( checkBox ) , "activate", TEST_LOCATION );
 
   END_TEST;
 }
@@ -315,3 +331,61 @@ int UtcDaliCheckBoxSetForegroundPadding(void)
 
   END_TEST;
 }
+
+// Deprecated API Tests
+
+int UtcDaliCheckBoxButtonSetGetSelected(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliCheckBoxButtonSetGetSelected");
+
+  CheckBoxButton checkBoxButton = CheckBoxButton::New();
+  checkBoxButton.StateChangedSignal().Connect( &CheckBoxButtonClicked );
+
+  // global var used to check if CheckBoxButtonClicked is called;
+  gCheckBoxButtonState = false;
+
+  checkBoxButton.SetSelected( true );
+
+  DALI_TEST_CHECK( checkBoxButton.IsSelected() );
+  DALI_TEST_CHECK( gCheckBoxButtonState );
+
+  checkBoxButton.SetSelected( false );
+
+  DALI_TEST_CHECK( !checkBoxButton.IsSelected() );
+  DALI_TEST_CHECK( !gCheckBoxButtonState );
+
+  checkBoxButton.SetSelected( true );
+
+  DALI_TEST_CHECK( checkBoxButton.IsSelected() );
+  DALI_TEST_CHECK( gCheckBoxButtonState );
+  END_TEST;
+}
+
+int UtcDaliCheckBoxSetLabelDisabledP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+  Stage::GetCurrent().Add( checkBox );
+
+  checkBox.SetSize( Vector2( 20.0f, 20.0f ) );
+  checkBox.SetDisabledBackgroundImage( "Image.jpg" );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map propertyMap;
+
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
+             .Add( Toolkit::TextVisual::Property::TEXT, "activate" )
+             .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
+  checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+
+  DALI_TEST_CHECK(  checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION );
+
+  END_TEST;
+}
\ No newline at end of file
index 376ad0d..9de7101 100644 (file)
@@ -486,6 +486,13 @@ int UtcDaliControlBackgroundProperties(void)
   DALI_TEST_EQUALS( resultMap->Find( Visual::Property::TYPE )->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION );
   DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "Foobar.png", TEST_LOCATION );
 
+  // set as Color
+  control.SetProperty( Control::Property::BACKGROUND, Color::RED );
+  propValue = control.GetProperty( Control::Property::BACKGROUND );
+  resultMap = propValue.GetMap();
+  DALI_TEST_EQUALS( resultMap->Find( Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
+  DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::RED, TEST_LOCATION );
+
   // Deprecated Properties
   control.SetProperty( Control::Property::BACKGROUND_COLOR, Color::YELLOW );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::YELLOW, TEST_LOCATION );
index 7ff4e3a..421083f 100644 (file)
@@ -54,7 +54,7 @@ static const Size BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS  = Size( 100, 100 );
 static bool gPushButtonSelectedState = false;
 bool PushButtonSelected( Button button )
 {
-  gPushButtonSelectedState = button.IsSelected();
+  gPushButtonSelectedState = button.GetProperty<bool>(button.GetPropertyIndex("selected") );
   return true;
 }
 
@@ -146,6 +146,23 @@ void SetupButtonForTestTouchEvents( ToolkitTestApplication& application, Button&
   }
 }
 
+static std::string GetButtonText( Button button )
+{
+  Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+
+  Property::Map *labelProperty = value.GetMap();
+
+  std::string textLabel;
+
+  if ( labelProperty )
+  {
+    Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
+    value->Get( textLabel );
+  }
+
+  return textLabel;
+}
+
 } //namespace
 
 int UtcDaliPushButtonConstructorP(void)
@@ -223,25 +240,23 @@ int UtcDaliPushButtonDownCastN(void)
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetAutoRepeating(void)
+int UtcDaliPushButtonAutoRepeatingProperty(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetAutoRepeating");
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetAutoRepeating( true );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("autoRepeating"), true );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
 
-  DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("autoRepeating"), false );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
 
-  pushButton.SetAutoRepeating( false );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("autoRepeating"), true );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
 
-  DALI_TEST_CHECK( !pushButton.IsAutoRepeating() );
-
-  pushButton.SetAutoRepeating( true );
-
-  DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
-  END_TEST;
+    END_TEST;
 }
 
 int UtcDaliPushButtonSetAutoRepeating(void)
@@ -267,122 +282,120 @@ int UtcDaliPushButtonSetAutoRepeating(void)
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetTogglableButton(void)
+int UtcDaliPushButtonTogglableProperty(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetTogglableButton");
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetTogglableButton( true );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION );
 
-  DALI_TEST_CHECK( pushButton.IsTogglableButton() );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), false );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), false, TEST_LOCATION );
 
-  pushButton.SetTogglableButton( false );
-
-  DALI_TEST_CHECK( !pushButton.IsTogglableButton() );
-
-  pushButton.SetTogglableButton( true );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION );
 
-  DALI_TEST_CHECK( pushButton.IsTogglableButton() );
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetAutoRepeatingAndTogglableButton(void)
+int UtcDaliPushButtonAutoRepeatingPropertyAndTogglableButton(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetAutoRepeatingAndTogglableButton");
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetAutoRepeating( true );
-  pushButton.SetTogglableButton( true );
+  pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
 
-  DALI_TEST_CHECK( pushButton.IsTogglableButton() );
-  DALI_TEST_CHECK( !pushButton.IsAutoRepeating() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
 
-  pushButton.SetTogglableButton( true );
-  pushButton.SetAutoRepeating( true );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
+  pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
 
-  DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
-  DALI_TEST_CHECK( !pushButton.IsTogglableButton() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), false, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetSelected01(void)
+int UtcDaliPushButtonSelectedProperty01(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetSelected01");
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetTogglableButton( true );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
+
   pushButton.StateChangedSignal().Connect( &PushButtonSelected );
 
   gPushButtonSelectedState = false;
-  pushButton.SetSelected( true );
+  pushButton.SetProperty( Button::Property::SELECTED, true );
 
-  DALI_TEST_CHECK( pushButton.IsSelected() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED  ), true , TEST_LOCATION );
   DALI_TEST_CHECK( gPushButtonSelectedState );
 
-  pushButton.SetSelected( false );
+  pushButton.SetProperty( Button::Property::SELECTED, false );
 
-  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED  ), false , TEST_LOCATION );
   DALI_TEST_CHECK( !gPushButtonSelectedState );
 
-  pushButton.SetSelected( true );
+  pushButton.SetProperty( Button::Property::SELECTED, true );
 
-  DALI_TEST_CHECK( pushButton.IsSelected() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED  ), true , TEST_LOCATION );
   DALI_TEST_CHECK( gPushButtonSelectedState );
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetSelected02(void)
+int UtcDaliPushButtonSelectedProperty02(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetSelected02");
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetTogglableButton( false );
+  pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), false );
   pushButton.StateChangedSignal().Connect( &PushButtonSelected );
 
   gPushButtonSelectedState = false;
-  pushButton.SetSelected( true );
+  pushButton.SetProperty( Button::Property::SELECTED, true );
 
-  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED  ), false , TEST_LOCATION );
   DALI_TEST_CHECK( !gPushButtonSelectedState );
 
-  pushButton.SetSelected( false );
+  pushButton.SetProperty( Button::Property::SELECTED, false );
 
-  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED  ), false , TEST_LOCATION );
   DALI_TEST_CHECK( !gPushButtonSelectedState );
 
-  pushButton.SetSelected( true );
+  pushButton.SetProperty( Button::Property::SELECTED, true );
 
-  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED  ), false , TEST_LOCATION );
   DALI_TEST_CHECK( !gPushButtonSelectedState );
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetAutorepeatingDelayValues01(void)
+int UtcDaliPushButtonAutorepeatingDelayPropertyValues01(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetAutorepeatingDelayValues01");
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetAutoRepeating( true );
+  pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
 
-  pushButton.SetInitialAutoRepeatingDelay( 1.f );
-  DALI_TEST_EQUALS( pushButton.GetInitialAutoRepeatingDelay(), 1.f, TEST_LOCATION );
+  pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 1.f );
+
+  DALI_TEST_EQUALS( pushButton.GetProperty<float>(pushButton.GetPropertyIndex("initialAutoRepeatingDelay") ), 1.f, TEST_LOCATION );
 
-  pushButton.SetNextAutoRepeatingDelay( 1.f );
-  DALI_TEST_EQUALS( pushButton.GetNextAutoRepeatingDelay(), 1.f, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliPushButtonSetGetAutorepeatingDelayValues02(void)
+int UtcDaliPushButtonAutorepeatingDelayPropertyValues02(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetGetAutorepeatingDelayValues02");
@@ -392,11 +405,11 @@ int UtcDaliPushButtonSetGetAutorepeatingDelayValues02(void)
   bool assert1( false );
   bool assert2( false );
 
-  pushButton.SetAutoRepeating( true );
+  pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
 
   try
   {
-    pushButton.SetInitialAutoRepeatingDelay( -1.f );
+    pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, -1.f );
   }
   catch( Dali::DaliException& e )
   {
@@ -407,7 +420,7 @@ int UtcDaliPushButtonSetGetAutorepeatingDelayValues02(void)
 
   try
   {
-    pushButton.SetNextAutoRepeatingDelay( -1.f );
+    pushButton.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, -1.f );
   }
   catch( Dali::DaliException& e )
   {
@@ -420,7 +433,7 @@ int UtcDaliPushButtonSetGetAutorepeatingDelayValues02(void)
   END_TEST;
 }
 
-int UtcDaliPushButtonSetLabelText(void)
+int UtcDaliPushButtonLabelProperty(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliPushButtonSetLabelText");
@@ -429,17 +442,18 @@ int UtcDaliPushButtonSetLabelText(void)
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetProperty( Toolkit::Button::Property::LABEL,
-                          Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
-                                         .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
-                        );
-
   application.SendNotification();
   application.Render();
 
-  pushButton.SetLabelText( STR );
+  pushButton.SetProperty( Toolkit::Button::Property::LABEL,
+                            Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
+                                           .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
+                          );
 
-  DALI_TEST_EQUALS( pushButton.GetLabelText(), STR, TEST_LOCATION );
+
+  pushButton.SetProperty( Toolkit::Button::Property::LABEL, STR );
+
+  DALI_TEST_EQUALS( GetButtonText( pushButton ), STR, TEST_LOCATION );
 
   END_TEST;
 }
@@ -595,7 +609,7 @@ int UtcDaliPushButtonSelected(void)
   DALI_TEST_CHECK( !gPushButtonSelectedState );
 
   // Set togglable property.
-  pushButton.SetTogglableButton( true );
+  pushButton.SetProperty( Button::Property::TOGGLABLE, true );
 
   // Test2. Touch point down and up inside the button twice.
   gPushButtonSelectedState = false;
@@ -652,7 +666,8 @@ int UtcDaliPushButtonSelected(void)
   // Test5. Touch point down outside and up inside the button.
   // Start in unselected state
   pushButton.SetProperty( Button::Property::SELECTED, false );
-  DALI_TEST_CHECK( !pushButton.IsSelected());
+
+  DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("selected") ),false , TEST_LOCATION );
 
   gPushButtonSelectedState = false;
   event = Dali::Integration::TouchEvent();
@@ -749,7 +764,7 @@ int UtcDaliPushButtonPaddingLayout(void)
   DALI_TEST_EQUALS( size, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Check label only padding
-  pushButton.SetLabelText( "Label" );
+  pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
 
   application.SendNotification();
   application.Render();
@@ -813,7 +828,8 @@ int UtcDaliPushButtonPaddingLayout(void)
   DALI_TEST_EQUALS( size, expectedIconAndPaddingSize, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Now test padding for both label and icon simultaneously.
-  pushButton.SetLabelText( "Label" );
+  pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
+
   application.SendNotification();
   application.Render();
 
@@ -881,7 +897,7 @@ int UtcDaliPushButtonAlignmentLayout(void)
   Stage::GetCurrent().Add( pushButton );
 
   // Add a label and get size of control
-  pushButton.SetLabelText( "Label" );
+  pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
   application.SendNotification();
   application.Render();
 
@@ -1303,3 +1319,203 @@ int UtcDaliPushButtonToggleSignalP(void)
 
   END_TEST;
 }
+
+// Deprecated API Tests
+
+int UtcDaliPushButtonSetGetAutoRepeating(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetAutoRepeating");
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetAutoRepeating( true );
+
+  DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
+
+  pushButton.SetAutoRepeating( false );
+
+  DALI_TEST_CHECK( !pushButton.IsAutoRepeating() );
+
+  pushButton.SetAutoRepeating( true );
+
+  DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetGetTogglableButton(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetTogglableButton");
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetTogglableButton( true );
+
+  DALI_TEST_CHECK( pushButton.IsTogglableButton() );
+
+  pushButton.SetTogglableButton( false );
+
+  DALI_TEST_CHECK( !pushButton.IsTogglableButton() );
+
+  pushButton.SetTogglableButton( true );
+
+  DALI_TEST_CHECK( pushButton.IsTogglableButton() );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetGetAutoRepeatingAndTogglableButton(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetAutoRepeatingAndTogglableButton");
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetAutoRepeating( true );
+  pushButton.SetTogglableButton( true );
+
+  DALI_TEST_CHECK( pushButton.IsTogglableButton() );
+  DALI_TEST_CHECK( !pushButton.IsAutoRepeating() );
+
+  pushButton.SetTogglableButton( true );
+  pushButton.SetAutoRepeating( true );
+
+  DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
+  DALI_TEST_CHECK( !pushButton.IsTogglableButton() );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetGetSelected01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetSelected01");
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetTogglableButton( true );
+  pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+
+  gPushButtonSelectedState = false;
+  pushButton.SetSelected( true );
+
+  DALI_TEST_CHECK( pushButton.IsSelected() );
+  DALI_TEST_CHECK( gPushButtonSelectedState );
+
+  pushButton.SetSelected( false );
+
+  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_CHECK( !gPushButtonSelectedState );
+
+  pushButton.SetSelected( true );
+
+  DALI_TEST_CHECK( pushButton.IsSelected() );
+  DALI_TEST_CHECK( gPushButtonSelectedState );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetGetSelected02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetSelected02");
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetTogglableButton( false );
+  pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+
+  gPushButtonSelectedState = false;
+  pushButton.SetSelected( true );
+
+  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_CHECK( !gPushButtonSelectedState );
+
+  pushButton.SetSelected( false );
+
+  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_CHECK( !gPushButtonSelectedState );
+
+  pushButton.SetSelected( true );
+
+  DALI_TEST_CHECK( !pushButton.IsSelected() );
+  DALI_TEST_CHECK( !gPushButtonSelectedState );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetGetAutorepeatingDelayValues01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetAutorepeatingDelayValues01");
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetAutoRepeating( true );
+
+  pushButton.SetInitialAutoRepeatingDelay( 1.f );
+  DALI_TEST_EQUALS( pushButton.GetInitialAutoRepeatingDelay(), 1.f, TEST_LOCATION );
+
+  pushButton.SetNextAutoRepeatingDelay( 1.f );
+  DALI_TEST_EQUALS( pushButton.GetNextAutoRepeatingDelay(), 1.f, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetGetAutorepeatingDelayValues02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetGetAutorepeatingDelayValues02");
+
+  PushButton pushButton = PushButton::New();
+
+  bool assert1( false );
+  bool assert2( false );
+
+  pushButton.SetAutoRepeating( true );
+
+  try
+  {
+    pushButton.SetInitialAutoRepeatingDelay( -1.f );
+  }
+  catch( Dali::DaliException& e )
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+    DALI_TEST_EQUALS(e.condition, "initialAutoRepeatingDelay > 0.f", TEST_LOCATION);
+    assert1 = true;
+  }
+
+  try
+  {
+    pushButton.SetNextAutoRepeatingDelay( -1.f );
+  }
+  catch( Dali::DaliException& e )
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+    DALI_TEST_EQUALS(e.condition, "nextAutoRepeatingDelay > 0.f", TEST_LOCATION);
+    assert2 = true;
+  }
+
+  DALI_TEST_CHECK( assert1 && assert2 );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetLabelText(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetLabelText");
+
+  const std::string STR( "Hola!" );
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetProperty( Toolkit::Button::Property::LABEL,
+                          Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
+                                         .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
+                        );
+
+  application.SendNotification();
+  application.Render();
+
+  pushButton.SetLabelText( STR );
+
+  DALI_TEST_EQUALS( pushButton.GetLabelText(), STR, TEST_LOCATION );
+
+  END_TEST;
+}
index 24b4964..85cced6 100644 (file)
@@ -47,6 +47,23 @@ static void TestCallback(BaseHandle handle)
   gObjectCreatedCallBackCalled = true;
 }
 
+static std::string GetButtonText( Button button )
+{
+  Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+
+  Property::Map *labelProperty = value.GetMap();
+
+  std::string textLabel;
+
+  if ( labelProperty )
+  {
+    Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
+    value->Get( textLabel );
+  }
+
+  return textLabel;
+}
+
 }
 
 int UtcDaliRadioButtonConstructorP(void)
@@ -138,11 +155,11 @@ int UtcDaliRadioButtonDownCast(void)
   END_TEST;
 }
 
-int UtcDaliRadioButtonLabelActor(void)
+int UtcDaliRadioButtonLabelProperty(void)
 {
   ToolkitTestApplication application;
 
-  std::string labelText = "test actor 1";
+  const std::string labelText = "test actor 1";
 
   RadioButton radioButton = RadioButton::New();
 
@@ -151,37 +168,14 @@ int UtcDaliRadioButtonLabelActor(void)
                                          .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
                         );
 
-  radioButton.SetLabelText( labelText );
+  radioButton.SetProperty( Toolkit::Button::Property::LABEL, labelText );
+  DALI_TEST_EQUALS( GetButtonText( radioButton ), labelText, TEST_LOCATION );
 
-  DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText, TEST_LOCATION );
 
   std::string labelText2 = "test actor 2";
-  radioButton.SetLabelText( labelText2 );
-  DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText2, TEST_LOCATION );
-
-  END_TEST;
-}
+  radioButton.SetProperty( Toolkit::Button::Property::LABEL, labelText2 );
 
-int UtcDaliRadioButtonSelected(void)
-{
-  ToolkitTestApplication application;
-
-  RadioButton radioButton = RadioButton::New();
-
-  // Default selected
-  DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
-  // False
-  radioButton.SetSelected( false );
-  DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
-  // True
-  radioButton.SetSelected( true );
-  DALI_TEST_CHECK( radioButton.IsSelected() == true );
-
-  // False
-  radioButton.SetSelected( false );
-  DALI_TEST_CHECK( radioButton.IsSelected() == false );
+  DALI_TEST_EQUALS( GetButtonText( radioButton ), labelText2, TEST_LOCATION );
 
   END_TEST;
 }
@@ -343,3 +337,55 @@ int UtcDaliRadioButtonSelectedProperty(void)
 
   END_TEST;
 }
+
+
+// Deprecated API Tests
+
+int UtcDaliRadioButtonLabelActor(void)
+{
+  ToolkitTestApplication application;
+
+  std::string labelText = "test actor 1";
+
+  RadioButton radioButton = RadioButton::New();
+
+  radioButton.SetProperty( Toolkit::Button::Property::LABEL,
+                          Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
+                                         .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
+                        );
+
+  radioButton.SetLabelText( labelText );
+
+  DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText, TEST_LOCATION );
+
+  std::string labelText2 = "test actor 2";
+  radioButton.SetLabelText( labelText2 );
+  DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText2, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliRadioButtonSelected(void)
+{
+  ToolkitTestApplication application;
+
+  RadioButton radioButton = RadioButton::New();
+
+  // Default selected
+  DALI_TEST_CHECK( radioButton.IsSelected() == false );
+
+  // False
+  radioButton.SetSelected( false );
+  DALI_TEST_CHECK( radioButton.IsSelected() == false );
+
+  // True
+  radioButton.SetSelected( true );
+  DALI_TEST_CHECK( radioButton.IsSelected() == true );
+
+  // False
+  radioButton.SetSelected( false );
+  DALI_TEST_CHECK( radioButton.IsSelected() == false );
+
+  END_TEST;
+}
+
index 1ea11be..a4b3c70 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.
@@ -648,6 +648,38 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( 0, 0, 1, 1 ) );
   DALI_TEST_EQUALS( field.GetProperty<Rect <int > >( TextField::Property::DECORATION_BOUNDING_BOX ), Rect<int>( 0, 0, 1, 1 ), TEST_LOCATION );
 
+  // Check the input method setting
+  Property::Map propertyMap;
+  InputMethod::PanelLayout::Type panelLayout = InputMethod::PanelLayout::NUMBER;
+  InputMethod::AutoCapital::Type autoCapital = InputMethod::AutoCapital::WORD;
+  InputMethod::ActionButtonTitle::Type actionButton = InputMethod::ActionButtonTitle::GO;
+  int inputVariation = 1;
+  propertyMap["PANEL_LAYOUT"] = panelLayout;
+  propertyMap["AUTO_CAPITALISE"] = autoCapital;
+  propertyMap["ACTION_BUTTON"] = actionButton;
+  propertyMap["VARIATION"] = inputVariation;
+  field.SetProperty( TextField::Property::INPUT_METHOD_SETTINGS, propertyMap );
+
+  Property::Value value = field.GetProperty( TextField::Property::INPUT_METHOD_SETTINGS );
+  Property::Map map;
+  DALI_TEST_CHECK( value.Get( map ) );
+
+  int layout = 0;
+  DALI_TEST_CHECK( map[ "PANEL_LAYOUT" ].Get( layout ) );
+  DALI_TEST_EQUALS( static_cast<int>(panelLayout), layout, TEST_LOCATION );
+
+  int capital = 0;
+  DALI_TEST_CHECK( map[ "AUTO_CAPITALISE" ].Get( capital ) );
+  DALI_TEST_EQUALS( static_cast<int>(autoCapital), capital, TEST_LOCATION );
+
+  int action = 0;
+  DALI_TEST_CHECK( map[ "ACTION_BUTTON" ].Get( action ) );
+  DALI_TEST_EQUALS( static_cast<int>(actionButton), action, TEST_LOCATION );
+
+  int variation = 0;
+  DALI_TEST_CHECK( map[ "VARIATION" ].Get( variation ) );
+  DALI_TEST_EQUALS( inputVariation, variation, TEST_LOCATION );
+
   // Check input color property.
   field.SetProperty( TextField::Property::INPUT_COLOR, Color::YELLOW );
   DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::INPUT_COLOR ), Color::YELLOW, TEST_LOCATION );
@@ -1834,6 +1866,9 @@ int utcDaliTextFieldEvent07(void)
   field.SetSize( 300.f, 50.f );
   field.SetParentOrigin( ParentOrigin::TOP_LEFT );
   field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  Property::Map propertyMap;
+  propertyMap["PANEL_LAYOUT"] = InputMethod::PanelLayout::PASSWORD;
+  field.SetProperty( TextField::Property::INPUT_METHOD_SETTINGS, propertyMap );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
index 9b7c6fc..dc7fcc7 100644 (file)
@@ -197,3 +197,36 @@ int UtcDaliToolkitTextSelectionToolBarScrollBarP(void)
   DALI_TEST_CHECK( toolbar );
   END_TEST;
 }
+
+int UtcDaliToolkitTextSelectionToolBarScrollView(void)
+{
+  // Configures the ScrollView within the TextSelectionToolbar
+  ToolkitTestApplication application;
+
+  TextSelectionToolbar toolbar = TextSelectionToolbar::New();
+  DALI_TEST_CHECK( toolbar );
+  Stage::GetCurrent().Add( toolbar );
+
+  Property::Map map;
+  map["overshootEffectColor"] = Color::RED;
+  map["overshootSize"] = Vector2(50.0f, 50.f);
+  toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::SCROLL_VIEW, map );
+
+  application.SendNotification();
+  application.Render();
+
+  Actor actor = toolbar.FindChildByName("TextSelectionScrollView");
+  DALI_TEST_CHECK( actor );
+
+  ScrollView scrollView = ScrollView::DownCast( actor );
+  DALI_TEST_CHECK( scrollView );
+
+  Vector4 color = scrollView.GetProperty<Vector4>( Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR );
+  DALI_TEST_EQUALS( color, Color::RED, TEST_LOCATION );
+
+  Vector2 size = scrollView.GetProperty<Vector2>( Toolkit::Scrollable::Property::OVERSHOOT_SIZE );
+  DALI_TEST_EQUALS( size, Vector2(50.0f, 50.f), TEST_LOCATION );
+
+  END_TEST;
+}
+
index 306ce2d..b6ddd7e 100644 (file)
@@ -75,7 +75,35 @@ enum
    *
    * @see DevelControl::State
    */
-  SUB_STATE = BACKGROUND + 3
+  SUB_STATE = BACKGROUND + 3,
+
+  /**
+   * @brief The actor ID of the left focusable control.
+   * @details Name "leftFocusableActorId", type Property::INTEGER.
+   *
+   */
+  LEFT_FOCUSABLE_ACTOR_ID = BACKGROUND + 4,
+
+  /**
+   * @brief The actor ID of the right focusable control.
+   * @details Name "rightFocusableActorId", type Property::INTEGER.
+   *
+   */
+  RIGHT_FOCUSABLE_ACTOR_ID = BACKGROUND + 5,
+
+  /**
+   * @brief The actor ID of the up focusable control.
+   * @details Name "upFocusableActorId", type Property::INTEGER.
+   *
+   */
+  UP_FOCUSABLE_ACTOR_ID = BACKGROUND + 6,
+
+  /**
+   * @brief The actor ID of the down focusable control.
+   * @details Name "downFocusableActorId", type Property::INTEGER.
+   *
+   */
+  DOWN_FOCUSABLE_ACTOR_ID = BACKGROUND + 7
 };
 
 } // namespace Property
index 48d2e2b..e4ef639 100644 (file)
@@ -1139,7 +1139,8 @@ void Builder::ApplyAllStyleProperties( const TreeNode& root, const TreeNode& nod
   if( matchedStyle )
   {
     StylePtr style( *matchedStyle );
-    style->ApplyVisualsAndPropertiesRecursively( handle ); // (recurses through states)
+    Dictionary<Property::Map> instancedProperties;
+    style->ApplyVisualsAndPropertiesRecursively( handle, instancedProperties );
   }
   else // If there were no styles, instead set properties
   {
index ccccf2c..88095eb 100644 (file)
@@ -36,6 +36,23 @@ namespace Internal
  *
  * It enables lookup of keys via case-insensitive match.
  */
+
+
+typedef std::vector<std::string> DictionaryKeys;
+inline void Merge( DictionaryKeys& toDict, const DictionaryKeys& fromDict )
+{
+  for( DictionaryKeys::const_iterator fromIter = fromDict.begin(); fromIter != fromDict.end(); ++fromIter )
+  {
+    const std::string& fromKey = (*fromIter);
+    DictionaryKeys::iterator toIter = std::find( toDict.begin(), toDict.end(), fromKey );
+    if( toIter == toDict.end() )
+    {
+      toDict.push_back( fromKey );
+    }
+  }
+}
+
+
 template<typename EntryType>
 class Dictionary
 {
@@ -62,7 +79,6 @@ public:
    */
   typedef typename Elements::const_iterator iterator;
 
-
   /**
    * Constructor
    */
@@ -105,6 +121,53 @@ public:
   }
 
   /**
+   * Remove a key value pair from the dictionary.
+   */
+  void Remove( const std::string& name )
+  {
+    for( typename Elements::iterator iter = container.begin(); iter != container.end(); ++iter )
+    {
+      if( iter->key == name )
+      {
+        container.erase( iter );
+        break;
+      }
+    }
+  }
+
+  /**
+   * Remove a key value pair from the dictionary.
+   */
+  void Remove( const char* name )
+  {
+    if( name != NULL )
+    {
+      std::string theName(name);
+      Remove(theName);
+    }
+  }
+
+  void Merge( const Dictionary<EntryType>& dictionary )
+  {
+    for( typename Elements::const_iterator fromIter = dictionary.container.begin(); fromIter != dictionary.container.end(); ++fromIter )
+    {
+      bool found=false;
+      for( typename Elements::iterator toIter = container.begin(); toIter != container.end(); ++toIter )
+      {
+        if( fromIter->key == toIter->key )
+        {
+          found=true;
+          toIter->entry = fromIter->entry;
+        }
+      }
+      if( !found )
+      {
+        container.push_back( Element(fromIter->key, fromIter->entry) );
+      }
+    }
+  }
+
+  /**
    * Find the element in the dictionary pointed at by key, and
    * insensitive search, and return a const pointer to it, or NULL
    */
@@ -187,6 +250,20 @@ public:
   {
     return container.end();
   }
+
+  void GetKeys( DictionaryKeys& keys ) const
+  {
+    keys.clear();
+    for( typename Elements::const_iterator iter = container.begin(); iter != container.end(); ++iter )
+    {
+      keys.push_back( (*iter).key );
+    }
+  }
+
+  void Clear()
+  {
+    container.clear();
+  }
 };
 
 
index 515ddd9..988bd61 100644 (file)
@@ -18,7 +18,9 @@
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/builder/style.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
 
 namespace Dali
 {
@@ -37,9 +39,11 @@ StylePtr Style::New()
   return stylePtr;
 }
 
-void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
+void Style::ApplyVisualsAndPropertiesRecursively(
+  Handle handle,
+  const Dictionary<Property::Map>& instancedProperties ) const
 {
-  ApplyVisuals( handle );
+  ApplyVisuals( handle, instancedProperties );
   ApplyProperties( handle );
 
   Toolkit::Control control = Toolkit::Control::DownCast(handle);
@@ -59,7 +63,7 @@ void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
         const StylePtr statePtr(*stylePtr);
 
         // We have a state match.
-        statePtr->ApplyVisuals( handle );
+        statePtr->ApplyVisuals( handle, instancedProperties );
         statePtr->ApplyProperties( handle );
 
         // Apply substate visuals
@@ -72,7 +76,7 @@ void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
           {
             const StylePtr subStatePtr(*stylePtr);
             // We have a sub-state match.
-            subStatePtr->ApplyVisuals( handle );
+            subStatePtr->ApplyVisuals( handle, instancedProperties );
             subStatePtr->ApplyProperties( handle );
           }
         }
@@ -81,18 +85,66 @@ void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
   }
 }
 
-void Style::ApplyVisuals( Handle handle ) const
+void Style::ApplyVisuals(
+  Handle handle,
+  const Dictionary<Property::Map>& instancedProperties ) const
 {
-  for( Dictionary<Property::Map>::iterator iter = visuals.Begin(); iter != visuals.End() ; ++iter )
+  ApplyVisuals( handle, visuals, instancedProperties );
+}
+
+void Style::ApplyVisuals(
+  Handle handle,
+  const Dictionary<Property::Map>& visualMaps,
+  const Dictionary<Property::Map>& instancedProperties )
+{
+  for( Dictionary<Property::Map>::iterator iter = visualMaps.Begin(); iter != visualMaps.End() ; ++iter )
   {
     const std::string& visualName = (*iter).key;
-    const Property::Map& map = (*iter).entry;
-    Dali::Property::Index index = handle.GetPropertyIndex( visualName );
-    if( index != Property::INVALID_INDEX )
+    Property::Map map = (*iter).entry;
+    Property::Map* instancedMap = instancedProperties.Find( visualName );
+    ApplyVisual( handle, visualName, map, instancedMap );
+  }
+}
+
+void Style::ApplyVisual(
+  Handle handle,
+  const std::string& visualName,
+  const Property::Map& visualMap,
+  const Property::Map* instancedProperties )
+{
+  // Check if this visual name is a valid property of handle
+  Dali::Property::Index index = handle.GetPropertyIndex( visualName );
+  if( index != Property::INVALID_INDEX )
+  {
+    const Property::Map* applyMap = &visualMap;
+    Property::Map mergedMap;
+
+    // If there are instanced properties, and the visual types match,
+    // merge them into the visual map
+    if( instancedProperties )
     {
-      const Property::Value value(const_cast<Property::Map&>(map));
-      handle.SetProperty( index, value );
+      Property::Value* instanceTypeValue = instancedProperties->Find( Toolkit::DevelVisual::Property::TYPE);
+      Property::Value* newTypeValue = visualMap.Find( Toolkit::DevelVisual::Property::TYPE, VISUAL_TYPE );
+      if( instanceTypeValue && newTypeValue )
+      {
+        int instanceVisualType=-1;
+        int newVisualType=-1;
+        Scripting::GetEnumerationProperty( *instanceTypeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, instanceVisualType );
+        Scripting::GetEnumerationProperty( *newTypeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, newVisualType );
+
+        if( instanceVisualType == newVisualType )
+        {
+          // Same type - merge remaining instance data
+          mergedMap.Merge( visualMap );
+          mergedMap.Merge( *instancedProperties );
+          applyMap = &mergedMap;
+        }
+      }
     }
+
+    // Apply the visual property map to the handle
+    const Property::Value value(const_cast<Property::Map&>(*applyMap));
+    handle.SetProperty( index, value );
   }
 }
 
index bd26a6d..441f568 100644 (file)
@@ -55,16 +55,41 @@ public:
    * through sub-states.
    *
    * @param[in] handle The handle to apply the visuals to
+   * @param[in] instancedProperties The maps from which to get instanced properties
    */
-  void ApplyVisualsAndPropertiesRecursively( Handle handle ) const;
+  void ApplyVisualsAndPropertiesRecursively( Handle handle,
+                                             const Dictionary<Property::Map>& instancedProperties ) const;
 
   /**
    * Apply the visuals of the style to the control pointed at by
    * handle.
    *
    * @param[in] handle The handle to apply the visuals to
+   * @param[in] instancedProperties The maps from which to get instanced properties
    */
-  void ApplyVisuals( Handle handle ) const;
+  void ApplyVisuals( Handle handle,
+                     const Dictionary<Property::Map>& instancedProperties ) const;
+
+  /**
+   * Apply the properties from the visualMaps and the instancedProperties
+   * to the control pointed at by handle.
+   *
+   * @param[in] handle The handle to apply the properties to
+   * @param[in] visualMaps The visual maps from which to get the styled properties
+   * @param[in] instancedProperties The maps from which to get instanced properties
+   */
+  static void ApplyVisuals( Handle handle,
+                            const Dictionary<Property::Map>& visualMaps,
+                            const Dictionary<Property::Map>& instancedProperties );
+
+  /**
+   * Apply the properties from the visualMap and optional instancedProperties
+   * to the control pointed at by handle.
+   */
+  static void ApplyVisual( Handle handle,
+                           const std::string& visualName,
+                           const Property::Map& visualMap,
+                           const Property::Map* instancedProperties );
 
   /**
    * Apply the properties of the style to the control pointed at by
index e54ad82..bbd151a 100644 (file)
@@ -81,13 +81,7 @@ void RadioButton::OnInitialize()
 bool RadioButton::OnToggleReleased()
 {
   // Radio button overrides toggle release (button up) as doesn't allow un-selection to be performed on it directly.
-  bool stateChanged = false;
-  if( !IsSelected() )
-  {
-    Button::SetSelected( true ); // Set button to selected as previously unselected
-    stateChanged = true;
-  }
-  return stateChanged;
+  return false;
 }
 
 void RadioButton::OnStateChange( State newState )
index 03d4583..650e5cf 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
@@ -465,10 +466,6 @@ Property::Value FlexContainer::GetProperty( BaseObject* object, Property::Index
 
 void FlexContainer::OnChildAdd( Actor& child )
 {
-  // Anchor actor to top left of the container
-  child.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  child.SetParentOrigin( ParentOrigin::TOP_LEFT );
-
   // Create a new node for the child.
   FlexItemNode childNode;
   childNode.actor = child;
@@ -505,6 +502,13 @@ void FlexContainer::OnRelayout( const Vector2& size, RelayoutContainer& containe
     Actor child = mChildrenNodes[i].actor.GetHandle();
     if( child )
     {
+      // Anchor actor to top left of the container
+      if( child.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >() )
+      {
+        child.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+      }
+      child.SetParentOrigin( ParentOrigin::TOP_LEFT );
+
       float negotiatedWidth = child.GetRelayoutSize(Dimension::WIDTH);
       float negotiatedHeight = child.GetRelayoutSize(Dimension::HEIGHT);
 
index b683987..43c9307 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
@@ -816,7 +817,10 @@ void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
       if( actor &&  position.rowIndex == row && position.columnIndex == column )
       {
         // Anchor actor to top left of the cell
-        actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+        if( actor.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >() )
+        {
+          actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+        }
         actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
 
         Padding padding;
index 469ea3e..a5aa7ff 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
-#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
 #include <dali/devel-api/object/property-helper-devel.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/adaptors/adaptor.h>
@@ -995,6 +994,8 @@ void TextEditor::OnInitialize()
   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
 
+  mImfManager = ImfManager::Get();
+
   self.TouchSignal().Connect( this, &TextEditor::OnTouched );
 
   // Set BoundingBox to stage size if not already set.
@@ -1162,20 +1163,15 @@ void TextEditor::OnKeyInputFocusGained()
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnKeyInputFocusGained %p\n", mController.Get() );
 
-  VirtualKeyboard::StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged );
+  mImfManager.StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged );
 
-  ImfManager imfManager = ImfManager::Get();
+  mImfManager.EventReceivedSignal().Connect( this, &TextEditor::OnImfEvent );
 
-  if ( imfManager )
-  {
-    imfManager.EventReceivedSignal().Connect( this, &TextEditor::OnImfEvent );
+  // Notify that the text editing start.
+  mImfManager.Activate();
 
-    // Notify that the text editing start.
-    imfManager.Activate();
-
-    // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
-    imfManager.SetRestoreAfterFocusLost( true );
-  }
+  // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
+  mImfManager.SetRestoreAfterFocusLost( true );
 
    ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
 
@@ -1193,19 +1189,15 @@ void TextEditor::OnKeyInputFocusLost()
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor:OnKeyInputFocusLost %p\n", mController.Get() );
 
-  VirtualKeyboard::StatusChangedSignal().Disconnect( this, &TextEditor::KeyboardStatusChanged );
+  mImfManager.StatusChangedSignal().Disconnect( this, &TextEditor::KeyboardStatusChanged );
 
-  ImfManager imfManager = ImfManager::Get();
-  if ( imfManager )
-  {
-    // The text editing is finished. Therefore the imf manager don't have restore activation.
-    imfManager.SetRestoreAfterFocusLost( false );
+  // The text editing is finished. Therefore the imf manager don't have restore activation.
+  mImfManager.SetRestoreAfterFocusLost( false );
 
-    // Notify that the text editing finish.
-    imfManager.Deactivate();
+  // Notify that the text editing finish.
+  mImfManager.Deactivate();
 
-    imfManager.EventReceivedSignal().Disconnect( this, &TextEditor::OnImfEvent );
-  }
+  mImfManager.EventReceivedSignal().Disconnect( this, &TextEditor::OnImfEvent );
 
   ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
 
@@ -1223,11 +1215,7 @@ void TextEditor::OnTap( const TapGesture& gesture )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnTap %p\n", mController.Get() );
 
-  // Show the keyboard if it was hidden.
-  if (!VirtualKeyboard::IsVisible())
-  {
-    VirtualKeyboard::Show();
-  }
+  mImfManager.Activate();
 
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
   mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y );
@@ -1242,11 +1230,7 @@ void TextEditor::OnPan( const PanGesture& gesture )
 
 void TextEditor::OnLongPress( const LongPressGesture& gesture )
 {
-  // Show the keyboard if it was hidden.
-  if (!VirtualKeyboard::IsVisible())
-  {
-    VirtualKeyboard::Show();
-  }
+  mImfManager.Activate();
 
   mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
 
index 09465a8..40f5e03 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
 
 /*
- * 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.
@@ -262,6 +262,7 @@ private: // Data
   Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal;
   Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal;
 
+  ImfManager          mImfManager;
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
   Text::DecoratorPtr mDecorator;
index a32e7f5..3e2c606 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
-#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/adaptors/adaptor.h>
 #include <dali/integration-api/debug.h>
@@ -32,6 +31,7 @@
 #include <dali-toolkit/public-api/text/rendering-backend.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
@@ -590,8 +590,18 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
       {
-        const Property::Map map = value.Get<Property::Map>();
-        VirtualKeyboard::ApplySettings( map );
+        const Property::Map* map = value.GetMap();
+        if (map)
+        {
+          impl.mInputMethodOptions.ApplyProperty( *map );
+        }
+        impl.mController->SetInputModePassword( impl.mInputMethodOptions.IsPassword() );
+
+        Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
+        if (control == textField)
+        {
+          impl.mImfManager.ApplyOptions( impl.mInputMethodOptions );
+        }
         break;
       }
       case Toolkit::TextField::Property::INPUT_COLOR:
@@ -994,6 +1004,9 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
       }
       case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
       {
+        Property::Map map;
+        impl.mInputMethodOptions.RetrieveProperty( map );
+        value = map;
         break;
       }
       case Toolkit::TextField::Property::INPUT_COLOR:
@@ -1153,6 +1166,8 @@ void TextField::OnInitialize()
   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
 
+  mImfManager = ImfManager::Get();
+
   self.TouchSignal().Connect( this, &TextField::OnTouched );
 
   // Set BoundingBox to stage size if not already set.
@@ -1308,20 +1323,17 @@ void TextField::OnKeyInputFocusGained()
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() );
 
-  VirtualKeyboard::StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged );
+  mImfManager.ApplyOptions( mInputMethodOptions );
 
-  ImfManager imfManager = ImfManager::Get();
+  mImfManager.StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged );
 
-  if ( imfManager )
-  {
-    imfManager.EventReceivedSignal().Connect( this, &TextField::OnImfEvent );
+  mImfManager.EventReceivedSignal().Connect( this, &TextField::OnImfEvent );
 
-    // Notify that the text editing start.
-    imfManager.Activate();
+  // Notify that the text editing start.
+  mImfManager.Activate();
 
-    // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
-    imfManager.SetRestoreAfterFocusLost( true );
-  }
+  // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
+  mImfManager.SetRestoreAfterFocusLost( true );
 
    ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
 
@@ -1339,19 +1351,14 @@ void TextField::OnKeyInputFocusLost()
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField:OnKeyInputFocusLost %p\n", mController.Get() );
 
-  VirtualKeyboard::StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged );
+  mImfManager.StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged );
+  // The text editing is finished. Therefore the imf manager don't have restore activation.
+  mImfManager.SetRestoreAfterFocusLost( false );
 
-  ImfManager imfManager = ImfManager::Get();
-  if ( imfManager )
-  {
-    // The text editing is finished. Therefore the imf manager don't have restore activation.
-    imfManager.SetRestoreAfterFocusLost( false );
-
-    // Notify that the text editing finish.
-    imfManager.Deactivate();
+  // Notify that the text editing finish.
+  mImfManager.Deactivate();
 
-    imfManager.EventReceivedSignal().Disconnect( this, &TextField::OnImfEvent );
-  }
+  mImfManager.EventReceivedSignal().Disconnect( this, &TextField::OnImfEvent );
 
   ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
 
@@ -1369,11 +1376,7 @@ void TextField::OnTap( const TapGesture& gesture )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get() );
 
-  // Show the keyboard if it was hidden.
-  if (!VirtualKeyboard::IsVisible())
-  {
-    VirtualKeyboard::Show();
-  }
+  mImfManager.Activate();
 
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
   mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y );
@@ -1388,11 +1391,7 @@ void TextField::OnPan( const PanGesture& gesture )
 
 void TextField::OnLongPress( const LongPressGesture& gesture )
 {
-  // Show the keyboard if it was hidden.
-  if (!VirtualKeyboard::IsVisible())
-  {
-    VirtualKeyboard::Show();
-  }
+  mImfManager.Activate();
 
   mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
 
index 796e57f..0b7b629 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
 
 /*
- * 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.
@@ -265,11 +265,13 @@ private: // Data
   Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal;
   Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal;
 
+  ImfManager         mImfManager;
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
   Text::DecoratorPtr mDecorator;
   Toolkit::Control mStencil; ///< For EXCEED_POLICY_CLIP
   std::vector<Actor> mClippingDecorationActors;   ///< Decoration actors which need clipping.
+  Dali::InputMethodOptions mInputMethodOptions;
 
   Actor mRenderableActor;
   CallbackBase* mIdleCallback;
index 6d95ac2..6ea83c0 100644 (file)
@@ -32,6 +32,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
@@ -672,7 +673,6 @@ std::string TextSelectionPopup::GetPressedImage() const
 
    Toolkit::PushButton option = Toolkit::PushButton::New();
    option.SetName( button.name );
-   option.SetAnimationTime( 0.0f );
    option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
    switch( button.id )
@@ -736,11 +736,11 @@ std::string TextSelectionPopup::GetPressedImage() const
    }
 
    // 3. Set the normal option image (blank / Transparent).
-   option.SetUnselectedImage( "" );
+   option.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, "" );
 
    // 4. Set the pressed option image.
    // The image can be blank, the color can be used regardless.
-   option.SetSelectedImage( mPressedImage );
+   option.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, mPressedImage );
    option.SetProperty( Toolkit::Button::Property::SELECTED_COLOR, mPressedColor );
    option.SetProperty( Toolkit::Control::Property::STYLE_NAME, TEXT_SELECTION_POPUP_BUTTON_STYLE_NAME );
 
index 0cb62af..957e152 100644 (file)
@@ -29,6 +29,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/internal/helpers/color-conversion.h>
 
 namespace Dali
 {
@@ -198,6 +199,7 @@ const Dali::Vector2& TextSelectionToolbar::GetPopupMaxSize() const
 
 void TextSelectionToolbar::SetUpScrollView()
 {
+  mScrollView.SetName("TextSelectionScrollView");
   mScrollView.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   mScrollView.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   mScrollView.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
@@ -336,9 +338,21 @@ void TextSelectionToolbar::ConfigureScrollview( const Property::Map& properties
     Property::Index setPropertyIndex = mScrollView.GetPropertyIndex( propertyPair.first );
     if( setPropertyIndex != Property::INVALID_INDEX )
     {
-      // If the conversion worked, we have a valid property index,
-      // Set the property to the new value.
-      mScrollView.SetProperty( setPropertyIndex, propertyPair.second );
+      // Convert the string representation of a color into a Vector4
+      if( setPropertyIndex == Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR )
+      {
+        Vector4 color;
+        if( ConvertPropertyToColor( propertyPair.second, color ) )
+        {
+          mScrollView.SetOvershootEffectColor( color );
+        }
+      }
+      else
+      {
+        // If the conversion worked, we have a valid property index,
+        // Set the property to the new value.
+        mScrollView.SetProperty( setPropertyIndex, propertyPair.second );
+      }
     }
   }
 
index 28d305d..21a0349 100644 (file)
@@ -170,6 +170,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID )
     {
       // Do we need it to remember if it was previously DISABLED?
       currentlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::NORMAL );
+      currentlyFocusedControl.ClearKeyInputFocus();
     }
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] Focus Changed\n", __FUNCTION__, __LINE__);
@@ -181,6 +182,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID )
     if( newlyFocusedControl )
     {
       newlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::FOCUSED );
+      newlyFocusedControl.SetKeyInputFocus();
     }
 
     // Push Current Focused Actor to FocusHistory
@@ -432,6 +434,7 @@ void KeyboardFocusManager::ClearFocus()
     if( currentlyFocusedControl )
     {
       currentlyFocusedControl.SetProperty( DevelControl::Property::STATE, DevelControl::NORMAL );
+      currentlyFocusedControl.ClearKeyInputFocus();
     }
   }
 
index 3df8bbe..a55fd8d 100644 (file)
@@ -260,6 +260,10 @@ PixelData Typesetter::Render( const Vector2& size )
         TypesetGlyph( glyphData,
                       position,
                       color );
+        // delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer
+        delete []glyphData.glyphBitmap.buffer;
+        glyphData.glyphBitmap.buffer = NULL;
+
       }
     }
 
index e250542..c54ca22 100644 (file)
@@ -55,6 +55,7 @@ struct SelectionBoxInfo
 const float MAX_FLOAT = std::numeric_limits<float>::max();
 const float MIN_FLOAT = std::numeric_limits<float>::min();
 const Dali::Toolkit::Text::CharacterDirection LTR = false; ///< Left To Right direction
+const uint32_t STAR = 0x2A;
 
 } // namespace
 
@@ -100,7 +101,8 @@ EventData::EventData( DecoratorPtr decorator )
   mScrollAfterUpdatePosition( false ),
   mScrollAfterDelete( false ),
   mAllTextSelected( false ),
-  mUpdateInputStyle( false )
+  mUpdateInputStyle( false ),
+  mPasswordInput( false )
 {
   mImfManager = ImfManager::Get();
 }
@@ -767,8 +769,24 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
     return false;
   }
 
-  Vector<Character>& utf32Characters = mModel->mLogicalModel->mText;
+  Vector<Character> utf32CharactersStar;
+  const Length characterCount = mModel->mLogicalModel->mText.Count();
+  const bool isPasswordInput = ( mEventData != NULL && mEventData->mPasswordInput &&
+        !mEventData->mIsShowingPlaceholderText && characterCount > 0 );
+
+  if (isPasswordInput)
+  {
+    utf32CharactersStar.Resize( characterCount );
 
+    uint32_t* begin = utf32CharactersStar.Begin();
+    uint32_t* end = begin + characterCount;
+    while ( begin < end )
+    {
+      *begin++ = STAR;
+    }
+  }
+
+  Vector<Character>& utf32Characters = isPasswordInput ? utf32CharactersStar : mModel->mLogicalModel->mText;
   const Length numberOfCharacters = utf32Characters.Count();
 
   // Index to the first character of the first paragraph to be updated.
@@ -1946,15 +1964,15 @@ void Controller::Impl::RepositionSelectionHandles()
     // Whether to retrieve the next line.
     if( index == lastGlyphOfLine )
     {
-      // Retrieve the next line.
-      ++lineRun;
-
-      // Get the last glyph of the new line.
-      lastGlyphOfLine = lineRun->glyphRun.glyphIndex + lineRun->glyphRun.numberOfGlyphs - 1u;
-
       ++lineIndex;
       if( lineIndex < firstLineIndex + numberOfLines )
       {
+        // Retrieve the next line.
+        ++lineRun;
+
+        // Get the last glyph of the new line.
+        lastGlyphOfLine = lineRun->glyphRun.glyphIndex + lineRun->glyphRun.numberOfGlyphs - 1u;
+
         // Keep the offset and height of the current selection box.
         const float currentLineOffset = selectionBoxInfo->lineOffset;
         const float currentLineHeight = selectionBoxInfo->lineHeight;
@@ -2562,7 +2580,7 @@ CharacterIndex Controller::Impl::CalculateNewCursorIndex( CharacterIndex index )
     const Script script = mModel->mLogicalModel->GetScript( index );
     if( HasLigatureMustBreak( script ) )
     {
-      // Prevents to jump the whole Latin ligatures like fi, ff, or Arabic ﻻ,  ...
+      // Prevents to jump the whole Latin ligatures like fi, ff, or Arabic ﻻ, ...
       numberOfCharacters = 1u;
     }
   }
index 424ac0b..0eb8451 100644 (file)
@@ -148,6 +148,7 @@ struct EventData
   bool mScrollAfterDelete               : 1;   ///< Whether to scroll after delete characters.
   bool mAllTextSelected                 : 1;   ///< True if the selection handles are selecting all the text.
   bool mUpdateInputStyle                : 1;   ///< Whether to update the input style after moving the cursor.
+  bool mPasswordInput                   : 1;   ///< True if password input is enabled.
   bool mCheckScrollAmount               : 1;   ///< Whether to check scrolled amount after updating the position
 };
 
index 1bb0fed..b9e94ec 100644 (file)
@@ -1313,6 +1313,23 @@ const std::string& Controller::GetInputOutlineProperties() const
   return GetDefaultOutlineProperties();
 }
 
+void Controller::SetInputModePassword( bool passwordInput )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    mImpl->mEventData->mPasswordInput = passwordInput;
+  }
+}
+
+bool Controller::IsInputModePassword()
+{
+  if( NULL != mImpl->mEventData )
+  {
+    return mImpl->mEventData->mPasswordInput;
+  }
+  return false;
+}
+
 // public : Queries & retrieves.
 
 Layout::Engine& Controller::GetLayoutEngine()
@@ -1701,8 +1718,29 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
              ( Dali::DALI_KEY_CURSOR_UP    == keyCode ) ||
              ( Dali::DALI_KEY_CURSOR_DOWN  == keyCode ) )
     {
-      mImpl->mEventData->mCheckScrollAmount = true;
+      // If don't have any text, do nothing.
+      if( !mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters )
+      {
+        return false;
+      }
 
+      uint32_t cursorPosition = mImpl->mEventData->mPrimaryCursorPosition;
+      uint32_t numberOfCharacters = mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters;
+      uint32_t cursorLine = mImpl->mModel->mVisualModel->GetLineOfCharacter( cursorPosition );
+      uint32_t numberOfLines = mImpl->mModel->GetNumberOfLines();
+
+      // Logic to determine whether this text control will lose focus or not.
+      if( ( Dali::DALI_KEY_CURSOR_LEFT == keyCode && 0 == cursorPosition ) ||
+          ( Dali::DALI_KEY_CURSOR_RIGHT == keyCode && numberOfCharacters == cursorPosition) ||
+          ( Dali::DALI_KEY_CURSOR_DOWN == keyCode && cursorLine == numberOfLines -1 ) ||
+          ( Dali::DALI_KEY_CURSOR_DOWN == keyCode && numberOfCharacters == cursorPosition && cursorLine -1 == numberOfLines -1 ) ||
+          ( Dali::DALI_KEY_CURSOR_UP == keyCode && cursorLine == 0 ) ||
+          ( Dali::DALI_KEY_CURSOR_UP == keyCode && numberOfCharacters == cursorPosition && cursorLine == 1 ) )
+      {
+        return false;
+      }
+
+      mImpl->mEventData->mCheckScrollAmount = true;
       Event event( Event::CURSOR_KEY_EVENT );
       event.p1.mInt = keyCode;
       mImpl->mEventData->mEventQueue.push_back( event );
index f5b825e..4bb6f7c 100644 (file)
@@ -334,6 +334,22 @@ public: // Configure the text controller.
    */
   bool IsTextElideEnabled() const;
 
+  /**
+   * @brief Sets input type to password
+   *
+   * @note The string is displayed continuous "*"
+   *
+   * @param[in] passwordInput True if password input is enabled.
+   */
+  void SetInputModePassword( bool passwordInput );
+
+  /**
+   * @brief Returns whether the input mode type is set as password.
+   *
+   * @return True if input mode type is password
+   */
+  bool IsInputModePassword();
+
 public: // Update.
 
   /**
index 2b58ce9..0031bc3 100644 (file)
@@ -113,6 +113,11 @@ void AnimatedImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV );
 }
 
+void AnimatedImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void AnimatedImageVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   // url already passed in from constructor
index d19fd09..e89fec6 100644 (file)
@@ -99,6 +99,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 13b8633..2329167 100644 (file)
@@ -226,6 +226,11 @@ void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::BorderVisual::Property::ANTI_ALIASING, mAntiAliasing );
 }
 
+void BorderVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void BorderVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index 7efb142..473080b 100644 (file)
@@ -91,6 +91,11 @@ protected:
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
   /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
    * @copydoc Visual::Base::OnSetTransform
    */
   virtual void OnSetTransform();
index 0ac80d6..1691888 100644 (file)
@@ -138,6 +138,12 @@ void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mImpl->mMixColor );
 }
 
+void ColorVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
+
 void ColorVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index e5f6df1..939d40e 100644 (file)
@@ -65,6 +65,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 4ea6a28..fbce369 100644 (file)
@@ -323,6 +323,11 @@ void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void GradientVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void GradientVisual::InitializeRenderer()
 {
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
index c64b588..9c84cf2 100644 (file)
@@ -100,6 +100,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index f6e2a9f..812e854 100644 (file)
@@ -499,11 +499,13 @@ void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
   std::string fragmentShader;
   const char* fragmentPreFix = nativeImage.GetCustomFragmentPreFix();
   const char* customSamplerTypename = nativeImage.GetCustomSamplerTypename();
+
   if( fragmentPreFix )
   {
     fragmentShader = fragmentPreFix;
     fragmentShader += "\n";
   }
+
   if( mImpl->mCustomShader && !mImpl->mCustomShader->mFragmentShader.empty() )
   {
     fragmentShader += mImpl->mCustomShader->mFragmentShader;
@@ -512,6 +514,7 @@ void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
   {
     fragmentShader += FRAGMENT_SHADER_NO_ATLAS;
   }
+
   if( customSamplerTypename )
   {
     fragmentShader.replace( fragmentShader.find( DEFAULT_SAMPLER_TYPENAME ), strlen( DEFAULT_SAMPLER_TYPENAME ), customSamplerTypename );
@@ -624,52 +627,27 @@ void ImageVisual::InitializeRenderer( const std::string& imageUrl )
       ( strncasecmp( imageUrl.c_str(), HTTPS_URL, sizeof(HTTPS_URL) -1 ) != 0 ) )
   {
     bool defaultWrapMode = mWrapModeU <= WrapMode::CLAMP_TO_EDGE && mWrapModeV <= WrapMode::CLAMP_TO_EDGE;
-    bool defaultTransform = mImpl->mTransform.mSize == Vector2::ONE &&
-                            mImpl->mTransform.mOffset == Vector2::ZERO &&
-                            mImpl->mTransform.mOffsetSizeMode == Vector4::ZERO &&
-                            mImpl->mTransform.mOrigin == Toolkit::Align::CENTER &&
-                            mImpl->mTransform.mAnchorPoint == Toolkit::Align::CENTER;
-
-    bool cacheable =  defaultWrapMode && defaultTransform &&  mPixelArea == FULL_TEXTURE_RECT;
-
 
-    mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
-    if( cacheable ) // fetch the renderer from cache if exist
-    {
-      mImpl->mRenderer = mFactoryCache.GetRenderer( imageUrl );
-      mImpl->mFlags |= Impl::IS_FROM_CACHE;
-    }
+    Vector4 atlasRect;
+    // texture set has to be created first as we need to know if atlasing succeeded or not
+    // when selecting the shader
+    TextureSet textures = CreateTextureSet( atlasRect, imageUrl, IsSynchronousResourceLoading(), true );
+    CreateRenderer( textures );
 
-    if( !mImpl->mRenderer ) // new renderer is needed
+    if( mImpl->mFlags & Impl::IS_ATLASING_APPLIED ) // the texture is packed inside atlas
     {
-      Vector4 atlasRect;
-      // texture set has to be created first as we need to know if atlasing succeeded or not
-      // when selecting the shader
-      TextureSet textures = CreateTextureSet( atlasRect, imageUrl, IsSynchronousResourceLoading(), true );
-      CreateRenderer( textures );
-
-      if( mImpl->mFlags & Impl::IS_ATLASING_APPLIED ) // the texture is packed inside atlas
-      {
-        mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
-        if( !defaultWrapMode ) // custom wrap mode, renderer is not cached.
-        {
-          Vector2 wrapMode(mWrapModeU-WrapMode::CLAMP_TO_EDGE, mWrapModeV-WrapMode::CLAMP_TO_EDGE);
-          wrapMode.Clamp( Vector2::ZERO, Vector2( 2.f, 2.f ) );
-          mImpl->mRenderer.RegisterProperty( WRAP_MODE_UNIFORM_NAME, wrapMode );
-        }
-      }
-
-      // save the renderer to cache only when default wrap mode and default pixel area is used
-      if( cacheable )
+      mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
+      if( !defaultWrapMode ) // custom wrap mode, renderer is not cached.
       {
-        mFactoryCache.SaveRenderer( imageUrl, mImpl->mRenderer );
+        Vector2 wrapMode(mWrapModeU-WrapMode::CLAMP_TO_EDGE, mWrapModeV-WrapMode::CLAMP_TO_EDGE);
+        wrapMode.Clamp( Vector2::ZERO, Vector2( 2.f, 2.f ) );
+        mImpl->mRenderer.RegisterProperty( WRAP_MODE_UNIFORM_NAME, wrapMode );
       }
     }
   }
   else
   {
-    // for custom shader or remote image, renderer is not cached and atlas is not applied
-    mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
+    // for custom shader or remote image, atlas is not applied
     Vector4 atlasRect; // ignored in this case
     TextureSet textures = CreateTextureSet( atlasRect, imageUrl, IsSynchronousResourceLoading(), false );
     CreateRenderer( textures );
@@ -678,10 +656,9 @@ void ImageVisual::InitializeRenderer( const std::string& imageUrl )
 
 void ImageVisual::InitializeRenderer( const Image& image )
 {
-  mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
-
   // don't reuse CreateTextureSet
   TextureSet textures = TextureSet::New();
+
   // Renderer can't be shared if mImage is NativeImage
   NativeImage nativeImage = NativeImage::DownCast( image );
   if( nativeImage )
@@ -748,7 +725,7 @@ void ImageVisual::DoSetOffStage( Actor& actor )
   actor.RemoveRenderer( mImpl->mRenderer);
   if( !mImageUrl.empty() )
   {
-    CleanCache(mImageUrl);
+    RemoveFromAtlas(mImageUrl);
     mImage.Reset();
   }
 
@@ -789,6 +766,22 @@ void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV );
 }
 
+void ImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  map.Clear();
+  map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::IMAGE );
+  if( !mImageUrl.empty() )
+  {
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, mDesiredSize.GetWidth() );
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, mDesiredSize.GetHeight() );
+  }
+  else if( mImage )
+  {
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, static_cast<int>(mImage.GetWidth()) );
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, static_cast<int>(mImage.GetHeight()) );
+  }
+}
+
 void ImageVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
@@ -863,24 +856,22 @@ void ImageVisual::OnImageLoaded( ResourceImage image )
   }
 }
 
-void ImageVisual::CleanCache(const std::string& url)
+void ImageVisual::RemoveFromAtlas(const std::string& url)
 {
-  if( IsFromCache() )
+  Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f );
+  Property::Index index = mImpl->mRenderer.GetPropertyIndex( ATLAS_RECT_UNIFORM_NAME );
+  if( index != Property::INVALID_INDEX )
   {
-    Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f );
-    Property::Index index = mImpl->mRenderer.GetPropertyIndex( ATLAS_RECT_UNIFORM_NAME );
-    if( index != Property::INVALID_INDEX )
-    {
-      Property::Value atlasRectValue = mImpl->mRenderer.GetProperty( index );
-      atlasRectValue.Get( atlasRect );
-    }
+    Property::Value atlasRectValue = mImpl->mRenderer.GetProperty( index );
+    atlasRectValue.Get( atlasRect );
+  }
 
-    TextureSet textureSet = mImpl->mRenderer.GetTextures();
-    mImpl->mRenderer.Reset();
-    if( mFactoryCache.CleanRendererCache( url ) && index != Property::INVALID_INDEX )
-    {
-      mFactoryCache.GetAtlasManager()->Remove( textureSet, atlasRect );
-    }
+  TextureSet textureSet = mImpl->mRenderer.GetTextures();
+  mImpl->mRenderer.Reset();
+
+  if( index != Property::INVALID_INDEX )
+  {
+    mFactoryCache.GetAtlasManager()->Remove( textureSet, atlasRect );
   }
 }
 
index 52312ea..bf71048 100644 (file)
@@ -152,6 +152,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
@@ -291,9 +296,9 @@ private:
   void SetTextureRectUniform( const Vector4& textureRect  );
 
   /**
-   * Clean the renderer from cache, and remove the image from atlas if it is not used anymore
+   * Remove the image from atlas if it is not used anymore.
    */
-  void CleanCache(const std::string& url);
+  void RemoveFromAtlas(const std::string& url);
 
   /**
    * Helper method to set individual values by index key.
index 051dfa3..190c457 100644 (file)
@@ -533,6 +533,11 @@ void MeshVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::MeshVisual::Property::LIGHT_POSITION, mLightPosition );
 }
 
+void MeshVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void MeshVisual::InitializeRenderer()
 {
   //Try to load the geometry from the file.
index 2c227a3..511ce49 100644 (file)
@@ -75,6 +75,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 6ecb818..31e6344 100644 (file)
@@ -324,6 +324,11 @@ void NPatchVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::BORDER_ONLY, mBorderOnly );
 }
 
+void NPatchVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
   mLoader( factoryCache.GetNPatchLoader() ),
index 0a0465f..22b60d5 100644 (file)
@@ -100,6 +100,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 748564e..9d306be 100644 (file)
@@ -438,6 +438,11 @@ void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::PrimitiveVisual::Property::LIGHT_POSITION, mLightPosition );
 }
 
+void PrimitiveVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void PrimitiveVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index 6b210bd..677df9d 100644 (file)
@@ -122,6 +122,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index ad352af..73d29e0 100644 (file)
@@ -144,6 +144,11 @@ void SvgVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void SvgVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void SvgVisual::ParseFromUrl( const std::string& imageUrl )
 {
   mImageUrl = imageUrl;
index 26e7208..3369901 100644 (file)
@@ -90,6 +90,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 55b1478..77a680f 100644 (file)
@@ -261,6 +261,16 @@ void TextVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::TextVisual::Property::ENABLE_MARKUP, mController->IsMarkupProcessorEnabled() );
 }
 
+void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  map.Clear();
+  map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::DevelVisual::TEXT );
+  std::string text;
+  mController->GetText( text );
+  map.Insert( Toolkit::TextVisual::Property::TEXT, text );
+}
+
+
 TextVisual::TextVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
   mController( Text::Controller::New() ),
index b0bf8c3..b11f548 100644 (file)
@@ -98,6 +98,11 @@ public: // from Visual::Base
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 347cf7d..8b235f8 100644 (file)
@@ -53,10 +53,9 @@ struct Base::Impl
   enum Flags
   {
     IS_ON_STAGE = 1,
-    IS_FROM_CACHE = 1 << 1,
-    IS_ATLASING_APPLIED = 1<<2,
-    IS_PREMULTIPLIED_ALPHA = 1 << 3,
-    IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 4
+    IS_ATLASING_APPLIED = 1<<1,
+    IS_PREMULTIPLIED_ALPHA = 1 << 2,
+    IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3
   };
 
   struct CustomShader
index 0d2b050..c61aeba 100644 (file)
@@ -287,6 +287,20 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const
   map.Insert( DevelVisual::Property::OPACITY, mImpl->mMixColor.a );
 }
 
+void Visual::Base::CreateInstancePropertyMap( Property::Map& map ) const
+{
+  DoCreateInstancePropertyMap( map );
+
+  if( mImpl->mCustomShader )
+  {
+    mImpl->mCustomShader->CreatePropertyMap( map );
+  }
+
+  //map.Insert( DevelVisual::Property::DEPTH_INDEX, mImpl->mDepthIndex );
+  //map.Insert( DevelVisual::Property::ENABLED, (bool) mImpl->mRenderer );
+}
+
+
 void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
 {
   if( preMultipled )
@@ -320,11 +334,6 @@ bool Visual::Base::IsOnStage() const
   return mImpl->mFlags & Impl::IS_ON_STAGE;
 }
 
-bool Visual::Base::IsFromCache() const
-{
-  return mImpl->mFlags & Impl::IS_FROM_CACHE;
-}
-
 void Visual::Base::RegisterMixColor()
 {
   // Only register if not already registered.
index e7d8ddd..ae8a35f 100644 (file)
@@ -131,6 +131,16 @@ public:
   void CreatePropertyMap( Property::Map& map ) const;
 
   /**
+   * @brief Create a property map containing per-instance visual properties.
+   *
+   * This will enable creation of new visuals on control state change with
+   * any alternative style properties and the relevant instance properties
+   * (e.g. for image visual, the desired size, and for text visual, the actual text).
+   * @param[in] map The property map into which to write
+   */
+  void CreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
    * @brief Set whether the Pre-multiplied Alpha Blending is required
    *
    * @param[in] preMultipled whether alpha is pre-multiplied.
@@ -222,6 +232,15 @@ protected:
   virtual void DoCreatePropertyMap( Property::Map& map ) const = 0;
 
   /**
+   * @brief Called by CreateInstancePropertyMap() allowing derived
+   * classes to store instanced data (separate to styled data) that
+   * needs copying between visuals on state change.
+   *
+   * @param[out] map The visual property map
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const = 0;
+
+  /**
    * @brief Called by SetProperties() allowing sub classes to set their properties
    *
    * @param[in] propertyMap The properties for the requested Visual object.
@@ -259,13 +278,6 @@ protected:
    */
   bool IsOnStage() const;
 
-  /**
-   * @brief Gets whether the Dali::Renderer is from a shared cache (and therefore any modifications will affect other users of that renderer)
-   *
-   * @return Returns true if the renderer is from shared cache, false otherwise
-   */
-  bool IsFromCache() const;
-
 private:
 
   /**
index 03f31de..dd8d306 100644 (file)
@@ -75,86 +75,6 @@ void VisualFactoryCache::SaveShader( ShaderType type, Shader shader )
   mShader[type] = shader;
 }
 
-int VisualFactoryCache::FindRenderer( const std::string& key ) const
-{
-  int hash = Dali::CalculateHash( key );
-
-  HashVector::Iterator startIt = mRendererHashes.Begin();
-  HashVector::Iterator it;
-
-  for(;;)
-  {
-    it = std::find( startIt, mRendererHashes.End(), hash );
-    if( it != mRendererHashes.End() )
-    {
-      int index = it - mRendererHashes.Begin();
-      const CachedRenderer* cachedRenderer = mRenderers[ index ];
-
-      if( cachedRenderer && cachedRenderer->mKey == key )
-      {
-        return index;
-      }
-    }
-    else
-    {
-      break;
-    }
-    startIt = it + 1;
-  }
-
-  return -1;
-}
-
-Renderer VisualFactoryCache::GetRenderer( const std::string& key ) const
-{
-  int index = FindRenderer( key );
-  if( index != -1 )
-  {
-    return mRenderers[ index ]->mRenderer.GetHandle();
-  }
-  else
-  {
-    return Renderer();
-  }
-}
-
-void VisualFactoryCache::SaveRenderer( const std::string& key, Renderer& renderer )
-{
-  int hash = Dali::CalculateHash( key );
-  const CachedRenderer* cachedRenderer = new CachedRenderer( key, renderer );
-
-  CachedRenderers::Iterator it = std::find( mRenderers.Begin(), mRenderers.End(), static_cast< CachedRenderer* >( NULL ) );
-  if( it != mRenderers.End() )
-  {
-    *it = cachedRenderer;
-    int index = it - mRenderers.Begin();
-    mRendererHashes[ index ] = hash;
-  }
-  else
-  {
-    mRendererHashes.PushBack( hash );
-    mRenderers.PushBack( cachedRenderer );
-  }
-}
-
-bool VisualFactoryCache::CleanRendererCache( const std::string& key )
-{
-  int index = FindRenderer( key );
-  if( index != -1 )
-  {
-    const CachedRenderer*& cachedRenderer = mRenderers[ index ];
-    if( !cachedRenderer->mRenderer.GetHandle() )
-    {
-      mRendererHashes[ index ] = Dali::INITIAL_HASH_VALUE;
-
-      delete cachedRenderer;
-      cachedRenderer = NULL;
-      return true;
-    }
-  }
-  return false;
-}
-
 Geometry VisualFactoryCache::CreateQuadGeometry()
 {
   const float halfWidth = 0.5f;
@@ -294,4 +214,3 @@ Image VisualFactoryCache::GetBrokenVisualImage()
 } // namespace Toolkit
 
 } // namespace Dali
-
index c674aac..470cf07 100644 (file)
@@ -21,7 +21,6 @@
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/rendering/geometry.h>
-#include <dali/public-api/rendering/renderer.h>
 #include <dali/public-api/rendering/shader.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/devel-api/object/weak-handle.h>
@@ -139,34 +138,6 @@ public:
   static Image GetBrokenVisualImage();
 
 public:
-
-  /**
-   * @brief Request renderer from the url
-   *
-   * @return The cached renderer if exist in the cache. Otherwise an empty handle is returned.
-   */
-  Renderer GetRenderer( const std::string& key ) const;
-
-  /**
-   * @brief Cache the renderer based on the given key.
-   *
-   * If the key already exists in the cache, then the cache will save an additional renderer to the cache.
-   * RemoveRenderer will then need to be called twice to remove both items from the cache.
-   *
-   * @param[in] key The key to use for caching
-   * @param[in] renderer The Renderer to be cached
-   */
-  void SaveRenderer( const std::string& key, Renderer& renderer );
-
-  /**
-   * @brief Cleans the renderer cache by removing the renderer from the cache based on the given key if there are no longer any references to it
-   *
-   * @param[in] key The key used for caching
-   *
-   * @return True if the renderer is no longer used anywhere, false otherwise
-   */
-  bool CleanRendererCache( const std::string& key );
-
   /**
    * Get the image atlas manager.
    * @return A pointer to the atlas manager
@@ -210,36 +181,9 @@ protected:
   VisualFactoryCache& operator=(const VisualFactoryCache& rhs);
 
 private:
-  struct CachedRenderer
-  {
-    std::string mKey;
-    WeakHandle< Renderer > mRenderer;
-
-    CachedRenderer( const std::string& key, Renderer& renderer )
-    : mKey( key ),
-      mRenderer( renderer)
-    {}
-  };
-
-  typedef Dali::Vector< std::size_t > HashVector;
-  typedef Dali::OwnerContainer< const CachedRenderer* > CachedRenderers;
-
-  /**
-   * @brief Finds the first index into the cached visuals from the url
-   *
-   * @return Returns the first index into the cached renderer from the url if it exists in the cache, otherwise returns -1
-   */
-  int FindRenderer( const std::string& key ) const;
-
-private:
   Geometry mGeometry[GEOMETRY_TYPE_MAX+1];
   Shader mShader[SHADER_TYPE_MAX+1];
 
-  HashVector mRendererHashes;
-  CachedRenderers mRenderers;
-
-  Renderer mWireframeRenderer;
-
   ImageAtlasManagerPtr mAtlasManager;
   NPatchLoader mNPatchLoader;
 
index 764ba27..990b25f 100644 (file)
@@ -153,6 +153,11 @@ void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void WireframeVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   Property::Value* mixValue = propertyMap.Find( Toolkit::DevelVisual::Property::MIX_COLOR, MIX_COLOR );
index f446806..9edeca8 100644 (file)
@@ -109,6 +109,11 @@ protected: // from Visual::Base
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
   /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
    * @copydoc Visual::Base::DoSetProperties()
    */
   virtual void DoSetProperties( const Property::Map& propertyMap );
index e77c28b..26e020a 100644 (file)
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/styling/style-manager.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/control-devel.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/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
@@ -54,7 +56,6 @@
 
 namespace Dali
 {
-extern bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b );
 
 namespace Toolkit
 {
@@ -265,6 +266,10 @@ public:
   : mControlImpl( controlImpl ),
     mState( Toolkit::DevelControl::NORMAL ),
     mSubStateName(""),
+    mLeftFocusableActorId( -1 ),
+    mRightFocusableActorId( -1 ),
+    mUpFocusableActorId( -1 ),
+    mDownFocusableActorId( -1 ),
     mStyleName(""),
     mBackgroundColor(Color::TRANSPARENT),
     mStartingPinchScale( NULL ),
@@ -368,6 +373,46 @@ public:
         }
         break;
 
+        case Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID:
+        {
+          int focusId;
+          if( value.Get( focusId ) )
+          {
+            controlImpl.mImpl->mLeftFocusableActorId = focusId;
+          }
+        }
+        break;
+
+        case Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID:
+        {
+          int focusId;
+          if( value.Get( focusId ) )
+          {
+            controlImpl.mImpl->mRightFocusableActorId = focusId;
+          }
+        }
+        break;
+
+        case Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID:
+        {
+          int focusId;
+          if( value.Get( focusId ) )
+          {
+            controlImpl.mImpl->mUpFocusableActorId = focusId;
+          }
+        }
+        break;
+
+        case Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID:
+        {
+          int focusId;
+          if( value.Get( focusId ) )
+          {
+            controlImpl.mImpl->mDownFocusableActorId = focusId;
+          }
+        }
+        break;
+
         case Toolkit::Control::Property::BACKGROUND_COLOR:
         {
           DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
@@ -407,6 +452,7 @@ public:
         case Toolkit::Control::Property::BACKGROUND:
         {
           std::string url;
+          Vector4 color;
           const Property::Map* map = value.GetMap();
           if( map && !map->Empty() )
           {
@@ -422,6 +468,10 @@ public:
               visual.SetDepthIndex( DepthIndex::BACKGROUND );
             }
           }
+          else if( value.Get( color ) )
+          {
+            controlImpl.SetBackgroundColor(color);
+          }
           else
           {
             // The background is an empty property map, so we should clear the background
@@ -479,6 +529,30 @@ public:
           break;
         }
 
+        case Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID:
+        {
+          value = controlImpl.mImpl->mLeftFocusableActorId;
+          break;
+        }
+
+        case Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID:
+        {
+          value = controlImpl.mImpl->mRightFocusableActorId;
+          break;
+        }
+
+        case Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID:
+        {
+          value = controlImpl.mImpl->mUpFocusableActorId;
+          break;
+        }
+
+        case Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID:
+        {
+          value = controlImpl.mImpl->mDownFocusableActorId;
+          break;
+        }
+
         case Toolkit::Control::Property::BACKGROUND_COLOR:
         {
           DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
@@ -535,13 +609,233 @@ public:
     return value;
   }
 
-  void SetState( DevelControl::State state, bool withTransitions=true )
+
+  void CopyInstancedProperties( RegisteredVisualContainer& visuals, Dictionary<Property::Map>& instancedProperties )
   {
-    if( mState != state )
+    for(RegisteredVisualContainer::Iterator iter = visuals.Begin(); iter!= visuals.End(); iter++)
+    {
+      if( (*iter)->visual )
+      {
+        Property::Map instanceMap;
+        Toolkit::GetImplementation((*iter)->visual).CreateInstancePropertyMap(instanceMap);
+        instancedProperties.Add( (*iter)->visual.GetName(), instanceMap );
+      }
+    }
+  }
+
+  template<typename T>
+  void Remove( Dictionary<T>& keyValues, const std::string& name )
+  {
+    keyValues.Remove(name);
+  }
+
+  void Remove( DictionaryKeys& keys, const std::string& name )
+  {
+    DictionaryKeys::iterator iter = std::find( keys.begin(), keys.end(), name );
+    if( iter != keys.end())
+    {
+      keys.erase(iter);
+    }
+  }
+
+  void FindChangableVisuals( Dictionary<Property::Map>& stateVisualsToAdd,
+                             Dictionary<Property::Map>& stateVisualsToChange,
+                             DictionaryKeys& stateVisualsToRemove)
+  {
+    DictionaryKeys copyOfStateVisualsToRemove = stateVisualsToRemove;
+
+    for( DictionaryKeys::iterator iter = copyOfStateVisualsToRemove.begin();
+         iter != copyOfStateVisualsToRemove.end(); ++iter )
+    {
+      const std::string& visualName = (*iter);
+      Property::Map* toMap = stateVisualsToAdd.Find( visualName );
+      if( toMap )
+      {
+        stateVisualsToChange.Add( visualName, *toMap );
+        stateVisualsToAdd.Remove( visualName );
+        Remove( stateVisualsToRemove, visualName );
+      }
+    }
+  }
+
+  void RemoveVisual( RegisteredVisualContainer& visuals, const std::string& visualName )
+  {
+    Actor self( mControlImpl.Self() );
+
+    for ( RegisteredVisualContainer::Iterator visualIter = visuals.Begin();
+          visualIter != visuals.End(); ++visualIter )
+    {
+      Toolkit::Visual::Base visual = (*visualIter)->visual;
+      if( visual && visual.GetName() == visualName )
+      {
+        Toolkit::GetImplementation(visual).SetOffStage( self );
+        (*visualIter)->visual.Reset();
+        visuals.Erase( visualIter );
+        break;
+      }
+    }
+  }
+
+  void RemoveVisuals( RegisteredVisualContainer& visuals, DictionaryKeys& removeVisuals )
+  {
+    Actor self( mControlImpl.Self() );
+    for( DictionaryKeys::iterator iter = removeVisuals.begin(); iter != removeVisuals.end(); ++iter )
+    {
+      const std::string visualName = *iter;
+      RemoveVisual( visuals, visualName );
+    }
+  }
+
+  Toolkit::Visual::Type GetVisualTypeFromMap( const Property::Map& map )
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::Property::TYPE, VISUAL_TYPE  );
+    Toolkit::Visual::Type type = Toolkit::Visual::IMAGE;
+    if( typeValue )
+    {
+      Scripting::GetEnumerationProperty( *typeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, type );
+    }
+    return type;
+  }
+
+  /**
+   * Go through the list of visuals that are common to both states.
+   * If they are different types, or are both image types with different
+   * URLs, then the existing visual needs moving and the new visual creating
+   */
+  void RecreateChangedVisuals( Dictionary<Property::Map>& stateVisualsToChange,
+                               Dictionary<Property::Map>& instancedProperties )
+  {
+    Dali::CustomActor handle( mControlImpl.GetOwner() );
+    for( Dictionary<Property::Map>::iterator iter = stateVisualsToChange.Begin();
+         iter != stateVisualsToChange.End(); ++iter )
+    {
+      const std::string& visualName = (*iter).key;
+      const Property::Map& toMap = (*iter).entry;
+
+      // is it a candidate for re-creation?
+      bool recreate = false;
+
+      Toolkit::Visual::Base visual = GetVisualByName( mVisuals, visualName );
+      if( visual )
+      {
+        Property::Map fromMap;
+        visual.CreatePropertyMap( fromMap );
+
+        Toolkit::Visual::Type fromType = GetVisualTypeFromMap( fromMap );
+        Toolkit::Visual::Type toType = GetVisualTypeFromMap( toMap );
+
+        if( fromType != toType )
+        {
+          recreate = true;
+        }
+        else
+        {
+          if( fromType == Toolkit::Visual::IMAGE )
+          {
+            Property::Value* fromUrl = fromMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+            Property::Value* toUrl = toMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+
+            if( fromUrl && toUrl )
+            {
+              std::string fromUrlString;
+              std::string toUrlString;
+              fromUrl->Get(fromUrlString);
+              toUrl->Get(toUrlString);
+
+              if( fromUrlString != toUrlString )
+              {
+                recreate = true;
+              }
+            }
+          }
+        }
+
+        const Property::Map* instancedMap = instancedProperties.FindConst( visualName );
+        if( recreate || instancedMap )
+        {
+          RemoveVisual( mVisuals, visualName );
+          Style::ApplyVisual( handle, visualName, toMap, instancedMap );
+        }
+        else
+        {
+          // @todo check to see if we can apply toMap without recreating the visual
+          // e.g. by setting only animatable properties
+          // For now, recreate all visuals, but merge in instance data.
+          RemoveVisual( mVisuals, visualName );
+          Style::ApplyVisual( handle, visualName, toMap, instancedMap );
+        }
+      }
+    }
+  }
+
+  void ReplaceStateVisualsAndProperties( const StylePtr oldState, const StylePtr newState, const std::string& subState )
+  {
+    // Collect all old visual names
+    DictionaryKeys stateVisualsToRemove;
+    if( oldState )
+    {
+      oldState->visuals.GetKeys( stateVisualsToRemove );
+      if( ! subState.empty() )
+      {
+        const StylePtr* oldSubState = oldState->subStates.FindConst(subState);
+        if( oldSubState )
+        {
+          DictionaryKeys subStateVisualsToRemove;
+          (*oldSubState)->visuals.GetKeys( subStateVisualsToRemove );
+          Merge( stateVisualsToRemove, subStateVisualsToRemove );
+        }
+      }
+    }
+
+    // Collect all new visual properties
+    Dictionary<Property::Map> stateVisualsToAdd;
+    if( newState )
+    {
+      stateVisualsToAdd = newState->visuals;
+      if( ! subState.empty() )
+      {
+        const StylePtr* newSubState = newState->subStates.FindConst(subState);
+        if( newSubState )
+        {
+          stateVisualsToAdd.Merge( (*newSubState)->visuals );
+        }
+      }
+    }
+
+    // If a name is in both add/remove, move it to change list.
+    Dictionary<Property::Map> stateVisualsToChange;
+    FindChangableVisuals( stateVisualsToAdd, stateVisualsToChange, stateVisualsToRemove);
+
+    // Copy instanced properties (e.g. text label) of current visuals
+    Dictionary<Property::Map> instancedProperties;
+    CopyInstancedProperties( mVisuals, instancedProperties );
+
+    // For each visual in remove list, remove from mVisuals
+    RemoveVisuals( mVisuals, stateVisualsToRemove );
+
+    // For each visual in add list, create and add to mVisuals
+    Dali::CustomActor handle( mControlImpl.GetOwner() );
+    Style::ApplyVisuals( handle, stateVisualsToAdd, instancedProperties );
+
+    // For each visual in change list, if it requires a new visual,
+    // remove old visual, create and add to mVisuals
+    RecreateChangedVisuals( stateVisualsToChange, instancedProperties );
+  }
+
+  void SetState( DevelControl::State newState, bool withTransitions=true )
+  {
+    DevelControl::State oldState = mState;
+    Dali::CustomActor handle( mControlImpl.GetOwner() );
+    DALI_LOG_INFO(gLogFilter, Debug::Concise, "Control::Impl::SetState: %s\n",
+                  (mState == DevelControl::NORMAL ? "NORMAL" :(
+                    mState == DevelControl::FOCUSED ?"FOCUSED" : (
+                      mState == DevelControl::DISABLED?"DISABLED":"NONE" ))));
+
+    if( mState != newState )
     {
       // If mState was Disabled, and new state is Focused, should probably
       // store that fact, e.g. in another property that FocusManager can access.
-      mState = state;
+      mState = newState;
 
       // Trigger state change and transitions
       // Apply new style, if stylemanager is available
@@ -549,15 +843,19 @@ public:
       if( styleManager )
       {
         const StylePtr stylePtr = GetImpl( styleManager ).GetRecordedStyle( Toolkit::Control( mControlImpl.GetOwner() ) );
+
         if( stylePtr )
         {
-          for( int i=mVisuals.Count()-1; i >= 0; i-- )
+          std::string oldStateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( oldState, ControlStateTable, ControlStateTableCount );
+          std::string newStateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( newState, ControlStateTable, ControlStateTableCount );
+
+          const StylePtr* newStateStyle = stylePtr->subStates.Find( newStateName );
+          const StylePtr* oldStateStyle = stylePtr->subStates.Find( oldStateName );
+          if( oldStateStyle && newStateStyle )
           {
-            mControlImpl.UnregisterVisual( mVisuals[i]->index );
+            // Only change if both state styles exist
+            ReplaceStateVisualsAndProperties( *oldStateStyle, *newStateStyle, mSubStateName );
           }
-
-          Dali::CustomActor handle( mControlImpl.GetOwner() );
-          stylePtr->ApplyVisualsAndPropertiesRecursively( handle );
         }
       }
     }
@@ -584,30 +882,12 @@ public:
           {
             StylePtr stateStyle(*state);
 
-            // Unregister existing visuals of this substate
-            const StylePtr* subState = stateStyle->subStates.Find( mSubStateName );
-            if( subState )
+            const StylePtr* newStateStyle = stateStyle->subStates.Find( subStateName );
+            const StylePtr* oldStateStyle = stateStyle->subStates.Find( mSubStateName );
+            if( oldStateStyle && newStateStyle )
             {
-              StylePtr subStateStyle(*subState);
-
-              for( Dictionary<Property::Map>::iterator iter = subStateStyle->visuals.Begin(); iter != subStateStyle->visuals.End(); ++iter )
-              {
-                const std::string& visualName = (*iter).key;
-                Dali::Property::Index index = handle.GetPropertyIndex( visualName );
-                if( index != Property::INVALID_INDEX )
-                {
-                  mControlImpl.UnregisterVisual( index );
-                }
-              }
-            }
-
-            // Register visuals of the new substate
-            const StylePtr* newSubState = stateStyle->subStates.Find( subStateName );
-            if( newSubState )
-            {
-              StylePtr newSubStateStyle(*newSubState);
-              newSubStateStyle->ApplyVisuals( handle );
-              newSubStateStyle->ApplyProperties( handle );
+              std::string empty;
+              ReplaceStateVisualsAndProperties( *oldStateStyle, *newStateStyle, empty );
             }
           }
         }
@@ -623,6 +903,11 @@ public:
   DevelControl::State mState;
   std::string mSubStateName;
 
+  int mLeftFocusableActorId;       ///< Actor ID of Left focusable control.
+  int mRightFocusableActorId;      ///< Actor ID of Right focusable control.
+  int mUpFocusableActorId;         ///< Actor ID of Up focusable control.
+  int mDownFocusableActorId;       ///< Actor ID of Down focusable control.
+
   RegisteredVisualContainer mVisuals; // Stores visuals needed by the control, non trivial type so std::vector used.
   std::string mStyleName;
   Vector4 mBackgroundColor;                       ///< The color of the background visual
@@ -653,17 +938,25 @@ public:
   static const PropertyRegistration PROPERTY_6;
   static const PropertyRegistration PROPERTY_7;
   static const PropertyRegistration PROPERTY_8;
+  static const PropertyRegistration PROPERTY_9;
+  static const PropertyRegistration PROPERTY_10;
+  static const PropertyRegistration PROPERTY_11;
+  static const PropertyRegistration PROPERTY_12;
 };
 
 // Properties registered without macro to use specific member variables.
-const PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "styleName",       Toolkit::Control::Property::STYLE_NAME,       Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "backgroundColor", Toolkit::Control::Property::BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "backgroundImage", Toolkit::Control::Property::BACKGROUND_IMAGE, Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "keyInputFocus",   Toolkit::Control::Property::KEY_INPUT_FOCUS,  Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "background",      Toolkit::Control::Property::BACKGROUND,       Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "tooltip",         Toolkit::DevelControl::Property::TOOLTIP,     Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_7( typeRegistration, "state",           Toolkit::DevelControl::Property::STATE,       Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_8( typeRegistration, "subState",        Toolkit::DevelControl::Property::SUB_STATE,   Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "styleName",              Toolkit::Control::Property::STYLE_NAME,                   Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "backgroundColor",        Toolkit::Control::Property::BACKGROUND_COLOR,             Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "backgroundImage",        Toolkit::Control::Property::BACKGROUND_IMAGE,             Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "keyInputFocus",          Toolkit::Control::Property::KEY_INPUT_FOCUS,              Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "background",             Toolkit::Control::Property::BACKGROUND,                   Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "tooltip",                Toolkit::DevelControl::Property::TOOLTIP,                 Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_7( typeRegistration, "state",                  Toolkit::DevelControl::Property::STATE,                   Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_8( typeRegistration, "subState",               Toolkit::DevelControl::Property::SUB_STATE,               Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_9( typeRegistration, "leftFocusableActorId",   Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_10( typeRegistration, "rightFocusableActorId", Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID,Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_11( typeRegistration, "upFocusableActorId",    Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID,   Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_12( typeRegistration, "downFocusableActorId",  Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
 
 Toolkit::Control Control::New()
 {
index 3f2f169..cd72a0f 100644 (file)
@@ -121,7 +121,7 @@ public:
        */
       KEY_INPUT_FOCUS,
       /**
-       * @brief name "background", mutually exclusive with BACKGROUND_COLOR & BACKGROUND_IMAGE, type Map or std::string for URL.
+       * @brief name "background", mutually exclusive with BACKGROUND_COLOR & BACKGROUND_IMAGE, type Map or std::string for URL or Vector4 for Color.
        * @SINCE_1_1.3
        */
       BACKGROUND,
index f193e71..0fc4fc0 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 29;
+const unsigned int TOOLKIT_MICRO_VERSION = 30;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index d56fdbe..ae48184 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-addon
 Summary:    DALi module for Node.JS
-Version:    1.2.29
+Version:    1.2.30
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index ae143f7..e49d1f8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.29
+Version:    1.2.30
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
index 2f81c64..d963c69 100755 (executable)
@@ -78,6 +78,11 @@ $(BUILT_SOURCES): SWIG/*.i
        ./property-wrapper.rb
        ./constructor-generator.rb
 
+# have manual binding for View now, but cannot stop swig generating binding for
+# it as otherwise swig will not generate correct binding for any classes inherited
+# from it, therefore have to delete the automatic binding for View in the end
+       rm -f automatic/csharp/View.cs
+
 dist-hook: $(BUILT_SOURCES)
        mkdir -p $(distdir)/automatic/cpp
        cp ./automatic/cpp/*.cpp $(distdir)/automatic/cpp
index 2b24a7c..30a2dfc 100755 (executable)
@@ -29,6 +29,8 @@
 %typemap(cscode) Dali::Actor::Property %{
   public static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get();
   public static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get();
+  public static readonly int SCREEN_POSITION = NDalicManualPINVOKE.Actor_Property_SCREEN_POSITION_get();
+  public static readonly int POSITION_USES_ANCHOR_POINT = NDalicManualPINVOKE.Actor_Property_POSITION_USES_ANCHOR_POINT_get();
 %}
 
 %typemap(cscode) Dali::Toolkit::Control::Property %{
index a2fa54e..fbf5a8e 100755 (executable)
@@ -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.
       }
     }
 
-    public bool StateFocusEnable
+    public Vector2 ScreenPosition
     {
+      get
+      {
+        Vector2 temp = new Vector2( 0.0f, 0.0f );
+        GetProperty( Actor.Property.SCREEN_POSITION ).Get( temp );
+        return temp;
+      }
+    }
+
+    protected bool PositionUsesAnchorPoint
+    {
+      get
+      {
+        bool temp = false;
+        GetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT ).Get( ref temp );
+        return temp;
+      }
       set
       {
-        SetKeyboardFocusable(value);
+        SetProperty( Actor.Property.POSITION_USES_ANCHOR_POINT, new Dali.Property.Value( value ) );
       }
+    }
+
+    public bool StateFocusEnable
+    {
       get
       {
         return IsKeyboardFocusable();
       }
+      set
+      {
+        SetKeyboardFocusable(value);
+      }
     }
 
     public bool IsOnStage
index ce7899b..6e106ae 100644 (file)
@@ -21,6 +21,75 @@ using Dali;
 
 namespace MyCSharpExample
 {
+    class MyView : View
+    {
+        private string _myOwnName;
+        public int _myCurrentValue;
+
+        public MyView()
+        {
+            _myCurrentValue = 0;
+        }
+
+        public string MyOwnName
+        {
+            get
+            {
+                return _myOwnName;
+            }
+            set
+            {
+              _myOwnName = value;
+            }
+        }
+    }
+
+    class MyButton : PushButton
+    {
+        private string _myOwnName;
+        public int _myCurrentValue;
+
+        public MyButton()
+        {
+            _myCurrentValue = 0;
+        }
+
+        public string MyOwnName
+        {
+            get
+            {
+                return _myOwnName;
+            }
+            set
+            {
+              _myOwnName = value;
+            }
+        }
+    }
+
+    class MySpin : Spin
+    {
+        private string _myOwnName;
+        public int _myCurrentValue;
+
+        public MySpin()
+        {
+            _myCurrentValue = 0;
+        }
+
+        public string MyOwnName
+        {
+            get
+            {
+                return _myOwnName;
+            }
+            set
+            {
+              _myOwnName = value;
+            }
+        }
+    }
+
     class Example
     {
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
@@ -39,6 +108,8 @@ namespace MyCSharpExample
 
         public void Initialize(object source, NUIApplicationInitEventArgs e)
         {
+            NavigationPropertiesTests();
+
             OperatorTests();
 
             CustomViewPropertyTest();
@@ -116,6 +187,8 @@ namespace MyCSharpExample
             color.B += 10;
             color.A += 10;
             Console.WriteLine( "    Color r =  " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A );
+
+            ViewDownCastTest();
         }
 
         public void RectanglePaddingClassTest()
@@ -194,6 +267,83 @@ namespace MyCSharpExample
             }
         }
 
+        public void NavigationPropertiesTests()
+        {
+            View view = new View();
+            View leftView, rightView, upView, downView, tmpView;
+
+            leftView = new View();
+            leftView.Name = "leftView";
+            rightView = new View();
+            rightView.Name = "rightView";
+            upView = new View();
+            upView.Name = "upView";
+            downView = new View();
+            downView.Name = "downView";
+
+            Stage.Instance.Add(leftView);
+            Stage.Instance.Add(rightView);
+            Stage.Instance.Add(upView);
+            Stage.Instance.Add(downView);
+
+            view.LeftFocusableView = leftView;
+            tmpView = view.LeftFocusableView;
+            if (string.Compare(tmpView.Name, "leftView") == 0)
+            {
+                Console.WriteLine("Passed: LeftFocusedView = " + tmpView.Name);
+            }
+            else
+            {
+                Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
+            }
+
+            view.RightFocusableView = rightView;
+            tmpView = view.RightFocusableView;
+            if (string.Compare(tmpView.Name, "rightView") == 0)
+            {
+                Console.WriteLine("Passed: RightFocusedView = " + tmpView.Name);
+            }
+            else
+            {
+                Console.WriteLine("Failed: RightFocusedView = " + tmpView.Name);
+            }
+
+            Stage.Instance.Add(view);
+
+            view.UpFocusableView = upView;
+            tmpView = view.UpFocusableView;
+            if (string.Compare(tmpView.Name, "upView") == 0)
+            {
+                Console.WriteLine("Passed: UpFocusedView = " + tmpView.Name);
+            }
+            else
+            {
+                Console.WriteLine("Failed: UpFocusedView = " + tmpView.Name);
+            }
+
+            view.DownFocusableView = downView;
+            tmpView = view.DownFocusableView;
+            if (string.Compare(tmpView.Name, "downView") == 0)
+            {
+                Console.WriteLine("Passed: DownFocusedView = " + tmpView.Name);
+            }
+            else
+            {
+                Console.WriteLine("Failed: DownFocusedView = " + tmpView.Name);
+            }
+
+            Stage.Instance.Remove(leftView);
+            tmpView = view.LeftFocusableView;
+            if (!tmpView)
+            {
+                Console.WriteLine("Passed: NULL LeftFocusedView");
+            }
+            else
+            {
+                Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
+            }
+        }
+
         public void OperatorTests()
         {
             Actor actor = new Actor();
@@ -374,7 +524,7 @@ namespace MyCSharpExample
             // Background property
             Property.Map background = new Property.Map();
             background.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color) )
-                .Add( Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red) );
+                      .Add( Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red) );
             spin.Background = background;
 
             background = spin.Background;
@@ -400,6 +550,17 @@ namespace MyCSharpExample
                 Console.WriteLine ("Custom View BackgroundColor property : test failed");
             }
 
+            // BackgroundImage property
+            spin.BackgroundImage = "background-image.jpg";
+            if(spin.BackgroundImage == "background-image.jpg")
+            {
+                Console.WriteLine ("Custom View BackgroundImage property : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("Custom View BackgroundImage property : test failed");
+            }
+
             // StyleName property
             spin.StyleName = "MyCustomStyle";
             if(spin.StyleName == "MyCustomStyle")
@@ -412,6 +573,133 @@ namespace MyCSharpExample
             }
         }
 
+        public void ViewDownCastTest()
+        {
+          View container = new View();
+          container.Position = new Position(-800.0f, -800.0f, 0.0f);
+          Stage.GetCurrent().Add(container);
+
+          // Test downcast for native control
+          TextLabel myLabel = new TextLabel();
+          myLabel.Name = "MyLabelName";
+          myLabel.Text = "MyText";
+
+          Console.WriteLine("myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text);
+
+          container.Add(myLabel);
+
+          Actor myLabelActor  = container.FindChildByName("MyLabelName");
+          if(myLabelActor)
+          {
+            TextLabel newLabel = View.DownCast<TextLabel>(myLabelActor);
+            if(newLabel)
+            {
+              Console.WriteLine("Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text);
+            }
+            else
+            {
+              Console.WriteLine("Downcast to TextLabel failed!");
+            }
+          }
+
+          // Test downcast for class directly inherited from View
+          MyView myView = new MyView();
+          myView.Name = "MyViewName";
+          myView.MyOwnName = "MyOwnViewName";
+          myView._myCurrentValue = 5;
+
+          Console.WriteLine("myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue);
+
+          container.Add(myView);
+
+          Actor myViewActor  = container.FindChildByName("MyViewName");
+          if(myViewActor)
+          {
+            MyView newView = View.DownCast<MyView>(myViewActor);
+            if(newView)
+            {
+              Console.WriteLine("Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue);
+            }
+            else
+            {
+              Console.WriteLine("Downcast to MyView failed!");
+            }
+          }
+
+          // Test downcast for class directly inherited from native control
+          MyButton myButton = new MyButton();
+          myButton.Name = "MyButtonName";
+          myButton.MyOwnName = "MyOwnViewName";
+          myButton.LabelText = "MyLabelText";
+          myButton._myCurrentValue = 5;
+
+          Console.WriteLine("myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue);
+
+          container.Add(myButton);
+
+          Actor myButtonActor  = container.FindChildByName("MyButtonName");
+          if(myButtonActor)
+          {
+            MyButton newButton = View.DownCast<MyButton>(myButtonActor);
+            if(newButton)
+            {
+              Console.WriteLine("Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue);
+            }
+            else
+            {
+              Console.WriteLine("Downcast to MyButton failed!");
+            }
+          }
+
+          // Test downcast for a CustomView
+          Spin spin = new Spin();
+          spin.Name = "SpinName";
+          spin.MaxValue = 8888;
+
+          Console.WriteLine("spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue);
+
+          container.Add(spin);
+
+          Actor spinActor  = container.FindChildByName("SpinName");
+          if(spinActor)
+          {
+            Spin newSpin = View.DownCast<Spin>(spinActor);
+            if(newSpin)
+            {
+              Console.WriteLine("Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue);
+            }
+            else
+            {
+              Console.WriteLine("Downcast to Spin failed!");
+            }
+          }
+
+          // Test downcast for class inherited from a CustomView
+          MySpin mySpin = new MySpin();
+          mySpin.Name = "MySpinName";
+          mySpin.MyOwnName = "MyOwnSpinName";
+          mySpin.MaxValue = 8888;
+          mySpin._myCurrentValue = 5;
+
+          Console.WriteLine("mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue);
+
+          container.Add(mySpin);
+
+          Actor mySpinActor  = container.FindChildByName("MySpinName");
+          if(mySpinActor)
+          {
+            MySpin newSpin = View.DownCast<MySpin>(mySpinActor);
+            if(newSpin)
+            {
+              Console.WriteLine("Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue);
+            }
+            else
+            {
+              Console.WriteLine("Downcast to MySpin failed!");
+            }
+          }
+        }
+
         public void MainLoop()
         {
             _application.MainLoop ();
index dbc388c..ade1b72 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.
@@ -53,7 +53,7 @@ namespace MyCSharpExample
             constants.Insert( "CONFIG_SCRIPT_LOG_LEVEL",  new Property.Value( "Verbose") );
             _builder.AddConstants( constants );
 
-            _builder.LoadFromFile( "./json/date-picker.json" );
+            _builder.LoadFromFile( "./json/date-picker-template.json" );
 
             // create the date-picker from the template in the json file
             BaseHandle handle =  _builder.Create( "date-picker");
@@ -66,21 +66,19 @@ namespace MyCSharpExample
             Actor month  =  actorTree.FindChildByName("Month" );
             Actor day  = actorTree.FindChildByName("Day");
 
-            // need to get the actual C# View associated with the actor,
-            _spinYear = (Spin ) ViewRegistry.GetCustomViewFromActor( year );
-            _spinMonth = (Spin ) ViewRegistry.GetCustomViewFromActor( month );
-            _spinDay = (Spin ) ViewRegistry.GetCustomViewFromActor( day );
+            // need to get the actual C# Spin object associated with the actor,
+            _spinYear = View.DownCast<Spin>( year );
+            _spinMonth = View.DownCast<Spin>( month );
+            _spinDay = View.DownCast<Spin>( day );
 
             _spinYear.Value = 2099;
             _spinMonth.Value = 5;
             _spinDay.Value = 23;
 
-
             _spinYear.SetKeyboardFocusable(true);
             _spinMonth.SetKeyboardFocusable(true);
             _spinDay.SetKeyboardFocusable(true);
 
-
             FocusManager keyboardFocusManager = FocusManager.Instance;
             keyboardFocusManager.PreFocusChange += OnKeyboardPreFocusChange;
             keyboardFocusManager.FocusedActorEnterKeyPressed += OnFocusedActorEnterKeyPressed;
index 4e96f02..a1d85dd 100755 (executable)
@@ -34,21 +34,23 @@ extern "C" {
 #endif
 
 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;
+  return Dali::DevelActor::Property::SIBLING_ORDER;
 }
 
-SWIGEXPORT float SWIGSTDCALL CSharp_Actor_Property_OPACITY_get() {
-  int jresult ;
-  int result;
+SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_OPACITY_get() {
 
-  result = (float)Dali::DevelActor::Property::OPACITY;
-  jresult = (int)result;
-  return jresult;
+  return Dali::DevelActor::Property::OPACITY;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_SCREEN_POSITION_get() {
+
+  return Dali::DevelActor::Property::SCREEN_POSITION;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_POSITION_USES_ANCHOR_POINT_get() {
+
+  return Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT;
 }
 
 SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_TOOLTIP_get() {
@@ -78,6 +80,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_SUB_STATE_get() {
   return jresult;
 }
 
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_LEFT_FOCUSABLE_ACTOR_ID_get() {
+  return Dali::Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get() {
+  return Dali::Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_UP_FOCUSABLE_ACTOR_ID_get() {
+  return Dali::Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_DOWN_FOCUSABLE_ACTOR_ID_get() {
+  return Dali::Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID;
+}
+
 SWIGEXPORT int SWIGSTDCALL CSharp_ItemView_Property_LAYOUT_get() {
   int jresult ;
   int result;
index 9bf6950..d0d531a 100644 (file)
@@ -35,24 +35,28 @@ SwigDirector_ViewWrapperImpl::~SwigDirector_ViewWrapperImpl() {
 
 
 void SwigDirector_ViewWrapperImpl::OnStageConnection(int depth) {
-    Dali::Toolkit::Internal::Control::OnStageConnection(depth);
     swig_callbackOnStageConnection(depth);
+
+    Dali::Toolkit::Internal::Control::OnStageConnection(depth);
 }
 
 void SwigDirector_ViewWrapperImpl::OnStageDisconnection() {
     swig_callbackOnStageDisconnection();
+
     Dali::Toolkit::Internal::Control::OnStageDisconnection();
 }
 
 void SwigDirector_ViewWrapperImpl::OnChildAdd(Dali::Actor &child) {
-    Dali::Toolkit::Internal::Control::OnChildAdd( child );
     void * jchild = (Dali::Actor *) &child;
     swig_callbackOnChildAdd(jchild);
+
+    Dali::Toolkit::Internal::Control::OnChildAdd( child );
 }
 
 void SwigDirector_ViewWrapperImpl::OnChildRemove(Dali::Actor &child) {
     void * jchild = (Dali::Actor *) &child;
     swig_callbackOnChildRemove(jchild);
+
     Dali::Toolkit::Internal::Control::OnChildRemove( child );
 }
 
@@ -60,24 +64,23 @@ void SwigDirector_ViewWrapperImpl::OnPropertySet(Dali::Property::Index index, Da
   int jindex  ;
   void * jpropertyValue  ;
 
-  if (!swig_callbackOnPropertySet) {
-    Dali::Toolkit::Internal::ControlWrapper::OnPropertySet(index,propertyValue);
-    return;
-  } else {
-    jindex = index;
-    jpropertyValue = (void *)new Dali::Property::Value((const Dali::Property::Value &)propertyValue);
-    swig_callbackOnPropertySet(jindex, jpropertyValue);
-  }
+  jindex = index;
+  jpropertyValue = (void *)new Dali::Property::Value((const Dali::Property::Value &)propertyValue);
+  swig_callbackOnPropertySet(jindex, jpropertyValue);
+
+  Dali::Toolkit::Internal::ControlWrapper::OnPropertySet(index,propertyValue);
 }
 
 void SwigDirector_ViewWrapperImpl::OnSizeSet(Dali::Vector3 const &targetSize) {
-  Dali::Toolkit::Internal::Control::OnSizeSet(targetSize);
   swig_callbackOnSizeSet((Dali::Vector3 *) &targetSize);
+
+  Dali::Toolkit::Internal::Control::OnSizeSet(targetSize);
 }
 
 void SwigDirector_ViewWrapperImpl::OnSizeAnimation(Dali::Animation &animation, Dali::Vector3 const &targetSize) {
-  Dali::Toolkit::Internal::Control::OnSizeAnimation(animation,targetSize);
   swig_callbackOnSizeAnimation(&animation, (Dali::Vector3 *) &targetSize);
+
+  Dali::Toolkit::Internal::Control::OnSizeAnimation(animation,targetSize);
 }
 
 bool SwigDirector_ViewWrapperImpl::OnTouchEvent(Dali::TouchEvent const &event) {
@@ -144,28 +147,22 @@ void SwigDirector_ViewWrapperImpl::OnRelayout(Dali::Vector2 const &size, Dali::R
   void * jsize = 0 ;
   void * jcontainer = 0 ;
 
-  if (!swig_callbackOnRelayout) {
-    Dali::Toolkit::Internal::Control::OnRelayout(size,container);
-    return;
-  } else {
-    jsize = (Dali::Vector2 *) &size;
-    jcontainer = (Dali::RelayoutContainer *) &container;
-    swig_callbackOnRelayout(jsize, jcontainer);
-  }
+  jsize = (Dali::Vector2 *) &size;
+  jcontainer = (Dali::RelayoutContainer *) &container;
+  swig_callbackOnRelayout(jsize, jcontainer);
+
+  Dali::Toolkit::Internal::Control::OnRelayout(size,container);
 }
 
 void SwigDirector_ViewWrapperImpl::OnSetResizePolicy(Dali::ResizePolicy::Type policy, Dali::Dimension::Type dimension) {
   int jpolicy  ;
   int jdimension  ;
 
-  if (!swig_callbackOnSetResizePolicy) {
-    Dali::Toolkit::Internal::Control::OnSetResizePolicy(policy,dimension);
-    return;
-  } else {
-    jpolicy = (int)policy;
-    jdimension = (int)dimension;
-    swig_callbackOnSetResizePolicy(jpolicy, jdimension);
-  }
+  jpolicy = (int)policy;
+  jdimension = (int)dimension;
+  swig_callbackOnSetResizePolicy(jpolicy, jdimension);
+
+  Dali::Toolkit::Internal::Control::OnSetResizePolicy(policy,dimension);
 }
 
 Dali::Vector3 SwigDirector_ViewWrapperImpl::GetNaturalSize() {
@@ -250,45 +247,38 @@ bool SwigDirector_ViewWrapperImpl::RelayoutDependentOnChildren(Dali::Dimension::
 void SwigDirector_ViewWrapperImpl::OnCalculateRelayoutSize(Dali::Dimension::Type dimension) {
   int jdimension  ;
 
-  if (!swig_callbackOnCalculateRelayoutSize) {
-    Dali::Toolkit::Internal::Control::OnCalculateRelayoutSize(dimension);
-    return;
-  } else {
-    jdimension = (int)dimension;
-    swig_callbackOnCalculateRelayoutSize(jdimension);
-  }
+  jdimension = (int)dimension;
+  swig_callbackOnCalculateRelayoutSize(jdimension);
+
+  Dali::Toolkit::Internal::Control::OnCalculateRelayoutSize(dimension);
 }
 
 void SwigDirector_ViewWrapperImpl::OnLayoutNegotiated(float size, Dali::Dimension::Type dimension) {
   float jsize  ;
   int jdimension  ;
 
-  if (!swig_callbackOnLayoutNegotiated) {
-    Dali::Toolkit::Internal::Control::OnLayoutNegotiated(size,dimension);
-    return;
-  } else {
-    jsize = size;
-    jdimension = (int)dimension;
-    swig_callbackOnLayoutNegotiated(jsize, jdimension);
-  }
+  jsize = size;
+  jdimension = (int)dimension;
+  swig_callbackOnLayoutNegotiated(jsize, jdimension);
+
+  Dali::Toolkit::Internal::Control::OnLayoutNegotiated(size,dimension);
 }
 
 void SwigDirector_ViewWrapperImpl::OnInitialize() {
-  if (!swig_callbackOnInitialize) {
-    Dali::Toolkit::Internal::Control::OnInitialize();
-    return;
-  } else {
-    swig_callbackOnInitialize();
-  }
+  swig_callbackOnInitialize();
+
+  Dali::Toolkit::Internal::Control::OnInitialize();
 }
 
 void SwigDirector_ViewWrapperImpl::OnControlChildAdd(Dali::Actor &child) {
-  Dali::Toolkit::Internal::Control::OnControlChildAdd(child);
   swig_callbackOnControlChildAdd(&child);
+
+  Dali::Toolkit::Internal::Control::OnControlChildAdd(child);
 }
 
 void SwigDirector_ViewWrapperImpl::OnControlChildRemove(Dali::Actor &child) {
   swig_callbackOnControlChildRemove(&child);
+
   Dali::Toolkit::Internal::Control::OnControlChildRemove(child);
 }
 
@@ -296,14 +286,11 @@ void SwigDirector_ViewWrapperImpl::OnStyleChange(Dali::Toolkit::StyleManager sty
   void * jstyleManager  ;
   int jchange  ;
 
-  if (!swig_callbackOnStyleChange) {
-    Dali::Toolkit::Internal::Control::OnStyleChange(styleManager,change);
-    return;
-  } else {
-    jstyleManager = (void *)new Dali::Toolkit::StyleManager((const Dali::Toolkit::StyleManager &)styleManager);
-    jchange = (int)change;
-    swig_callbackOnStyleChange(jstyleManager, jchange);
-  }
+  jstyleManager = (void *)new Dali::Toolkit::StyleManager((const Dali::Toolkit::StyleManager &)styleManager);
+  jchange = (int)change;
+  swig_callbackOnStyleChange(jstyleManager, jchange);
+
+  Dali::Toolkit::Internal::Control::OnStyleChange(styleManager,change);
 }
 
 bool SwigDirector_ViewWrapperImpl::OnAccessibilityActivated() {
@@ -378,21 +365,15 @@ bool SwigDirector_ViewWrapperImpl::OnAccessibilityZoom() {
 }
 
 void SwigDirector_ViewWrapperImpl::OnKeyInputFocusGained() {
-  if (!swig_callbackOnKeyInputFocusGained) {
-    Dali::Toolkit::Internal::Control::OnKeyInputFocusGained();
-    return;
-  } else {
-    swig_callbackOnKeyInputFocusGained();
-  }
+  swig_callbackOnKeyInputFocusGained();
+
+  Dali::Toolkit::Internal::Control::OnKeyInputFocusGained();
 }
 
 void SwigDirector_ViewWrapperImpl::OnKeyInputFocusLost() {
-  if (!swig_callbackOnKeyInputFocusLost) {
-    Dali::Toolkit::Internal::Control::OnKeyInputFocusLost();
-    return;
-  } else {
-    swig_callbackOnKeyInputFocusLost();
-  }
+  swig_callbackOnKeyInputFocusLost();
+
+  Dali::Toolkit::Internal::Control::OnKeyInputFocusLost();
 }
 
 Dali::Actor SwigDirector_ViewWrapperImpl::GetNextKeyboardFocusableActor(Dali::Actor currentFocusedActor, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) {
@@ -420,14 +401,10 @@ Dali::Actor SwigDirector_ViewWrapperImpl::GetNextKeyboardFocusableActor(Dali::Ac
 
 void SwigDirector_ViewWrapperImpl::OnKeyboardFocusChangeCommitted(Dali::Actor commitedFocusableActor) {
   void * jcommitedFocusableActor  ;
+  jcommitedFocusableActor = (void *)new Dali::Actor((const Dali::Actor &)commitedFocusableActor);
+  swig_callbackOnKeyboardFocusChangeCommitted(jcommitedFocusableActor);
 
-  if (!swig_callbackOnKeyboardFocusChangeCommitted) {
-    Dali::Toolkit::Internal::Control::OnKeyboardFocusChangeCommitted(commitedFocusableActor);
-    return;
-  } else {
-    jcommitedFocusableActor = (void *)new Dali::Actor((const Dali::Actor &)commitedFocusableActor);
-    swig_callbackOnKeyboardFocusChangeCommitted(jcommitedFocusableActor);
-  }
+  Dali::Toolkit::Internal::Control::OnKeyboardFocusChangeCommitted(commitedFocusableActor);
 }
 
 bool SwigDirector_ViewWrapperImpl::OnKeyboardEnter() {
@@ -445,78 +422,35 @@ bool SwigDirector_ViewWrapperImpl::OnKeyboardEnter() {
 
 void SwigDirector_ViewWrapperImpl::OnPinch(Dali::PinchGesture const &pinch) {
   void * jpinch = 0 ;
+  jpinch = (Dali::PinchGesture *) &pinch;
+  swig_callbackOnPinch(jpinch);
 
-  if (!swig_callbackOnPinch) {
-    Dali::Toolkit::Internal::Control::OnPinch(pinch);
-    return;
-  } else {
-    jpinch = (Dali::PinchGesture *) &pinch;
-    swig_callbackOnPinch(jpinch);
-  }
+  Dali::Toolkit::Internal::Control::OnPinch(pinch);
 }
 
 void SwigDirector_ViewWrapperImpl::OnPan(Dali::PanGesture const &pan) {
   void * jpan = 0 ;
+  jpan = (Dali::PanGesture *) &pan;
+  swig_callbackOnPan(jpan);
 
-  if (!swig_callbackOnPan) {
-    Dali::Toolkit::Internal::Control::OnPan(pan);
-    return;
-  } else {
-    jpan = (Dali::PanGesture *) &pan;
-    swig_callbackOnPan(jpan);
-  }
+  Dali::Toolkit::Internal::Control::OnPan(pan);
 }
 
 void SwigDirector_ViewWrapperImpl::OnTap(Dali::TapGesture const &tap) {
   void * jtap = 0 ;
+  jtap = (Dali::TapGesture *) &tap;
+  swig_callbackOnTap(jtap);
 
-  if (!swig_callbackOnTap) {
-    Dali::Toolkit::Internal::Control::OnTap(tap);
-    return;
-  } else {
-    jtap = (Dali::TapGesture *) &tap;
-    swig_callbackOnTap(jtap);
-  }
+  Dali::Toolkit::Internal::Control::OnTap(tap);
 }
 
 void SwigDirector_ViewWrapperImpl::OnLongPress(Dali::LongPressGesture const &longPress) {
   void * jlongPress = 0 ;
 
-  if (!swig_callbackOnLongPress) {
-    Dali::Toolkit::Internal::Control::OnLongPress(longPress);
-    return;
-  } else {
-    jlongPress = (Dali::LongPressGesture *) &longPress;
-    swig_callbackOnLongPress(jlongPress);
-  }
-}
-
-void SwigDirector_ViewWrapperImpl::SignalConnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback) {
-  void * jslotObserver = 0 ;
-  void * jcallback = 0 ;
-
-  if (!swig_callbackSignalConnected) {
-    Dali::Toolkit::Internal::Control::SignalConnected(slotObserver,callback);
-    return;
-  } else {
-    jslotObserver = (void *) slotObserver;
-    jcallback = (void *) callback;
-    swig_callbackSignalConnected(jslotObserver, jcallback);
-  }
-}
-
-void SwigDirector_ViewWrapperImpl::SignalDisconnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback) {
-  void * jslotObserver = 0 ;
-  void * jcallback = 0 ;
+  jlongPress = (Dali::LongPressGesture *) &longPress;
+  swig_callbackOnLongPress(jlongPress);
 
-  if (!swig_callbackSignalDisconnected) {
-    Dali::Toolkit::Internal::Control::SignalDisconnected(slotObserver,callback);
-    return;
-  } else {
-    jslotObserver = (void *) slotObserver;
-    jcallback = (void *) callback;
-    swig_callbackSignalDisconnected(jslotObserver, jcallback);
-  }
+  Dali::Toolkit::Internal::Control::OnLongPress(longPress);
 }
 
 Dali::Toolkit::Internal::Control::Extension *SwigDirector_ViewWrapperImpl::GetControlExtension() {
index f95d74a..9b5a8be 100644 (file)
@@ -140,8 +140,6 @@ public:
     virtual void OnPan(Dali::PanGesture const &pan);
     virtual void OnTap(Dali::TapGesture const &tap);
     virtual void OnLongPress(Dali::LongPressGesture const &longPress);
-    virtual void SignalConnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback);
-    virtual void SignalDisconnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback);
     virtual Dali::Toolkit::Internal::Control::Extension *GetControlExtension();
 
     typedef void (SWIGSTDCALL* SWIG_Callback0_t)(int);
index 9c54cdd..83540d3 100644 (file)
@@ -60,14 +60,14 @@ namespace Dali
             viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
             viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
             viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
-            viewWrapperImpl.SignalConnected = new ViewWrapperImpl.SignalConnectedDelegate(SignalConnected);
-            viewWrapperImpl.SignalDisconnected = new ViewWrapperImpl.SignalDisconnectedDelegate(SignalDisconnected);
 
             // Make sure CustomView is initialized.
             OnInitialize();
 
-            // Make sure the style of actors/visuals initialized above are applied by the style manager.
-            viewWrapperImpl.ApplyThemeStyle();
+            // Set the StyleName the name of the View
+            // We have to do this because the StyleManager on Native side can't workout it out
+            // This will also ensure that the style of actors/visuals initialized above are applied by the style manager.
+            SetStyleName( this.GetType().Name );
         }
 
         /**
@@ -805,14 +805,6 @@ namespace Dali
         {
         }
 
-        private void SignalConnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
-        {
-        }
-
-        private void SignalDisconnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
-        {
-        }
-
         private void OnControlChildAdd(Actor child)
         {
         }
index ea80496..6694174 100755 (executable)
@@ -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.
@@ -193,6 +193,12 @@ namespace Dali
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_OPACITY_get")]
         public static extern int Actor_Property_OPACITY_get();
 
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_SCREEN_POSITION_get")]
+        public static extern int Actor_Property_SCREEN_POSITION_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_POSITION_USES_ANCHOR_POINT_get")]
+        public static extern int Actor_Property_POSITION_USES_ANCHOR_POINT_get();
+
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_TOOLTIP_get")]
         public static extern int View_Property_TOOLTIP_get();
 
@@ -202,6 +208,18 @@ namespace Dali
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_SUB_STATE_get")]
         public static extern int View_Property_SUB_STATE_get();
 
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_LEFT_FOCUSABLE_ACTOR_ID_get")]
+        public static extern int View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get")]
+        public static extern int View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_UP_FOCUSABLE_ACTOR_ID_get")]
+        public static extern int View_Property_UP_FOCUSABLE_ACTOR_ID_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_DOWN_FOCUSABLE_ACTOR_ID_get")]
+        public static extern int View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
+
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_ItemView_Property_LAYOUT_get")]
         public static extern int ItemView_Property_LAYOUT_get();
 
diff --git a/plugins/dali-swig/manual/csharp/View.cs b/plugins/dali-swig/manual/csharp/View.cs
new file mode 100644 (file)
index 0000000..fbc408f
--- /dev/null
@@ -0,0 +1,1516 @@
+/** 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.
+*
+*/
+
+namespace Dali {
+
+    using System;
+    using System.Runtime.InteropServices;
+
+
+public class View : CustomActor {
+  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+  internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) {
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+
+    // Register this instance of view in the view registry.
+    ViewRegistry.RegisterView(this);
+
+    // By default, we do not want the position to use the anchor point
+    this.PositionUsesAnchorPoint = false;
+  }
+
+  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
+    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~View() {
+    DisposeQueue.Instance.Add(this);
+
+    // Unregister this instance of view from the view registry.
+    ViewRegistry.UnregisterView(this);
+  }
+
+  public override void Dispose() {
+    if (!Stage.IsInstalled()) {
+      DisposeQueue.Instance.Add(this);
+      return;
+    }
+
+    lock(this) {
+      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          NDalicPINVOKE.delete_View(swigCPtr);
+        }
+        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+      }
+      global::System.GC.SuppressFinalize(this);
+      base.Dispose();
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via KeyInputFocusGained signal
+   *
+   */
+  public class KeyInputFocusGainedEventArgs : EventArgs
+  {
+    private View _view;
+
+    /**
+     * @brief View - is the view that gets Key Input Focus
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via KeyInputFocusLost signal
+   *
+   */
+  public class KeyInputFocusLostEventArgs : EventArgs
+  {
+    private View _view;
+
+    /**
+     * @brief View - is the view that loses Key Input Focus
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via Key signal
+   *
+   */
+  public class KeyEventArgs : EventArgs
+  {
+    private View _view;
+    private Key _key;
+
+    /**
+     * @brief View - is the view that recieves the key.
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+
+    /**
+     * @brief Key - is the key sent to the View.
+     *
+     */
+    public Key Key
+    {
+      get
+      {
+        return _key;
+      }
+      set
+      {
+        _key = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via OnRelayout signal
+   *
+   */
+  public class OnRelayoutEventArgs : EventArgs
+  {
+    private View _view;
+
+    /**
+     * @brief View - is the view that is being resized upon relayout
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+  }
+
+
+  /**
+   * @brief Event arguments that passed via Touch signal
+   *
+   */
+  public class TouchEventArgs : EventArgs
+  {
+     private View _view;
+     private Touch _touch;
+
+    /**
+     * @brief View - is the view that is being touched
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+
+    /**
+     * @brief Touch - contains the information of touch points
+     *
+     */
+    public Touch Touch
+    {
+      get
+      {
+        return _touch;
+      }
+      set
+      {
+        _touch = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via Hover signal
+   *
+   */
+  public class HoverEventArgs : EventArgs
+  {
+     private View _view;
+     private Hover _hover;
+
+    /**
+     * @brief View - is the view that is being hovered
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+
+    /**
+     * @brief Hover - contains touch points that represent the points
+     * that are currently being hovered or the points where a hover has stopped
+     *
+     */
+    public Hover Hover
+    {
+      get
+      {
+        return _hover;
+      }
+      set
+      {
+        _hover = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via Wheel signal
+   *
+   */
+  public class WheelEventArgs : EventArgs
+  {
+    private View _view;
+    private Wheel _wheel;
+
+    /**
+     * @brief View - is the view that is being wheeled
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+
+    /**
+     * @brief Wheel - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL
+     *
+     */
+    public Wheel Wheel
+    {
+      get
+      {
+        return _wheel;
+      }
+      set
+      {
+        _wheel = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via OnStage signal
+   *
+   */
+  public class OnStageEventArgs : EventArgs
+  {
+  private View _view;
+
+    /**
+     * @brief View - is the view that is being connected to the stage
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+  }
+
+  /**
+   * @brief Event arguments that passed via OffStage signal
+   *
+   */
+  public class OffStageEventArgs : EventArgs
+  {
+  private View _view;
+
+    /**
+     * @brief View - is the view that is being disconnected from the stage
+     *
+     */
+    public View View
+    {
+      get
+      {
+        return _view;
+      }
+      set
+      {
+        _view = value;
+      }
+    }
+  }
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
+  private DaliEventHandler<object,KeyInputFocusGainedEventArgs> _KeyInputFocusGainedEventHandler;
+  private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
+  private DaliEventHandler<object,KeyInputFocusLostEventArgs> _KeyInputFocusLostEventHandler;
+  private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr key);
+  private DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> _KeyHandler;
+  private KeyCallbackDelegate _KeyCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate void OnRelayoutEventCallbackDelegate(IntPtr control);
+  private DaliEventHandler<object,OnRelayoutEventArgs> _viewOnRelayoutEventHandler;
+  private OnRelayoutEventCallbackDelegate _viewOnRelayoutEventCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate bool TouchCallbackDelegate(IntPtr view, IntPtr touch);
+  private DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> _viewTouchHandler;
+  private TouchCallbackDelegate _viewTouchCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate bool HoverCallbackDelegate(IntPtr view, IntPtr hover);
+  private DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> _viewHoverHandler;
+  private HoverCallbackDelegate _viewHoverCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate bool WheelCallbackDelegate(IntPtr view, IntPtr wheel);
+  private DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> _viewWheelHandler;
+  private WheelCallbackDelegate _viewWheelCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate void OnStageEventCallbackDelegate(IntPtr control);
+  private DaliEventHandler<object,OnStageEventArgs> _viewOnStageEventHandler;
+  private OnStageEventCallbackDelegate _viewOnStageEventCallbackDelegate;
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate void OffStageEventCallbackDelegate(IntPtr control);
+  private DaliEventHandler<object,OffStageEventArgs> _viewOffStageEventHandler;
+  private OffStageEventCallbackDelegate _viewOffStageEventCallbackDelegate;
+
+  /**
+   * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler<object,KeyInputFocusGainedEventArgs>)
+   * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
+   */
+  public event DaliEventHandler<object,KeyInputFocusGainedEventArgs> KeyInputFocusGained
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_KeyInputFocusGainedEventHandler == null)
+        {
+          _KeyInputFocusGainedEventHandler += value;
+          Console.WriteLine("View Key EVENT Locked....");
+          _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
+          this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_KeyInputFocusGainedEventHandler != null)
+        {
+          this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
+        }
+
+        _KeyInputFocusGainedEventHandler -= value;
+      }
+    }
+  }
+
+  private void OnKeyInputFocusGained(IntPtr view)
+  {
+    KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
+    Console.WriteLine("View Key ....");
+    // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
+    e.View = Dali.View.GetViewFromPtr(view);
+
+    if (_KeyInputFocusGainedEventHandler != null)
+    {
+      //here we send all data to user event handlers
+      _KeyInputFocusGainedEventHandler(this, e);
+    }
+
+  }
+
+  /**
+   * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of KeyInputFocusLostEventHandler-DaliEventHandler<object,KeyInputFocusLostEventArgs>)
+   * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
+   */
+  public event DaliEventHandler<object,KeyInputFocusLostEventArgs> KeyInputFocusLost
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_KeyInputFocusLostEventHandler == null)
+        {
+          _KeyInputFocusLostEventHandler += value;
+
+          _KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
+          this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_KeyInputFocusLostEventHandler != null)
+        {
+          this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
+        }
+
+        _KeyInputFocusLostEventHandler -= value;
+      }
+    }
+  }
+
+  private void OnKeyInputFocusLost(IntPtr view)
+  {
+    KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
+
+    // Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
+    e.View = Dali.View.GetViewFromPtr(view);
+
+    if (_KeyInputFocusLostEventHandler != null)
+    {
+      //here we send all data to user event handlers
+      _KeyInputFocusLostEventHandler(this, e);
+    }
+  }
+
+  /**
+   * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of KeyHandler-DaliEventHandlerWithReturnType<object,KeyEventArgs,bool>)
+   * provided by the user. KeyPressed signal is emitted when key event is received.
+   */
+  public event DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> KeyPressed
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_KeyHandler == null)
+        {
+          _KeyHandler += value;
+
+          _KeyCallbackDelegate = new KeyCallbackDelegate(OnKey);
+          this.KeyEventSignal().Connect(_KeyCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_KeyHandler != null)
+        {
+          this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
+        }
+
+        _KeyHandler -= value;
+      }
+    }
+  }
+
+  private bool OnKey(IntPtr view, IntPtr key)
+  {
+    KeyEventArgs e = new KeyEventArgs();
+
+    // Populate all members of "e" (KeyEventArgs) with real data
+    e.View = Dali.View.GetViewFromPtr(view);
+    e.Key = Dali.Key.GetKeyFromPtr(key);
+
+    if (_KeyHandler != null)
+    {
+      //here we send all data to user event handlers
+      return _KeyHandler(this, e);
+    }
+    return false;
+
+  }
+
+  /**
+   * @brief Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of OnRelayoutEventHandler) provided by the user.
+   * OnRelayout signal is emitted after the size has been set on the view during relayout.
+   */
+  public event DaliEventHandler<object,OnRelayoutEventArgs> OnRelayoutEvent
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_viewOnRelayoutEventHandler == null)
+        {
+          _viewOnRelayoutEventHandler += value;
+          Console.WriteLine("View OnRelayoutEventArgs Locked....");
+          _viewOnRelayoutEventCallbackDelegate = new OnRelayoutEventCallbackDelegate(OnRelayout);
+          this.OnRelayoutSignal().Connect(_viewOnRelayoutEventCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_viewOnRelayoutEventHandler != null)
+        {
+          this.OnRelayoutSignal().Disconnect(_viewOnRelayoutEventCallbackDelegate);
+        }
+
+        _viewOnRelayoutEventHandler -= value;
+      }
+    }
+  }
+
+  // Callback for View OnRelayout signal
+  private void OnRelayout(IntPtr data)
+  {
+    OnRelayoutEventArgs e = new OnRelayoutEventArgs();
+    Console.WriteLine("View OnRelayoutEventArgs....");
+    // Populate all members of "e" (OnRelayoutEventArgs) with real data
+    e.View = View.GetViewFromPtr(data);
+
+    if (_viewOnRelayoutEventHandler != null)
+    {
+      //here we send all data to user event handlers
+      _viewOnRelayoutEventHandler(this, e);
+    }
+  }
+
+  /**
+   * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of TouchHandler-DaliEventHandlerWithReturnType<object,TouchEventArgs,bool>)
+   * provided by the user. Touched signal is emitted when touch input is received.
+   */
+  public event DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> Touched
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_viewTouchHandler == null)
+        {
+          _viewTouchHandler += value;
+          Console.WriteLine("View Touch EVENT LOCKED....");
+          _viewTouchCallbackDelegate = new TouchCallbackDelegate(OnTouch);
+          this.TouchSignal().Connect(_viewTouchCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_viewTouchHandler != null)
+        {
+          this.TouchSignal().Disconnect(_viewTouchCallbackDelegate);
+        }
+
+        _viewTouchHandler -= value;
+      }
+    }
+  }
+
+  // Callback for View TouchSignal
+  private bool OnTouch(IntPtr view, IntPtr touch)
+  {
+    TouchEventArgs e = new TouchEventArgs();
+    Console.WriteLine("View Touch EVENT....");
+    // Populate all members of "e" (TouchEventArgs) with real data
+    e.View = View.GetViewFromPtr(view);
+    e.Touch = Dali.Touch.GetTouchFromPtr(touch);
+
+    if (_viewTouchHandler != null)
+    {
+      //here we send all data to user event handlers
+      return _viewTouchHandler(this, e);
+    }
+
+    return false;
+  }
+
+  /**
+   * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of HoverHandler-DaliEventHandlerWithReturnType<object,HoverEventArgs,bool>)
+   * provided by the user. Hovered signal is emitted when hover input is received.
+   */
+  public event DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> Hovered
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_viewHoverHandler == null)
+        {
+          _viewHoverHandler += value;
+
+          _viewHoverCallbackDelegate = new HoverCallbackDelegate(OnHover);
+          this.HoveredSignal().Connect(_viewHoverCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_viewHoverHandler != null)
+        {
+          this.HoveredSignal().Disconnect(_viewHoverCallbackDelegate);
+        }
+
+        _viewHoverHandler -= value;
+      }
+    }
+  }
+
+  // Callback for View Hover signal
+  private bool OnHover(IntPtr view, IntPtr hover)
+  {
+    HoverEventArgs e = new HoverEventArgs();
+
+    // Populate all members of "e" (HoverEventArgs) with real data
+    e.View = View.GetViewFromPtr(view);
+    e.Hover = Dali.Hover.GetHoverFromPtr(hover);
+
+    if (_viewHoverHandler != null)
+    {
+      //here we send all data to user event handlers
+      return _viewHoverHandler(this, e);
+    }
+
+    return false;
+  }
+
+  /**
+   * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of WheelHandler-DaliEventHandlerWithReturnType<object,WheelEventArgs,bool>)
+   * provided by the user. WheelMoved signal is emitted when wheel event is received.
+   */
+  public event DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> WheelMoved
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_viewWheelHandler == null)
+        {
+          _viewWheelHandler += value;
+          Console.WriteLine("View Wheel EVENT LOCKED....");
+          _viewWheelCallbackDelegate = new WheelCallbackDelegate(OnWheel);
+          this.WheelEventSignal().Connect(_viewWheelCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_viewWheelHandler != null)
+        {
+          this.WheelEventSignal().Disconnect(_viewWheelCallbackDelegate);
+        }
+
+        _viewWheelHandler -= value;
+      }
+    }
+  }
+
+  // Callback for View Wheel signal
+  private bool OnWheel(IntPtr view, IntPtr wheel)
+  {
+    WheelEventArgs e = new WheelEventArgs();
+    Console.WriteLine("View Wheel EVENT ....");
+    // Populate all members of "e" (WheelEventArgs) with real data
+    e.View = View.GetViewFromPtr(view);
+    e.Wheel = Dali.Wheel.GetWheelFromPtr(wheel);
+
+    if (_viewWheelHandler != null)
+    {
+      //here we send all data to user event handlers
+      return _viewWheelHandler(this, e);
+    }
+
+    return false;
+  }
+
+  /**
+   * @brief Event for OnStage signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of OnStageEventHandler) provided by the user.
+   * OnStage signal is emitted after the view has been connected to the stage.
+   */
+  public event DaliEventHandler<object,OnStageEventArgs> OnStageEvent
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_viewOnStageEventHandler == null)
+        {
+          _viewOnStageEventHandler += value;
+
+          _viewOnStageEventCallbackDelegate = new OnStageEventCallbackDelegate(OnStage);
+          this.OnStageSignal().Connect(_viewOnStageEventCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_viewOnStageEventHandler != null)
+        {
+          this.OnStageSignal().Disconnect(_viewOnStageEventCallbackDelegate);
+        }
+
+        _viewOnStageEventHandler -= value;
+      }
+    }
+  }
+
+  // Callback for View OnStage signal
+  private void OnStage(IntPtr data)
+  {
+    OnStageEventArgs e = new OnStageEventArgs();
+
+    // Populate all members of "e" (OnStageEventArgs) with real data
+    e.View = View.GetViewFromPtr(data);
+
+    //Console.WriteLine("############# OnStage()! e.View.Name=" + e.View.Name);
+
+    if (_viewOnStageEventHandler != null)
+    {
+      //here we send all data to user event handlers
+      _viewOnStageEventHandler(this, e);
+    }
+  }
+
+  /**
+   * @brief Event for OffStage signal which can be used to subscribe/unsubscribe the event handler
+   * (in the type of OffStageEventHandler) provided by the user.
+   * OffStage signal is emitted after the view has been disconnected from the stage.
+   */
+  public event DaliEventHandler<object,OffStageEventArgs> OffStageEvent
+  {
+    add
+    {
+      lock(this)
+      {
+        // Restricted to only one listener
+        if (_viewOffStageEventHandler == null)
+        {
+          _viewOffStageEventHandler += value;
+
+          _viewOffStageEventCallbackDelegate = new OffStageEventCallbackDelegate(OffStage);
+          this.OnStageSignal().Connect(_viewOffStageEventCallbackDelegate);
+        }
+      }
+    }
+
+    remove
+    {
+      lock(this)
+      {
+        if (_viewOffStageEventHandler != null)
+        {
+          this.OnStageSignal().Disconnect(_viewOffStageEventCallbackDelegate);
+        }
+
+        _viewOffStageEventHandler -= value;
+      }
+    }
+  }
+
+  // Callback for View OffStage signal
+  private void OffStage(IntPtr data)
+  {
+    OffStageEventArgs e = new OffStageEventArgs();
+
+    // Populate all members of "e" (OffStageEventArgs) with real data
+    e.View = View.GetViewFromPtr(data);
+
+    if (_viewOffStageEventHandler != null)
+    {
+      //here we send all data to user event handlers
+      _viewOffStageEventHandler(this, e);
+    }
+  }
+
+  public static View GetViewFromPtr(global::System.IntPtr cPtr) {
+    View ret = new View(cPtr, false);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public class Property : global::System.IDisposable {
+    private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+    protected bool swigCMemOwn;
+
+    internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
+      swigCMemOwn = cMemoryOwn;
+      swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+    }
+
+    internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
+      return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+    }
+
+    ~Property() {
+      Dispose();
+    }
+
+    public virtual void Dispose() {
+      lock(this) {
+        if (swigCPtr.Handle != global::System.IntPtr.Zero) {
+          if (swigCMemOwn) {
+            swigCMemOwn = false;
+            NDalicPINVOKE.delete_View_Property(swigCPtr);
+          }
+          swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+        }
+        global::System.GC.SuppressFinalize(this);
+      }
+    }
+
+    public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
+    public static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
+    public static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
+    public static readonly int LEFT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
+    public static readonly int RIGHT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
+    public static readonly int UP_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
+    public static readonly int DOWN_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
+
+    public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
+    public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
+    public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
+    public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
+    public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
+
+  }
+
+  public class KeyboardFocus : global::System.IDisposable {
+    private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+    protected bool swigCMemOwn;
+
+    internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
+      swigCMemOwn = cMemoryOwn;
+      swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+    }
+
+    internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
+      return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+    }
+
+    ~KeyboardFocus() {
+      Dispose();
+    }
+
+    public virtual void Dispose() {
+      lock(this) {
+        if (swigCPtr.Handle != global::System.IntPtr.Zero) {
+          if (swigCMemOwn) {
+            swigCMemOwn = false;
+            NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
+          }
+          swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+        }
+        global::System.GC.SuppressFinalize(this);
+      }
+    }
+
+    public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public enum Direction {
+      LEFT,
+      RIGHT,
+      UP,
+      DOWN,
+      PAGE_UP,
+      PAGE_DOWN
+    }
+  }
+
+  public View () : this (NDalicPINVOKE.View_New(), true) {
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+  }
+  public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public View Assign(View handle) {
+    View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  private new static View DownCast(BaseHandle handle) {
+    View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public static T DownCast<T>(Actor actor) where T : View
+  {
+      return (T)( ViewRegistry.GetViewFromActor( actor ) );
+  }
+
+  private View ConvertIdToView(uint id)
+  {
+    Actor actor = null;
+
+    if (Parent)
+    {
+      actor = Parent.FindChildById(id);
+    }
+
+    if (!actor)
+    {
+      actor = Stage.Instance.GetRootLayer().FindChildById(id);
+    }
+
+    return View.DownCast<View>(actor);
+  }
+
+  public void SetKeyInputFocus() {
+    NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public bool HasKeyInputFocus() {
+    bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public void ClearKeyInputFocus() {
+    NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public PinchGestureDetector GetPinchGestureDetector() {
+    PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public PanGestureDetector GetPanGestureDetector() {
+    PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public TapGestureDetector GetTapGestureDetector() {
+    TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public LongPressGestureDetector GetLongPressGestureDetector() {
+    LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public void SetStyleName(string styleName) {
+    NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public string GetStyleName() {
+    string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public void SetBackgroundColor(Vector4 color) {
+    NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public Vector4 GetBackgroundColor() {
+    Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public void SetBackgroundImage(Image image) {
+    NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public void ClearBackground() {
+    NDalicPINVOKE.View_ClearBackground(swigCPtr);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public ControlKeySignal KeyEventSignal() {
+    ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public KeyInputFocusSignal KeyInputFocusGainedSignal() {
+    KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public KeyInputFocusSignal KeyInputFocusLostSignal() {
+    KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
+    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+  }
+
+  public enum PropertyRange {
+    PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
+    CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
+    CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000
+  }
+
+  public string StyleName
+  {
+    get
+    {
+      string temp;
+      GetProperty( View.Property.STYLE_NAME).Get( out temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.STYLE_NAME, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Vector4 BackgroundColor
+  {
+    get
+    {
+      Vector4 backgroundColor = new Vector4(0.0f,0.0f,0.0f,0.0f);
+
+      Dali.Property.Map background = Background;
+      int visualType = 0;
+      background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
+      if(visualType == (int)Dali.Constants.Visual.Type.Color)
+      {
+        background.Find( Dali.Constants.ColorVisualProperty.MixColor ).Get( backgroundColor );
+      }
+
+      return backgroundColor;
+    }
+    set
+    {
+      SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public string BackgroundImage
+  {
+    get
+    {
+      string backgroundImage = "";
+
+      Dali.Property.Map background = Background;
+      int visualType = 0;
+      background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
+      if(visualType == (int)Dali.Constants.Visual.Type.Image)
+      {
+        background.Find( Dali.Constants.ImageVisualProperty.URL ).Get( out backgroundImage );
+      }
+
+      return backgroundImage;
+    }
+    set
+    {
+      SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public bool KeyInputFocus
+  {
+    get
+    {
+      bool temp = false;
+      GetProperty( View.Property.KEY_INPUT_FOCUS).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.KEY_INPUT_FOCUS, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map Background
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( View.Property.BACKGROUND).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public string State
+  {
+    get
+    {
+      string temp;
+      GetProperty( View.Property.STATE).Get( out temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.STATE, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public string SubState
+  {
+    get
+    {
+      string temp;
+      GetProperty( View.Property.SUB_STATE).Get( out temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.SUB_STATE, new Dali.Property.Value( value ) );
+    }
+  }
+
+  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 ) );
+    }
+  }
+
+  public string TooltipText
+  {
+    set
+    {
+      SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
+    }
+  }
+
+  private int LeftFocusableActorId
+  {
+    get
+    {
+      int temp = 0;
+      GetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
+    }
+  }
+
+  private int RightFocusableActorId
+  {
+    get
+    {
+      int temp = 0;
+      GetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
+    }
+  }
+
+  private int UpFocusableActorId
+  {
+    get
+    {
+      int temp = 0;
+      GetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
+    }
+  }
+
+  private int DownFocusableActorId
+  {
+    get
+    {
+      int temp = 0;
+      GetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public float Flex
+  {
+    get
+    {
+      float temp = 0.0f;
+      GetProperty( FlexContainer.ChildProperty.FLEX).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( FlexContainer.ChildProperty.FLEX, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public int AlignSelf
+  {
+    get
+    {
+      int temp = 0;
+      GetProperty( FlexContainer.ChildProperty.ALIGN_SELF).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( FlexContainer.ChildProperty.ALIGN_SELF, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Vector4 FlexMargin
+  {
+    get
+    {
+      Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
+      GetProperty( FlexContainer.ChildProperty.FLEX_MARGIN).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( FlexContainer.ChildProperty.FLEX_MARGIN, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Vector2 CellIndex
+  {
+    get
+    {
+      Vector2 temp = new Vector2(0.0f,0.0f);
+      GetProperty( TableView.ChildProperty.CELL_INDEX).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( TableView.ChildProperty.CELL_INDEX, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public float RowSpan
+  {
+    get
+    {
+      float temp = 0.0f;
+      GetProperty( TableView.ChildProperty.ROW_SPAN).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( TableView.ChildProperty.ROW_SPAN, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public float ColumnSpan
+  {
+    get
+    {
+      float temp = 0.0f;
+      GetProperty( TableView.ChildProperty.COLUMN_SPAN).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( TableView.ChildProperty.COLUMN_SPAN, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public string CellHorizontalAlignment
+  {
+    get
+    {
+      string temp;
+      GetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get( out temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public string CellVerticalAlignment
+  {
+    get
+    {
+      string temp;
+      GetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get( out temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Dali.Property.Value( value ) );
+    }
+  }
+
+  /**
+   * @brief The left focusable view.
+   * @note This will return NULL if not set.
+   * This will also return NULL if the specified left focusable view is not on stage.
+   *
+   */
+  public View LeftFocusableView
+  {
+    // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+    get
+    {
+      if (LeftFocusableActorId >= 0)
+      {
+        return ConvertIdToView((uint)LeftFocusableActorId);
+      }
+      return null;
+    }
+    set
+    {
+      LeftFocusableActorId = (int)value.GetId();
+    }
+  }
+
+  /**
+   * @brief The right focusable view.
+   * @note This will return NULL if not set.
+   * This will also return NULL if the specified right focusable view is not on stage.
+   *
+   */
+  public View RightFocusableView
+  {
+    // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+    get
+    {
+      if (RightFocusableActorId >= 0)
+      {
+        return ConvertIdToView((uint)RightFocusableActorId);
+      }
+      return null;
+    }
+    set
+    {
+      RightFocusableActorId = (int)value.GetId();
+    }
+  }
+
+  /**
+   * @brief The up focusable view.
+   * @note This will return NULL if not set.
+   * This will also return NULL if the specified up focusable view is not on stage.
+   *
+   */
+  public View UpFocusableView
+  {
+    // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+    get
+    {
+      if (UpFocusableActorId >= 0)
+      {
+        return ConvertIdToView((uint)UpFocusableActorId);
+      }
+      return null;
+    }
+    set
+    {
+      UpFocusableActorId = (int)value.GetId();
+    }
+  }
+
+  /**
+   * @brief The down focusable view.
+   * @note This will return NULL if not set.
+   * This will also return NULL if the specified down focusable view is not on stage.
+   *
+   */
+  public View DownFocusableView
+  {
+    // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+    get
+    {
+      if (DownFocusableActorId >= 0)
+      {
+        return ConvertIdToView((uint)DownFocusableActorId);
+      }
+      return null;
+    }
+    set
+    {
+      DownFocusableActorId = (int)value.GetId();
+    }
+  }
+}
+
+}
index c2be678..b055a7d 100644 (file)
@@ -51,14 +51,14 @@ namespace Dali
   ///  in MyControl.h
   ///  class MyControl : public Control
   ///  {
-  ///      struct Property
+  ///    struct Property
+  ///    {
+  ///      enum
   ///      {
-  ///         enum
-  ///        {
-  ///              HOURS =  Control::CONTROL_PROPERTY_END_INDEX + 1
-  ///        }
-  ///     }
-  ///
+  ///        HOURS =  Control::CONTROL_PROPERTY_END_INDEX + 1
+  ///      }
+  ///    }
+  ///  }
   ///
   /// in MyControl-impl.cpp
   ///
@@ -139,9 +139,10 @@ namespace Dali
     private PropertyRangeManager _propertyRangeManager;
 
     /// <summary>
-    /// Given a C++ custom control the dictionary allows us to find what CustomView it belongs to
+    /// Given a C++ control the dictionary allows us to find which C# control (View) it belongs to.
+    /// By keeping the weak reference only, it will allow the object to be garbage collected.
     /// </summary>
-    private Dictionary<IntPtr, Dali.CustomView> _controlMap;
+    private Dictionary<IntPtr, WeakReference> _controlMap;
 
     ///<summary>
     // Maps the name of a custom view to a create instance function
@@ -177,7 +178,7 @@ namespace Dali
       _getPropertyCallback = new GetPropertyDelegate (GetProperty);
       _setPropertyCallback  = new SetPropertyDelegate (SetProperty);
 
-      _controlMap = new Dictionary<IntPtr, CustomView>();
+      _controlMap = new Dictionary<IntPtr, WeakReference>();
       _constructorMap = new Dictionary<string, Func<CustomView>>();
       _propertyRangeManager = new PropertyRangeManager();
 
@@ -199,7 +200,7 @@ namespace Dali
     }
 
     /// <summary>
-    /// Called directly from DALi C++ type registry to create a control (View)  uses no marshalling.
+    /// Called directly from DALi C++ type registry to create a control (View) using no marshalling.
     /// </summary>
     /// <returns>Pointer to the Control (Views) handle </returns>
     /// <param name="cPtrControlName"> C pointer to the Control (View) name</param>
@@ -215,17 +216,7 @@ namespace Dali
       {
         // Create the control
         CustomView newControl = controlConstructor ();
-
-        // Store the mapping between this instance of the custom control and native part
-        // We store a pointer to the RefObject for the control
-        IntPtr cPtr = newControl.GetPtrfromActor();
-        RefObject refObj = newControl.GetObjectPtr ();
-        IntPtr refCptr = (IntPtr) RefObject.getCPtr(refObj);
-
-        //Console.WriteLine ("________Storing ref object cptr in control map Hex: {0:X}", refCptr);
-        Instance._controlMap.Add (refCptr , newControl );
-
-        return cPtr;  // return pointer to handle
+        return newControl.GetPtrfromActor();  // return pointer to handle
       }
       else
       {
@@ -234,6 +225,42 @@ namespace Dali
       }
     }
 
+    /// <summary>
+    /// Store the mapping between this instance of control (View) and native part.
+    /// </summary>
+    /// <param name="view"> The instance of control (View)</param>
+    public static void RegisterView( View view )
+    {
+      // We store a pointer to the RefObject for the control
+      RefObject refObj = view.GetObjectPtr();
+      IntPtr refCptr = (IntPtr) RefObject.getCPtr(refObj);
+
+      //Console.WriteLine ("________Storing ref object cptr in control map Hex: {0:X}", refCptr);
+      if ( !Instance._controlMap.ContainsKey(refCptr) )
+      {
+        Instance._controlMap.Add(refCptr, new WeakReference(view, false));
+      }
+
+      return;
+    }
+
+    /// <summary>
+    /// Remove the this instance of control (View) and native part from the mapping table.
+    /// </summary>
+    /// <param name="view"> The instance of control (View)</param>
+    public static void UnregisterView( View view )
+    {
+      RefObject refObj = view.GetObjectPtr();
+      IntPtr refCptr = (IntPtr) RefObject.getCPtr(refObj);
+
+      if ( Instance._controlMap.ContainsKey(refCptr) )
+      {
+        Instance._controlMap.Remove(refCptr);
+      }
+
+      return;
+    }
+
     private static IntPtr GetProperty( IntPtr controlPtr, IntPtr propertyName )
     {
       string name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi (propertyName);
@@ -260,19 +287,17 @@ namespace Dali
       }
     }
 
-    public static CustomView GetCustomViewFromActor( Actor actor )
+    public static View GetViewFromActor( Actor actor )
     {
       // we store a dictionary of ref-obects (C++ land) to custom views (C# land)
-      Dali.CustomView view;
 
       RefObject refObj = actor.GetObjectPtr ();
       IntPtr refObjectPtr = (IntPtr) RefObject.getCPtr(refObj);
 
-      if ( Instance._controlMap.TryGetValue ( refObjectPtr, out view) )
+      WeakReference viewReference;
+      if ( Instance._controlMap.TryGetValue ( refObjectPtr, out viewReference) )
       {
-
-        // call the get property function
-
+        View view = viewReference.Target as View;
         return view;
       }
       else
@@ -346,16 +371,16 @@ namespace Dali
     private IntPtr GetPropertyValue ( IntPtr controlPtr, string propertyName)
     {
       // Get the C# control that maps to the C++ control
-      Dali.CustomView view;
-
       BaseHandle baseHandle = new BaseHandle (controlPtr, false);
 
       RefObject refObj = baseHandle.GetObjectPtr ();
 
       IntPtr refObjectPtr = (IntPtr) RefObject.getCPtr(refObj);
 
-      if ( _controlMap.TryGetValue ( refObjectPtr, out view) )
+      WeakReference viewReference;
+      if ( _controlMap.TryGetValue ( refObjectPtr, out viewReference) )
       {
+        View view = viewReference.Target as View;
 
         // call the get property function
         System.Object val = view.GetType ().GetProperty (propertyName).GetAccessors () [0].Invoke (view, null);
@@ -377,15 +402,15 @@ namespace Dali
     private void SetPropertyValue ( IntPtr controlPtr, string propertyName, IntPtr propertyValuePtr)
     {
       // Get the C# control that maps to the C++ control
-      Dali.CustomView view;
 
       //Console.WriteLine ("SetPropertyValue   refObjectPtr = {0:X}", controlPtr);
 
       Property.Value propValue = new Property.Value (propertyValuePtr, false);
 
-      if ( _controlMap.TryGetValue ( controlPtr, out view) )
+      WeakReference viewReference;
+      if ( _controlMap.TryGetValue ( controlPtr, out viewReference) )
       {
-
+        View view = viewReference.Target as View;
         System.Reflection.PropertyInfo propertyInfo = view.GetType().GetProperty(propertyName);
 
         // We know the property name, we know it's type, we just need to convert from a DALi property value to native C# type
index 0f42e4e..68fcef1 100644 (file)
@@ -58,8 +58,6 @@ namespace Dali
         public delegate void OnPanDelegate(PanGesture pan);
         public delegate void OnTapDelegate(TapGesture tap);
         public delegate void OnLongPressDelegate(LongPressGesture longPress);
-        public delegate void SignalConnectedDelegate(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback);
-        public delegate void SignalDisconnectedDelegate(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback);
 
         public OnStageConnectionDelegate OnStageConnection;
         public OnStageDisconnectionDelegate OnStageDisconnection;
@@ -99,8 +97,6 @@ namespace Dali
         public OnPanDelegate OnPan;
         public OnTapDelegate OnTap;
         public OnLongPressDelegate OnLongPress;
-        public SignalConnectedDelegate SignalConnected;
-        public SignalDisconnectedDelegate SignalDisconnected;
 
         internal ViewWrapperImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ViewWrapperImpl_SWIGUpcast(cPtr), cMemoryOwn)
         {
@@ -411,7 +407,10 @@ namespace Dali
 
         private void DirectorOnStyleChange(global::System.IntPtr styleManager, int change)
         {
-            OnStyleChange(new StyleManager(styleManager, false), (StyleChangeType)change);
+            if (OnStyleChange != null)
+            {
+                OnStyleChange(new StyleManager(styleManager, false), (StyleChangeType)change);
+            }
         }
 
         private bool DirectorOnAccessibilityActivated()
@@ -484,16 +483,6 @@ namespace Dali
             OnLongPress(new LongPressGesture(longPress, false));
         }
 
-        private void DirectorSignalConnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
-        {
-            SignalConnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback, false));
-        }
-
-        private void DirectorSignalDisconnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
-        {
-            SignalDisconnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback, false));
-        }
-
         public delegate void DelegateViewWrapperImpl_0(int depth);
         public delegate void DelegateViewWrapperImpl_1();
         public delegate void DelegateViewWrapperImpl_2(global::System.IntPtr child);
index f31a49d..f4d6aec 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.
@@ -55,7 +55,7 @@ public class Spin : CustomView
       ViewRegistry.Instance.Register(CreateInstance, typeof(Spin) );
     }
 
-    public Spin() : base(typeof(Spin).Name, ViewWrapperImpl.CustomViewBehaviour.REQUIRES_KEYBOARD_NAVIGATION_SUPPORT | ViewWrapperImpl.CustomViewBehaviour.DISABLE_STYLE_CHANGE_SIGNALS)
+    public Spin() : base(typeof(Spin).Name, ViewWrapperImpl.CustomViewBehaviour.REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)
     {
 
     }