Merge "Prepare for Tizen 4.0 Build" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 20 Feb 2017 15:41:12 +0000 (07:41 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 20 Feb 2017 15:41:13 +0000 (07:41 -0800)
74 files changed:
automated-tests/src/dali-toolkit-styling/theme2.json [new file with mode: 0644]
automated-tests/src/dali-toolkit-styling/theme3.json [new file with mode: 0644]
automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp
automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/devel-api/builder/tree-node.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/builder/dictionary.h [new file with mode: 0644]
dali-toolkit/internal/builder/style.cpp [new file with mode: 0644]
dali-toolkit/internal/builder/style.h [new file with mode: 0644]
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/visuals/border-visual-properties.h
dali-toolkit/public-api/visuals/color-visual-properties.h
dali-toolkit/public-api/visuals/gradient-visual-properties.h
dali-toolkit/public-api/visuals/image-visual-properties.h
dali-toolkit/public-api/visuals/mesh-visual-properties.h
dali-toolkit/public-api/visuals/primitive-visual-properties.h
dali-toolkit/public-api/visuals/visual-properties.h
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/images-common/text_selection_scroll_indicator.9.png [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/font-selection.md
packaging/dali-addon.spec
packaging/dali-toolkit.spec
plugins/dali-swig/SWIG/dali-core.i
plugins/dali-swig/SWIG/dali-gc.i
plugins/dali-swig/SWIG/dali.i
plugins/dali-swig/SWIG/devel-properties.i [changed mode: 0644->0755]
plugins/dali-swig/SWIG/events/actor-event.i
plugins/dali-swig/SWIG/events/padding.i [new file with mode: 0644]
plugins/dali-swig/SWIG/events/rectangle.i [new file with mode: 0644]
plugins/dali-swig/SWIG/events/rectinteger.i [deleted file]
plugins/dali-swig/examples/control-dashboard.cs
plugins/dali-swig/examples/dali-test.cs
plugins/dali-swig/manual/cpp/devel-property-wrap.cpp [changed mode: 0644->0755]
plugins/dali-swig/manual/csharp/DaliEnumConstants.cs
plugins/dali-swig/manual/csharp/ManualPINVOKE.cs
plugins/dali-swig/property-wrapper.rb

diff --git a/automated-tests/src/dali-toolkit-styling/theme2.json b/automated-tests/src/dali-toolkit-styling/theme2.json
new file mode 100644 (file)
index 0000000..8ca44cd
--- /dev/null
@@ -0,0 +1,9 @@
+{
+  "styles":
+  {
+    "testbutton":
+    {
+      "backgroundColor":[1.0,1.0,0.0,1.0]
+    }
+  }
+}
diff --git a/automated-tests/src/dali-toolkit-styling/theme3.json b/automated-tests/src/dali-toolkit-styling/theme3.json
new file mode 100644 (file)
index 0000000..68a292e
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "styles":
+  {
+    "testbutton":
+    {
+      "backgroundColor":[1.0,1.0,0.0,1.0]
+// Deliberate Error: trailing comma
+    },
+  },
+}
index 8d93d9c..6fe0fde 100644 (file)
@@ -1,4 +1,4 @@
-/*
+ /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,6 +25,9 @@
 #include <test-button.h>
 #include <test-animation-data.h>
 #include <toolkit-style-monitor.h>
+#include <dummy-control.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -33,6 +36,10 @@ namespace
 {
 const char* defaultTheme =
 "{\n"
+"  \"constants\":\n"
+"  {\n"
+"    \"CONFIG_SCRIPT_LOG_LEVEL\":\"NoLogging\"\n"
+"  },\n"
 "  \"styles\":\n"
 "  {\n"
 "    \"textlabel\":\n"
@@ -146,6 +153,223 @@ const char* defaultTheme =
 "      \"grabHandleImage\" : \"{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png\",\n"
 "      \"selectionHandleImageLeft\" : {\"filename\":\"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png\" },\n"
 "      \"selectionHandleImageRight\": {\"filename\":\"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png\" }\n"
+"    },\n"
+"    \"ComplexControl\":\n"
+"    {\n"
+"      \"states\":\n"
+"      {\n"
+"        \"NORMAL\":\n"
+"        {\n"
+"          \"states\":\n"
+"          {\n"
+"            \"SELECTED\":\n"
+"            {\n"
+"              \"visuals\":\n"
+"              {\n"
+"                \"foregroundVisual\":\n"
+"                {\n"
+"                  \"visualType\":\"GRADIENT\",\n"
+"                  \"startPosition\": [-1, -1],\n"
+"                  \"endPosition\": [1, 1],\n"
+"                  \"spreadMethod\": \"REPEAT\",\n"
+"                  \"stopOffset\": [0.2, 0.8],\n"
+"                  \"stopColor\": [ [ 1,0,0,1], [0,1,0,1] ]\n"
+"                }\n"
+"              }\n"
+"            },\n"
+"            \"UNSELECTED\":\n"
+"            {\n"
+"              \"visuals\":\n"
+"              {\n"
+"                \"foregroundVisual\":\n"
+"                {\n"
+"                  \"visualType\":\"COLOR\",\n"
+"                  \"mixColor\": [ 1,0,0,1]\n"
+"                }\n"
+"              }\n"
+"            }\n"
+"          },\n"
+"          \"transitions\":\n"
+"          {\n"
+"            \"visualName\":\"*\",\n"
+"            \"effect\":\"CROSSFADE\",\n"
+"            \"animator\":\n"
+"            {\n"
+"              \"alphaFunction\":\"EASE_IN_OUT\",\n"
+"              \"duration\":0.3\n"
+"            }\n"
+"          }\n"
+"        },\n"
+"        \"FOCUSED\":\n"
+"        {\n"
+"          \"visuals\":\n"
+"          {\n"
+"            \"foregroundVisual\":\n"
+"            {\n"
+"              \"visualType\":\"GRADIENT\",\n"
+"              \"startPosition\": [-1, -1],\n"
+"              \"endPosition\": [1, 1],\n"
+"              \"spreadMethod\": \"REPEAT\",\n"
+"              \"stopOffset\": [0.3, 0.9],\n"
+"              \"stopColor\": [ [ 0,0,1,1], [0,1,1,1] ]\n"
+"            },\n"
+"            \"focusVisual\":\n"
+"            {\n"
+"              \"visualType\":\"IMAGE\",\n"
+"              \"url\": \"focus.png\"\n"
+"            }\n"
+"          },\n"
+"          \"entryTransition\":\n"
+"          {\n"
+"            \"target\":\"focusVisual\",\n"
+"            \"property\":\"mixColor\",\n"
+"            \"initialValue\":[0,0,0,0],\n"
+"            \"targetValue\":[1,1,1,1],\n"
+"            \"animator\":\n"
+"            {\n"
+"              \"alphaFunction\":\"EASE_IN_OUT_SINE\",\n"
+"              \"timePeriod\": \n"
+"              {\n"
+"                \"duration\":0.5,\n"
+"                \"delay\":0\n"
+"              }\n"
+"            }\n"
+"          },\n"
+"          \"exitTransition\":\n"
+"          {\n"
+"            \"target\":\"focusVisual\",\n"
+"            \"property\":\"mixColor\",\n"
+"            \"initialValue\":[1,1,1,1],\n"
+"            \"targetValue\":[0,0,0,0],\n"
+"            \"animator\":\n"
+"            {\n"
+"              \"alphaFunction\":\"EASE_IN_OUT_SINE\",\n"
+"              \"timePeriod\": \n"
+"              {\n"
+"                \"duration\":0.5,\n"
+"                \"delay\":0\n"
+"              }\n"
+"            }\n"
+"          }\n"
+"        },\n"
+"        \"DISABLED\":\n"
+"        {\n"
+"          \"visuals\":\n"
+"          {\n"
+"            \"foregroundVisual\":\n"
+"            {\n"
+"              \"visualType\":\"COLOR\",\n"
+"              \"mixColor\": [1,0,0,1]\n"
+"            }\n"
+"          }\n"
+"        }\n"
+"      },\n"
+"      \"transitions\":\n"
+"      [\n"
+"        {\n"
+"          \"effect\":\"CROSSFADE\",\n"
+"          \"animator\":\n"
+"          {\n"
+"            \"alphaFunction\":\"EASE_IN_OUT\",\n"
+"            \"duration\":0.3\n"
+"          }\n"
+"        }\n"
+"      ]\n"
+"    },\n"
+"    \"BasicControl\":\n"
+"    {\n"
+"      \"states\":\n"
+"      {\n"
+"        \"NORMAL\":\n"
+"        {\n"
+"          \"visuals\":\n"
+"          {\n"
+"            \"foregroundVisual\":\n"
+"            {\n"
+"              \"visualType\":\"GRADIENT\",\n"
+"              \"startPosition\": [-1, -1],\n"
+"              \"endPosition\": [1, 1],\n"
+"              \"spreadMethod\": \"REPEAT\",\n"
+"              \"stopOffset\": [0.2, 0.8],\n"
+"              \"stopColor\": [ [ 1,0,0,1], [0,1,0,1] ]\n"
+"            }\n"
+"          }\n"
+"        },\n"
+"        \"FOCUSED\":\n"
+"        {\n"
+"          \"visuals\":\n"
+"          {\n"
+"            \"foregroundVisual\":\n"
+"            {\n"
+"              \"visualType\":\"GRADIENT\",\n"
+"              \"startPosition\": [-1, -1],\n"
+"              \"endPosition\": [1, 1],\n"
+"              \"spreadMethod\": \"REPEAT\",\n"
+"              \"stopOffset\": [0.3, 0.9],\n"
+"              \"stopColor\": [ [ 0,0,1,1], [0,1,1,1] ]\n"
+"            },\n"
+"            \"focusVisual\":\n"
+"            {\n"
+"              \"visualType\":\"IMAGE\",\n"
+"              \"url\": \"focus.png\"\n"
+"            }\n"
+"          },\n"
+"          \"entryTransition\":\n"
+"          {\n"
+"            \"target\":\"focusVisual\",\n"
+"            \"property\":\"mixColor\",\n"
+"            \"initialValue\":[0,0,0,0],\n"
+"            \"targetValue\":[1,1,1,1],\n"
+"            \"animator\":\n"
+"            {\n"
+"              \"alphaFunction\":\"EASE_IN_OUT_SINE\",\n"
+"              \"timePeriod\": \n"
+"              {\n"
+"                \"duration\":0.5,\n"
+"                \"delay\":0\n"
+"              }\n"
+"            }\n"
+"          },\n"
+"          \"exitTransition\":\n"
+"          {\n"
+"            \"target\":\"focusVisual\",\n"
+"            \"property\":\"mixColor\",\n"
+"            \"initialValue\":[1,1,1,1],\n"
+"            \"targetValue\":[0,0,0,0],\n"
+"            \"animator\":\n"
+"            {\n"
+"              \"alphaFunction\":\"EASE_IN_OUT_SINE\",\n"
+"              \"timePeriod\": \n"
+"              {\n"
+"                \"duration\":0.5,\n"
+"                \"delay\":0\n"
+"              }\n"
+"            }\n"
+"          }\n"
+"        },\n"
+"        \"DISABLED\":\n"
+"        {\n"
+"          \"visuals\":\n"
+"          {\n"
+"            \"foregroundVisual\":\n"
+"            {\n"
+"              \"visualType\":\"COLOR\",\n"
+"              \"mixColor\": [1,0,0,1]\n"
+"            }\n"
+"          }\n"
+"        }\n"
+"      },\n"
+"      \"transitions\":\n"
+"      [\n"
+"        {\n"
+"          \"effect\":\"CROSSFADE\",\n"
+"          \"animator\":\n"
+"          {\n"
+"            \"alphaFunction\":\"EASE_IN_OUT\",\n"
+"            \"duration\":0.3\n"
+"          }\n"
+"        }\n"
+"      ]\n"
 "    }\n"
 "  }\n"
 "}\n";
@@ -154,6 +378,7 @@ const char* defaultTheme =
 
 
 
+
 void dali_style_manager_startup(void)
 {
   test_return_value = TET_UNDEF;
@@ -258,6 +483,10 @@ int UtcDaliStyleManagerApplyTheme(void)
 
   const char* json1 =
     "{\n"
+    "  \"constants\":\n"
+    "  {\n"
+    "    \"CONFIG_SCRIPT_LOG_LEVEL\":\"Verbose\"\n"
+    "  },\n"
     "  \"styles\":\n"
     "  {\n"
     "    \"testbutton\":\n"
@@ -362,6 +591,10 @@ int UtcDaliStyleManagerApplyDefaultTheme(void)
 
   const char* defaultTheme =
     "{\n"
+    "  \"constants\":\n"
+    "  {\n"
+    "    \"CONFIG_SCRIPT_LOG_LEVEL\":\"Concise\"\n"
+    "  },\n"
     "  \"styles\":\n"
     "  {\n"
     "    \"testbutton\":\n"
@@ -505,6 +738,10 @@ int UtcDaliStyleManagerApplyStyle(void)
 
   const char* json1 =
     "{\n"
+    "  \"constants\":\n"
+    "  {\n"
+    "    \"CONFIG_SCRIPT_LOG_LEVEL\":\"General\"\n"
+    "  },\n"
     "  \"styles\":\n"
     "  {\n"
     "    \"testbutton\":\n"
@@ -574,6 +811,107 @@ int UtcDaliStyleManagerApplyStyle(void)
 }
 
 
+int UtcDaliStyleManagerIncludeStyleP(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "UtcDaliStyleManagerIncludeStyle - test that style sheet inclusion works" );
+
+  const char* json1 =
+    "{\n"
+    "  \"includes\":\n"
+    "  [\n"
+    "     \"src/dali-toolkit-styling/theme2.json\"\n"
+    "  ],\n"
+    "  \"styles\":\n"
+    "  {\n"
+    "    \"testbutton\":\n"
+    "    {\n"
+    "      \"foregroundColor\":[0.0,0.0,1.0,1.0]\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  // Add 2 buttons
+  Test::TestButton testButton = Test::TestButton::New();
+  Test::TestButton testButton2 = Test::TestButton::New();
+  Stage::GetCurrent().Add( testButton );
+  Stage::GetCurrent().Add( testButton2 );
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  StyleManager styleManager = StyleManager::Get();
+
+  styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged);
+
+  tet_infoline("Apply the style");
+
+  std::string themeFile("ThemeOne");
+  Test::StyleMonitor::SetThemeFileOutput(themeFile, json1);
+
+  styleManager.ApplyTheme(themeFile);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Property::Value themedBgColor( testButton.GetProperty(Test::TestButton::Property::BACKGROUND_COLOR) );
+  Property::Value themedFgColor( testButton.GetProperty(Test::TestButton::Property::FOREGROUND_COLOR) );
+
+  DALI_TEST_EQUALS( themedBgColor, Property::Value(Color::YELLOW), 0.001, TEST_LOCATION );
+  DALI_TEST_EQUALS( themedFgColor, Property::Value(Color::BLUE), 0.001, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerIncludeStyleN(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "UtcDaliStyleManagerIncludeStyle - test that style sheet inclusion works, but included stylesheet is bad json" );
+
+  const char* json1 =
+    "{\n"
+    "  \"includes\":\n"
+    "  [\n"
+    "     \"src/dali-toolkit-styling/theme3.json\"\n"
+    "  ],\n"
+    "  \"styles\":\n"
+    "  {\n"
+    "    \"testbutton\":\n"
+    "    {\n"
+    "      \"foregroundColor\":[0.0,0.0,1.0,1.0]\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  // Add 2 buttons
+  Test::TestButton testButton = Test::TestButton::New();
+  Test::TestButton testButton2 = Test::TestButton::New();
+  Stage::GetCurrent().Add( testButton );
+  Stage::GetCurrent().Add( testButton2 );
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  StyleManager styleManager = StyleManager::Get();
+
+  styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged);
+
+  tet_infoline("Apply the style");
+
+  std::string themeFile("ThemeOne");
+  Test::StyleMonitor::SetThemeFileOutput(themeFile, json1);
+
+  try
+  {
+    styleManager.ApplyTheme(themeFile);
+  }
+  catch( Dali::DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "!\"Cannot parse JSON\"", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+
 int UtcDaliStyleManagerStyleChangedSignalFontFamily(void)
 {
   tet_infoline("Test that the StyleChange signal is fired when the font family is altered" );
@@ -860,3 +1198,85 @@ int UtcDaliStyleManagerStyleChangedSignalFontSizeTextEditor(void)
 
   END_TEST;
 }
+
+
+int UtcDaliStyleManagerVisualTransitionParsing(void)
+{
+  tet_infoline("Instantiate dummy control and test state/visual/transition capture" );
+  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("BasicControl");
+  Stage::GetCurrent().Add(actor);
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+
+  DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
+  Visual::Base visual1 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+
+  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);
+
+  Visual::Base visual2 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+  DALI_TEST_CHECK( visual1 != visual2 );
+
+  actor.SetProperty( DevelControl::Property::STATE, DevelControl::DISABLED );
+
+  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);
+
+  DALI_TEST_CHECK( visual1 != visual3 );
+  DALI_TEST_CHECK( visual2 != visual3 );
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerVisualTransitionParsing02(void)
+{
+  tet_infoline("Instantiate dummy control and test state/visual/transition capture" );
+  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, "FOCUSED");
+
+  actor.SetStyleName("ComplexControl");
+  Stage::GetCurrent().Add(actor);
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+
+  DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
+  Visual::Base visual1 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+  DALI_TEST_CHECK( visual1 );
+  Property::Map map;
+  visual1.CreatePropertyMap( map );
+  Property::Value* value = map.Find( Visual::Property::TYPE );
+  DALI_TEST_CHECK( value );
+
+  int visualType;
+  value->Get( visualType );
+
+  DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::GRADIENT, TEST_LOCATION );
+
+  END_TEST;
+}
index 79d422b..03c788c 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <cstdarg>
+#include <cstdio>
 #include <iostream>
+#include <cstring>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
+#include <test-compare-types.h>
 
 void tet_infoline(const char*str);
 void tet_printf(const char *format, ...);
@@ -73,176 +76,6 @@ else
   throw("TET_FAIL");                                                                      \
 }
 
-template <typename Type>
-inline bool CompareType(Type value1, Type value2, float epsilon);
-
-/**
- * A helper for fuzzy-comparing Vector2 objects
- * @param[in] vector1 the first object
- * @param[in] vector2 the second object
- * @param[in] epsilon difference threshold
- * @returns true if difference is smaller than epsilon threshold, false otherwise
- */
-template <>
-inline bool CompareType<float>(float value1, float value2, float epsilon)
-{
-  return fabsf(value1 - value2) < epsilon;
-}
-
-/**
- * A helper for fuzzy-comparing Vector2 objects
- * @param[in] vector1 the first object
- * @param[in] vector2 the second object
- * @param[in] epsilon difference threshold
- * @returns true if difference is smaller than epsilon threshold, false otherwise
- */
-template <>
-inline bool CompareType<Vector2>(Vector2 vector1, Vector2 vector2, float epsilon)
-{
-  return fabsf(vector1.x - vector2.x)<epsilon && fabsf(vector1.y - vector2.y)<epsilon;
-}
-
-/**
- * A helper for fuzzy-comparing Vector3 objects
- * @param[in] vector1 the first object
- * @param[in] vector2 the second object
- * @param[in] epsilon difference threshold
- * @returns true if difference is smaller than epsilon threshold, false otherwise
- */
-template <>
-inline bool CompareType<Vector3>(Vector3 vector1, Vector3 vector2, float epsilon)
-{
-  return fabsf(vector1.x - vector2.x)<epsilon &&
-         fabsf(vector1.y - vector2.y)<epsilon &&
-         fabsf(vector1.z - vector2.z)<epsilon;
-}
-
-
-/**
- * A helper for fuzzy-comparing Vector4 objects
- * @param[in] vector1 the first object
- * @param[in] vector2 the second object
- * @param[in] epsilon difference threshold
- * @returns true if difference is smaller than epsilon threshold, false otherwise
- */
-template <>
-inline bool CompareType<Vector4>(Vector4 vector1, Vector4 vector2, float epsilon)
-{
-  return fabsf(vector1.x - vector2.x)<epsilon &&
-         fabsf(vector1.y - vector2.y)<epsilon &&
-         fabsf(vector1.z - vector2.z)<epsilon &&
-         fabsf(vector1.w - vector2.w)<epsilon;
-}
-
-template <>
-inline bool CompareType<Quaternion>(Quaternion q1, Quaternion q2, float epsilon)
-{
-  Quaternion q2N = -q2; // These quaternions represent the same rotation
-  return CompareType<Vector4>(q1.mVector, q2.mVector, epsilon) || CompareType<Vector4>(q1.mVector, q2N.mVector, epsilon);
-}
-
-template <>
-inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
-{
-  return CompareType<float>(q1.radian, q2.radian, epsilon);
-}
-
-template <>
-inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
-{
-  return CompareType<float>(q1.degree, q2.degree, epsilon);
-}
-
-template <>
-inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
-{
-  Property::Type type = q1.GetType();
-  if( type != q2.GetType() )
-  {
-    return false;
-  }
-
-  bool result = false;
-  switch(type)
-  {
-    case Property::BOOLEAN:
-    {
-      bool a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result =  a == b;
-      break;
-    }
-    case Property::INTEGER:
-    {
-      int a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result =  a == b;
-      break;
-    }
-    case Property::FLOAT:
-    {
-      float a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result =  CompareType<float>(a, b, epsilon);
-      break;
-    }
-    case Property::VECTOR2:
-    {
-      Vector2 a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result = CompareType<Vector2>(a, b, epsilon);
-      break;
-    }
-    case Property::VECTOR3:
-    {
-      Vector3 a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result = CompareType<Vector3>(a, b, epsilon);
-      break;
-    }
-    case Property::RECTANGLE:
-    case Property::VECTOR4:
-    {
-      Vector4 a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result = CompareType<Vector4>(a, b, epsilon);
-      break;
-    }
-    case Property::ROTATION:
-    {
-      Quaternion a, b;
-      q1.Get(a);
-      q2.Get(b);
-      result = CompareType<Quaternion>(a, b, epsilon);
-      break;
-    }
-    case Property::MATRIX:
-    case Property::MATRIX3:
-    case Property::STRING:
-    case Property::ARRAY:
-    case Property::MAP:
-    {
-      //TODO: Implement this?
-      DALI_ASSERT_ALWAYS( 0 && "Not implemented");
-      result = false;
-      break;
-    }
-    case Property::NONE:
-    {
-      result = false;
-      break;
-    }
-  }
-
-  return result;
-}
-
 
 bool operator==(TimePeriod a, TimePeriod b);
 std::ostream& operator<<( std::ostream& ostream, TimePeriod value );
@@ -258,7 +91,7 @@ std::ostream& operator<<( std::ostream& ostream, Degree angle );
 template<typename Type>
 inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location)
 {
-  if (!(value1 == value2))
+  if( !CompareType<Type>(value1, value2, 0.01f) )
   {
     std::ostringstream o;
     o << value1 << " == " << value2 << std::endl;
@@ -514,6 +347,7 @@ struct DefaultFunctionCoverage
 BufferImage CreateBufferImage();
 BufferImage CreateBufferImage(int width, int height, const Vector4& color);
 
+
 // Prepare a resource image to be loaded. Should be called before creating the ResourceImage
 void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat );
 
index f6fb4bf..979e56a 100644 (file)
@@ -74,6 +74,12 @@ Dali::PropertyRegistration dummyControlVisualProperty01(
 Dali::PropertyRegistration dummyControlVisualProperty02(
   typeRegistration, "testVisual", 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 );
+
+Dali::PropertyRegistration dummyControlVisualProperty04(
+  typeRegistration, "focusVisual", Dali::Toolkit::DummyControl::Property::FOCUS_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
+
 }
 
 DummyControl DummyControlImpl::New()
@@ -144,6 +150,26 @@ Animation DummyControlImpl::CreateTransition( const Toolkit::TransitionData& tra
 
 void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value )
 {
+  Toolkit::DummyControl control = Toolkit::DummyControl::DownCast( Dali::BaseHandle( object ) );
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(control.GetImplementation());
+
+  switch(index)
+  {
+    case Toolkit::DummyControl::Property::TEST_VISUAL:
+    case Toolkit::DummyControl::Property::TEST_VISUAL2:
+    case Toolkit::DummyControl::Property::FOREGROUND_VISUAL:
+    case Toolkit::DummyControl::Property::FOCUS_VISUAL:
+    {
+      Property::Map* map = value.GetMap();
+      if( map != NULL )
+      {
+        VisualFactory visualFactory = VisualFactory::Get();
+        Visual::Base visual = visualFactory.CreateVisual(*map);
+        dummyImpl.RegisterVisual(index, visual);
+      }
+      break;
+    }
+  }
 }
 
 Property::Value DummyControlImpl::GetProperty( BaseObject* object, Dali::Property::Index propertyIndex )
index f27f296..75d3efe 100644 (file)
@@ -46,7 +46,9 @@ public:
     enum Type
     {
       TEST_VISUAL = PROPERTY_START_INDEX,
-      TEST_VISUAL2
+      TEST_VISUAL2,
+      FOREGROUND_VISUAL,
+      FOCUS_VISUAL
     };
   };
 
@@ -89,7 +91,7 @@ public:
   void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual, bool enabled );
   void UnregisterVisual( Property::Index index );
   void EnableVisual( Property::Index index, bool enabled );
-  bool IsVisualEnabled( Property::Index indepx );
+  bool IsVisualEnabled( Property::Index index );
 
   Toolkit::Visual::Base GetVisual( Property::Index index );
   Animation CreateTransition( const Toolkit::TransitionData& transition );
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h
new file mode 100644 (file)
index 0000000..248276e
--- /dev/null
@@ -0,0 +1,199 @@
+#ifndef DALI_TEST_COMPARE_TYPES_H
+#define DALI_TEST_COMPARE_TYPES_H
+
+/*
+ * 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.
+ */
+
+#include <dali/public-api/dali-core.h>
+using namespace Dali;
+
+
+template <typename Type>
+inline bool CompareType(Type value1, Type value2, float epsilon)
+{
+  return value1 == value2;
+}
+
+/**
+ * A helper for fuzzy-comparing Vector2 objects
+ * @param[in] vector1 the first object
+ * @param[in] vector2 the second object
+ * @param[in] epsilon difference threshold
+ * @returns true if difference is smaller than epsilon threshold, false otherwise
+ */
+template <>
+inline bool CompareType<float>(float value1, float value2, float epsilon)
+{
+  return fabsf(value1 - value2) < epsilon;
+}
+
+/**
+ * A helper for fuzzy-comparing Vector2 objects
+ * @param[in] vector1 the first object
+ * @param[in] vector2 the second object
+ * @param[in] epsilon difference threshold
+ * @returns true if difference is smaller than epsilon threshold, false otherwise
+ */
+template <>
+inline bool CompareType<Vector2>(Vector2 vector1, Vector2 vector2, float epsilon)
+{
+  return fabsf(vector1.x - vector2.x)<epsilon && fabsf(vector1.y - vector2.y)<epsilon;
+}
+
+/**
+ * A helper for fuzzy-comparing Vector3 objects
+ * @param[in] vector1 the first object
+ * @param[in] vector2 the second object
+ * @param[in] epsilon difference threshold
+ * @returns true if difference is smaller than epsilon threshold, false otherwise
+ */
+template <>
+inline bool CompareType<Vector3>(Vector3 vector1, Vector3 vector2, float epsilon)
+{
+  return fabsf(vector1.x - vector2.x)<epsilon &&
+         fabsf(vector1.y - vector2.y)<epsilon &&
+         fabsf(vector1.z - vector2.z)<epsilon;
+}
+
+
+/**
+ * A helper for fuzzy-comparing Vector4 objects
+ * @param[in] vector1 the first object
+ * @param[in] vector2 the second object
+ * @param[in] epsilon difference threshold
+ * @returns true if difference is smaller than epsilon threshold, false otherwise
+ */
+template <>
+inline bool CompareType<Vector4>(Vector4 vector1, Vector4 vector2, float epsilon)
+{
+  return fabsf(vector1.x - vector2.x)<epsilon &&
+         fabsf(vector1.y - vector2.y)<epsilon &&
+         fabsf(vector1.z - vector2.z)<epsilon &&
+         fabsf(vector1.w - vector2.w)<epsilon;
+}
+
+template <>
+inline bool CompareType<Quaternion>(Quaternion q1, Quaternion q2, float epsilon)
+{
+  Quaternion q2N = -q2; // These quaternions represent the same rotation
+  return CompareType<Vector4>(q1.mVector, q2.mVector, epsilon) || CompareType<Vector4>(q1.mVector, q2N.mVector, epsilon);
+}
+
+template <>
+inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
+{
+  return CompareType<float>(q1.radian, q2.radian, epsilon);
+}
+
+template <>
+inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
+{
+  return CompareType<float>(q1.degree, q2.degree, epsilon);
+}
+
+template <>
+inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
+{
+  Property::Type type = q1.GetType();
+  if( type != q2.GetType() )
+  {
+    return false;
+  }
+
+  bool result = false;
+  switch(type)
+  {
+    case Property::BOOLEAN:
+    {
+      bool a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result =  a == b;
+      break;
+    }
+    case Property::INTEGER:
+    {
+      int a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result =  a == b;
+      break;
+    }
+    case Property::FLOAT:
+    {
+      float a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result =  CompareType<float>(a, b, epsilon);
+      break;
+    }
+    case Property::VECTOR2:
+    {
+      Vector2 a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result = CompareType<Vector2>(a, b, epsilon);
+      break;
+    }
+    case Property::VECTOR3:
+    {
+      Vector3 a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result = CompareType<Vector3>(a, b, epsilon);
+      break;
+    }
+    case Property::RECTANGLE:
+    case Property::VECTOR4:
+    {
+      Vector4 a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result = CompareType<Vector4>(a, b, epsilon);
+      break;
+    }
+    case Property::ROTATION:
+    {
+      Quaternion a, b;
+      q1.Get(a);
+      q2.Get(b);
+      result = CompareType<Quaternion>(a, b, epsilon);
+      break;
+    }
+    case Property::MATRIX:
+    case Property::MATRIX3:
+    case Property::STRING:
+    case Property::ARRAY:
+    case Property::MAP:
+    {
+      //TODO: Implement this?
+      DALI_ASSERT_ALWAYS( 0 && "Not implemented");
+      result = false;
+      break;
+    }
+    case Property::NONE:
+    {
+      result = false;
+      break;
+    }
+  }
+
+  return result;
+}
+
+
+
+#endif
index 9bed832..1613bb5 100644 (file)
 #include <map>
 #include <cstdio>
 #include <cstring> // for strcmp
+#include <typeinfo>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/gl-defines.h>
-#include "test-trace-call-stack.h"
+#include <test-trace-call-stack.h>
+#include <test-compare-types.h>
 
 namespace Dali
 {
@@ -2132,7 +2134,7 @@ private:
       T uniformValue;
       if ( GetUniformValue( program, uniform, uniformValue ) )
       {
-        return value == uniformValue;
+        return CompareType<T>(value, uniformValue, Math::MACHINE_EPSILON_10);
       }
 
       return false;
@@ -2176,6 +2178,9 @@ private:
   ProgramUniformValue<Matrix> mProgramUniformsMat4;
   ProgramUniformValue<Matrix3> mProgramUniformsMat3;
 
+
+
+
   inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
   {
     return mProgramUniforms1i;
index cb84952..60f4a1b 100644 (file)
@@ -276,7 +276,7 @@ int UtcDaliBuilderAnimationP(void)
         "    \"name\": \"greeting\","
         "    \"type\": \"TextLabel\","
         "    \"text\": \"Touch me\","
-        "    \"styles\": [\"basicText\"],"
+        "    \"inherit\": [\"basicText\"],"
         "    \"position\": [0, -120, 0],"
         "    \"size\": [200, 200, 1],"
         "    \"orientation\": [0, 0, 30],"
@@ -400,7 +400,7 @@ int UtcDaliBuilderAnimationN(void)
         "    \"name\": \"greeting\","
         "    \"type\": \"TextLabel\","
         "    \"text\": \"Touch me\","
-        "    \"styles\": [\"basicText\"],"
+        "    \"inherit\": [\"basicText\"],"
         "    \"position\": [0, -120, 0],"
         "    \"size\": [200, 200, 1],"
         "    \"orientation\": [0, 0, 30],"
index c67b2ae..1606d71 100644 (file)
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
-
+#include <test-application.h>
 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
index 7d40e9e..a480204 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/key-event-integ.h>
-
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -899,3 +899,214 @@ int UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents(void)
 }
 
 
+
+
+
+int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline(" UtcDaliKeyboardFocusManagerMoveFocusTestStateChange");
+
+  // Register Type
+  TypeInfo type;
+  type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
+  DALI_TEST_CHECK( type );
+  BaseHandle handle = type.CreateInstance();
+  DALI_TEST_CHECK( handle );
+
+  KeyboardFocusManager manager = KeyboardFocusManager::Get();
+  DALI_TEST_CHECK(manager);
+
+  bool preFocusChangeSignalVerified = false;
+  PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
+  manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+
+  bool focusChangedSignalVerified = false;
+  FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
+  manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+
+  // Create the first actor and add it to the stage
+  Control first = Control::New();
+  first.SetKeyboardFocusable(true);
+  Stage::GetCurrent().Add(first);
+
+  // Create the second actor and add it to the stage
+  Control second = Control::New();
+  second.SetKeyboardFocusable(true);
+  Stage::GetCurrent().Add(second);
+
+  // Move the focus to the right
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
+
+  // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
+  DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
+  DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
+  DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
+  DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
+  preFocusChangeCallback.Reset();
+
+  // Check that the focus is set on the first actor
+  DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+  focusChangedCallback.Reset();
+
+  // Move the focus towards right
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
+
+  // Because no layout control in the stage and the first actor is focused, it should emit the PreFocusChange signal
+  DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
+  DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
+  DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
+  DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
+  preFocusChangeCallback.Reset();
+
+  // Check that the focus is set on the second actor
+  DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+  focusChangedCallback.Reset();
+
+  // Move the focus towards up
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == false);
+
+  // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
+  DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
+  DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == second);
+  DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
+  DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::UP);
+  preFocusChangeCallback.Reset();
+  DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
+
+  // Create a 2x2 table view and try to move focus inside it
+  TableView tableView = TableView::New( 2, 2 );
+  Stage::GetCurrent().Add(tableView);
+
+  // Create the third actor
+  Control third = Control::New();
+  third.SetKeyboardFocusable(true);
+
+  // Create the fourth actor
+  Control fourth = Control::New();
+  fourth.SetKeyboardFocusable(true);
+
+  // Add the four children to table view
+  tableView.AddChild(first, TableView::CellPosition(0, 0));
+  tableView.AddChild(second, TableView::CellPosition(0, 1));
+  tableView.AddChild(third, TableView::CellPosition(1, 0));
+  tableView.AddChild(fourth, TableView::CellPosition(1, 1));
+
+  // Set the focus to the first actor
+  DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
+
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+
+  focusChangedCallback.Reset();
+
+  // Move the focus towards right
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+
+  focusChangedCallback.Reset();
+
+  // Move the focus towards down
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::DOWN) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
+
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(third.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(fourth.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+
+  focusChangedCallback.Reset();
+
+  // Move the focus towards left
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
+
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(third.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+  DALI_TEST_EQUALS(fourth.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+
+  focusChangedCallback.Reset();
+
+  // Move the focus towards up
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(third.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(fourth.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  focusChangedCallback.Reset();
+
+  // Move the focus towards left. The focus move will fail as no way to move it upwards
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == false);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
+  DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
+  DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
+  DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
+  DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::LEFT);
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(third.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(fourth.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+
+  preFocusChangeCallback.Reset();
+  DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
+
+  // Enable the loop
+  manager.SetFocusGroupLoop(true);
+  DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
+
+  // Move the focus towards left again. The focus should move to the fourth actor.
+  DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
+  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
+  DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
+  DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
+  DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
+
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(third.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(fourth.GetProperty<std::string>(DevelControl::Property::STATE), "FOCUSED", TEST_LOCATION );
+
+  focusChangedCallback.Reset();
+
+  // Clear the focus
+  manager.ClearFocus();
+  DALI_TEST_EQUALS(first.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(second.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(third.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+  DALI_TEST_EQUALS(fourth.GetProperty<std::string>(DevelControl::Property::STATE), "NORMAL", TEST_LOCATION );
+
+
+  END_TEST;
+}
index 6bd2c05..cd38bc3 100644 (file)
@@ -916,11 +916,11 @@ int UtcDaliPopupPropertyContextualMode(void)
   // Test all contextual modes.
   const char* mode[5] = { "NON_CONTEXTUAL", "ABOVE", "RIGHT", "BELOW", "LEFT" };
   Vector2 offsetValues[5];
-  offsetValues[0] = Vector2( 0.0f, 0.0f );
-  offsetValues[1] = Vector2( 0.0f, -10.0f );
-  offsetValues[2] = Vector2( 10.0f, 0.0f );
-  offsetValues[3] = Vector2( 0.0f, 10.0f );
-  offsetValues[4] = Vector2( -10.0f, 0.0f );
+  offsetValues[0] = Vector2( 0.375f, 0.0f );
+  offsetValues[1] = Vector2( -0.125f, -10.5f );
+  offsetValues[2] = Vector2( 10.875f, -0.5f );
+  offsetValues[3] = Vector2( -0.125f, 10.5f );
+  offsetValues[4] = Vector2( -10.875f, -0.5f );
 
   for( int i = 0; i < 5; ++i )
   {
index 2cee1b5..b1d76da 100644 (file)
@@ -111,7 +111,6 @@ int UtcDaliToolkitTextSelectionPopupDownCastP(void)
 
 int UtcDaliToolkitTextSelectionToolBarP(void)
 {
-
   // Creates Toolbar, adds 2 options and a divider then resizes divider
   ToolkitTestApplication application;
 
@@ -140,3 +139,27 @@ int UtcDaliToolkitTextSelectionToolBarP(void)
   DALI_TEST_CHECK( toolbar );
   END_TEST;
 }
+
+int UtcDaliToolkitTextSelectionToolBarScrollBarP(void)
+{
+  // Creates Toolbar, adds 2 options and a divider then resizes divider
+  ToolkitTestApplication application;
+
+  TextSelectionToolbar toolbar = TextSelectionToolbar::New();
+
+  toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
+
+  Toolkit::PushButton option = Toolkit::PushButton::New();
+  option.SetName( "test-option" );
+  option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  toolbar.AddOption( option );
+
+  // Add a scroll-bar
+  toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::ENABLE_SCROLL_BAR, true );
+
+  bool enabled = toolbar.GetProperty<bool>( Toolkit::TextSelectionToolbar::Property::ENABLE_SCROLL_BAR );
+  DALI_TEST_CHECK( enabled );
+
+  DALI_TEST_CHECK( toolbar );
+  END_TEST;
+}
index 5ca2b17..de4c4dd 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include "dummy-control.h"
 
 using namespace Dali;
@@ -254,10 +255,12 @@ int UtcDaliTransitionDataMap1P(void)
 
   Renderer renderer = actor.GetRendererAt(0);
   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
   application.SendNotification();
   application.Render(0);
 
-  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>(mixColorIndex), Color::MAGENTA, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
 
   anim.Play();
 
@@ -265,15 +268,19 @@ int UtcDaliTransitionDataMap1P(void)
   application.Render(500); // Start animation
   application.Render(500); // Halfway thru anim
   application.SendNotification();
-  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>(mixColorIndex), (Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
 
   application.Render(500); // End of anim
   application.SendNotification();
-  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>(mixColorIndex), Color::RED, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
 
   END_TEST;
 }
 
+
+
 int UtcDaliTransitionDataMap2P(void)
 {
   TestApplication application;
@@ -282,7 +289,6 @@ int UtcDaliTransitionDataMap2P(void)
 
   Property::Map map;
   map["target"] = "visual1";
-  //Control::CONTROL_PROPERTY_END_INDEX + 1
   map["property"] = ColorVisual::Property::MIX_COLOR;
   map["initialValue"] = Color::MAGENTA;
   map["targetValue"] = Color::RED;
@@ -316,10 +322,83 @@ int UtcDaliTransitionDataMap2P(void)
 
   Renderer renderer = actor.GetRendererAt(0);
   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
+  application.SendNotification();
+  application.Render(0);
+
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
+
+  anim.Play();
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render(500); // Start animation
+  application.Render(500); // Halfway thru anim
+  application.SendNotification();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
+
+  application.Render(500); // End of anim
+  application.SendNotification();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+
+int UtcDaliTransitionDataMap2Pb(void)
+{
+  TestApplication application;
+
+  tet_printf("Testing animation of a visual property using programmatic maps\n");
+
+  Property::Map map;
+  map["target"] = "visual1";
+  map["property"] = PrimitiveVisual::Property::MIX_COLOR;
+  map["initialValue"] = Color::MAGENTA;
+  map["targetValue"] = Color::RED;
+  map["animator"] = Property::Map()
+    .Add("alphaFunction", "LINEAR")
+    .Add("timePeriod", Property::Map()
+         .Add("delay", 0.5f)
+         .Add("duration", 1.0f));
+
+  Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+  DummyControl actor = DummyControl::New();
+  actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+  actor.SetName("Actor1");
+  actor.SetColor(Color::CYAN);
+  Stage::GetCurrent().Add(actor);
+
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+
+  Property::Map visualMap;
+  visualMap[Visual::Property::TYPE] = Visual::PRIMITIVE;
+  visualMap[PrimitiveVisual::Property::MIX_COLOR] = Color::MAGENTA;
+  visualMap[ PrimitiveVisual::Property::SHAPE  ] = PrimitiveVisual::Shape::SPHERE;
+  visualMap[ PrimitiveVisual::Property::SLICES ] = 10;
+  visualMap[ PrimitiveVisual::Property::STACKS ] = 10;
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
+  visual.SetName( "visual1" );
+
+  Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
+  dummyImpl.RegisterVisual( visualIndex, visual );
+
+  Animation anim = dummyImpl.CreateTransition( transition );
+  DALI_TEST_CHECK( anim );
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
+  Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
   application.SendNotification();
   application.Render(0);
 
-  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>(mixColorIndex), Color::MAGENTA, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
 
   anim.Play();
 
@@ -328,15 +407,18 @@ int UtcDaliTransitionDataMap2P(void)
   application.Render(500); // Start animation
   application.Render(500); // Halfway thru anim
   application.SendNotification();
-  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>(mixColorIndex), (Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
 
   application.Render(500); // End of anim
   application.SendNotification();
-  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>(mixColorIndex), Color::RED, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
 
   END_TEST;
 }
 
+
 int UtcDaliTransitionDataMap3P(void)
 {
   TestApplication application;
@@ -464,6 +546,146 @@ int UtcDaliTransitionDataMap4P(void)
   END_TEST;
 }
 
+int UtcDaliTransitionDataMap5P(void)
+{
+  TestApplication application;
+
+  tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
+
+  Property::Map map;
+  map["target"] = "visual1";
+  map["property"] = "opacity";
+  map["initialValue"] = 0.0f;
+  map["targetValue"] = 1.0f;
+  map["animator"] = Property::Map()
+    .Add("alphaFunction", "EASE_IN_OUT")
+    .Add("timePeriod", Property::Map()
+         .Add("delay", 0.5f)
+         .Add("duration", 1.0f));
+
+  Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+  DummyControl actor = DummyControl::New();
+  actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+  actor.SetName("Actor1");
+  actor.SetColor(Color::CYAN);
+  Stage::GetCurrent().Add(actor);
+
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+
+  Property::Map visualMap;
+  visualMap[Visual::Property::TYPE] = Visual::COLOR;
+  visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
+  Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
+  visual.SetName( "visual1" );
+
+  Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
+  dummyImpl.RegisterVisual( visualIndex, visual );
+
+  Animation anim = dummyImpl.CreateTransition( transition );
+  DALI_TEST_CHECK( anim );
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
+  application.SendNotification();
+  application.Render(0);
+
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.0f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
+
+  anim.Play();
+
+  application.SendNotification();
+  application.Render(500); // Start animation
+  application.Render(500); // Halfway thru anim
+  application.SendNotification();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.5f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
+
+  application.Render(501); // End of anim
+  application.SendNotification();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::AUTO, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliTransitionDataMap6P(void)
+{
+  TestApplication application;
+
+  tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
+
+  Property::Map map;
+  map["target"] = "visual1";
+  map["property"] = "opacity";
+  map["targetValue"] = 0.0f;
+  map["animator"] = Property::Map()
+    .Add("alphaFunction", "EASE_IN_OUT")
+    .Add("timePeriod", Property::Map()
+         .Add("delay", 0.5f)
+         .Add("duration", 1.0f));
+
+  Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+  DummyControl actor = DummyControl::New();
+  actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+  actor.SetName("Actor1");
+  actor.SetColor(Color::CYAN);
+  Stage::GetCurrent().Add(actor);
+
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+
+  Property::Map visualMap;
+  visualMap[Visual::Property::TYPE] = Visual::COLOR;
+  visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
+  Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
+  visual.SetName( "visual1" );
+
+  Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
+  dummyImpl.RegisterVisual( visualIndex, visual );
+
+  Animation anim = dummyImpl.CreateTransition( transition );
+  DALI_TEST_CHECK( anim );
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
+  application.SendNotification();
+  application.Render(0);
+
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
+
+  // Note, This should be testing for AUTO
+  // this is the same problem as C# target value being set before Play is called.
+  // @todo How was this solved?
+  DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
+
+  anim.Play();
+
+  application.SendNotification();
+  application.Render(500); // Start animation
+  application.Render(500); // Halfway thru anim
+  application.SendNotification();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.5f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
+
+  application.Render(500); // End of anim
+  application.SendNotification();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.0f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
+
+  END_TEST;
+}
+
 
 int UtcDaliTransitionDataMap1N(void)
 {
@@ -506,8 +728,8 @@ int UtcDaliTransitionDataMapN3(void)
   Property::Map map;
   map["target"] = "visual1";
   map["property"] = "mixColor";
-  map["initialValue"] = Color::MAGENTA;
-  map["targetValue"] = Color::RED;
+  map["initialValue"] = Vector3(Color::MAGENTA);
+  map["targetValue"] = Vector3(Color::RED);
   map["animator"] = Property::Map()
     .Add("alphaFunction", "EASE_OUT_BACK")
     .Add("timePeriod", Property::Map()
@@ -526,7 +748,7 @@ int UtcDaliTransitionDataMapN3(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   Property::Map visualMap;
   visualMap[Visual::Property::TYPE] = Visual::COLOR;
-  visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
+  visualMap[ColorVisual::Property::MIX_COLOR] = Vector3(Color::MAGENTA);
   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
   visual.SetName( "visual1" );
 
@@ -548,8 +770,8 @@ int UtcDaliTransitionDataMapN4(void)
   Property::Map map;
   map["target"] = "visual1";
   map["property"] = "mixColor";
-  map["initialValue"] = Color::MAGENTA;
-  map["targetValue"] = Color::RED;
+  map["initialValue"] = Vector3(Color::MAGENTA);
+  map["targetValue"] = Vector3(Color::RED);
   map["animator"] = Property::Map()
     .Add("alphaFunction", Vector3(.1f,1.0f,0.5f))
     .Add("timePeriod", Property::Map()
@@ -583,9 +805,11 @@ int UtcDaliTransitionDataMapN4(void)
 
   Renderer renderer = actor.GetRendererAt(0);
   Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
 
   tet_printf( "Test that the property has been set to target value\n");
-  DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderer.GetProperty<float>(opacityIdx), 1.0f, 0.001, TEST_LOCATION);
 
   END_TEST;
 }
@@ -636,7 +860,7 @@ int UtcDaliTransitionDataMapN5(void)
   Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
   tet_printf( "Test that the property has been set to target value\n");
-  DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
 
   END_TEST;
 }
@@ -685,9 +909,11 @@ int UtcDaliTransitionDataMapN6(void)
 
   Renderer renderer = actor.GetRendererAt(0);
   Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
 
   tet_printf( "Test that the property has been set to target value\n");
-  DALI_TEST_EQUALS(renderer.GetProperty<Vector4>(mixColorIdx), Color::RED, 0.001, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderer.GetProperty<float>(opacityIdx), 1.0f, 0.001, TEST_LOCATION);
 
   END_TEST;
 }
@@ -852,7 +1078,8 @@ int UtcDaliTransitionDataGetAnimatorP(void)
 
   Property::Map map8;
   map8["target"] = "Visual1";
-  map8["property"] = "colorAlpha";
+  map8["property"] = "opacity";
+  map8["initialValue"] = 0.0f;
   map8["targetValue"] = 1.0f;
   map8["animator"] = Property::Map()
     .Add("alphaFunction", "EASE_IN")
index f399d4d..fc94130 100644 (file)
@@ -119,9 +119,21 @@ static void TestMixColor( Visual::Base visual, Property::Index mixColorIndex, co
   visual.CreatePropertyMap(map);
   Property::Value* value = map.Find( mixColorIndex );
   DALI_TEST_CHECK( value );
-  Vector4 mixColor;
-  DALI_TEST_CHECK( value->Get( mixColor ) );
-  DALI_TEST_EQUALS( mixColor, testColor, 0.001, TEST_LOCATION );
+  Vector3 mixColor1;
+  DALI_TEST_CHECK( value->Get( mixColor1 ) );
+  DALI_TEST_EQUALS( mixColor1, Vector3(testColor), 0.001, TEST_LOCATION );
+
+  value = map.Find( DevelVisual::Property::MIX_COLOR );
+  DALI_TEST_CHECK( value );
+  Vector4 mixColor2;
+  DALI_TEST_CHECK( value->Get( mixColor2 ) );
+  DALI_TEST_EQUALS( mixColor2, testColor, 0.001, TEST_LOCATION );
+
+  value = map.Find( DevelVisual::Property::OPACITY );
+  DALI_TEST_CHECK( value );
+  float opacity;
+  DALI_TEST_CHECK( value->Get( opacity ) );
+  DALI_TEST_EQUALS( opacity, testColor.a, 0.001, TEST_LOCATION );
 }
 
 
@@ -1119,12 +1131,13 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", testColor ), true, TEST_LOCATION );
 
-  color = renderer.GetProperty<Vector4>( mixColorIndex );
+  color = renderer.GetProperty<Vector3>( mixColorIndex );
   testColor = Vector4( 1,1,1,0.4f );
-  DALI_TEST_EQUALS( color, testColor, 0.0001f, TEST_LOCATION );
-  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", testColor ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( Vector3(color), Vector3(testColor), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor) ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", testColor.a ) , true, TEST_LOCATION );
 
-  application.Render(2000u); // halfway point between blue and white
+  application.Render(2000u);
 
   color = renderer.GetProperty<Vector4>( borderColorIndex );
   DALI_TEST_EQUALS( color, Color::WHITE, TEST_LOCATION );
@@ -1133,7 +1146,8 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   color = renderer.GetProperty<Vector4>( mixColorIndex );
   testColor = Vector4(1,1,1,0);
   DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
-  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", testColor ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor) ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", testColor.a ), true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1205,31 +1219,31 @@ int UtcDaliVisualAnimateColorVisual(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
   Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
 
   Animation animation = Animation::New(4.0f);
-  animation.AnimateTo( Property(renderer, index), Color::WHITE );
+  animation.AnimateTo( Property(renderer, mixColorIndex), Vector3(Color::WHITE) );
   animation.Play();
 
   application.SendNotification();
   application.Render(0);
   application.Render(2000u); // halfway point
 
-  Vector4 color = renderer.GetProperty<Vector4>( index );
-  Vector4 testColor = (Color::BLUE + Color::WHITE)*0.5f;
+  Vector3 color = renderer.GetProperty<Vector3>( mixColorIndex );
+  Vector3 testColor = Vector3(Color::BLUE + Color::WHITE)*0.5f;
   DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
 
-  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", testColor ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", testColor ), true, TEST_LOCATION );
 
   application.Render(2000u); // halfway point between blue and white
 
-  color = renderer.GetProperty<Vector4>( index );
-  DALI_TEST_EQUALS( color, Color::WHITE, TEST_LOCATION );
+  color = renderer.GetProperty<Vector3>( mixColorIndex );
+  DALI_TEST_EQUALS( color, Vector3(Color::WHITE), TEST_LOCATION );
 
-  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", Color::WHITE ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(Color::WHITE) ), true, TEST_LOCATION );
 
   blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
@@ -1297,14 +1311,16 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
 
     Vector4 halfwayColor = (INITIAL_MIX_COLOR + TARGET_MIX_COLOR)*0.5;
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", halfwayColor ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(halfwayColor) ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", halfwayColor.a ), true, TEST_LOCATION );
 
     application.Render(2001u); // go past end
     application.SendNotification(); // Trigger signals
 
     DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", TARGET_MIX_COLOR ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR) ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", TARGET_MIX_COLOR.a ), true, TEST_LOCATION );
 
     blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
     DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
@@ -1375,15 +1391,18 @@ int UtcDaliVisualAnimateImageVisualMixColor(void)
   application.SendNotification();
   application.Render(0);
   application.Render(2000u); // halfway point
+  Vector4 testColor(1.0f, 0.0f, 0.5f, 0.75f );
 
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
-  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", Vector4(1.0f, 0.0f, 0.5f, 0.75f )), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor)), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", testColor.a), true, TEST_LOCATION );
 
   application.Render(2000u); // halfway point between blue and white
 
   DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
-  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", TARGET_MIX_COLOR), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR)), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", TARGET_MIX_COLOR.a), true, TEST_LOCATION );
 
   TestMixColor( visual, DevelVisual::Property::MIX_COLOR, TARGET_MIX_COLOR );
 
@@ -1393,6 +1412,116 @@ int UtcDaliVisualAnimateImageVisualMixColor(void)
   END_TEST;
 }
 
+
+int UtcDaliVisualAnimateImageVisualOpacity(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimateImageVisual mix color" );
+
+  application.GetPlatform().SetClosestImageSize( Vector2(100, 100) );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::IMAGE);
+  propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+  propertyMap.Insert("opacity", 0.5f);
+  propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  actor.SetSize(2000, 2000);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetColor(Color::BLACK);
+  Stage::GetCurrent().Add(actor);
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0);
+  tet_infoline("Test that the renderer has the opacity property");
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+
+
+  Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+  DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
+
+  {
+    tet_infoline( "Test that the opacity can be increased to full via animation, and that the blend mode is set appropriately at the start and end of the animation." );
+
+    Property::Map map;
+    map["target"] = "testVisual";
+    map["property"] = "opacity";
+    map["targetValue"] = 1.0f;
+    map["animator"] = Property::Map()
+      .Add("alphaFunction", "LINEAR")
+      .Add("timePeriod", Property::Map()
+           .Add("delay", 0.0f)
+           .Add("duration", 4.0f));
+
+    Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+    Animation animation = dummyImpl.CreateTransition( transition );
+    animation.Play();
+
+    application.SendNotification();
+    application.Render(0);
+    application.Render(2000u); // halfway point
+    application.SendNotification();
+
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 0.75f), true, TEST_LOCATION );
+
+    application.Render(2001u); // end
+    application.SendNotification();
+
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 1.0f), true, TEST_LOCATION );
+
+    blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
+  }
+
+
+  {
+    tet_infoline( "Test that the opacity can be reduced via animation, and that the blend mode is set appropriately at the start and end of the animation." );
+
+    Property::Map map;
+    map["target"] = "testVisual";
+    map["property"] = DevelVisual::Property::OPACITY;
+    map["targetValue"] = 0.1f;
+    map["animator"] = Property::Map()
+      .Add("alphaFunction", "LINEAR")
+      .Add("timePeriod", Property::Map()
+           .Add("delay", 0.0f)
+           .Add("duration", 4.0f));
+
+    Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+    Animation animation = dummyImpl.CreateTransition( transition );
+    animation.Play();
+
+    blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
+
+    application.SendNotification();
+    application.Render(0);
+    application.Render(2000u); // halfway point
+    application.SendNotification();
+
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 0.55f), true, TEST_LOCATION );
+
+    application.Render(2016u); // end
+    application.SendNotification();
+
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 0.1f), true, TEST_LOCATION );
+
+    blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
+  }
+
+
+  END_TEST;
+}
+
 int UtcDaliVisualAnimateImageVisualPixelArea(void)
 {
   ToolkitTestApplication application;
index 2eb6262..ab0f0cd 100644 (file)
@@ -330,10 +330,13 @@ int UtcDaliVisualFactoryGetColorVisual1(void)
   DummyControl actor = DummyControl::New();
   TestVisualRender( application, actor, visual );
 
-  Vector4 actualValue(Vector4::ZERO);
+  Vector3 actualValue(Vector4::ZERO);
+  float opacity=0.0f;
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "mixColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<float>( "opacity", opacity ) );
+  DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION );
+  DALI_TEST_EQUALS( opacity, testColor.a, TEST_LOCATION );
 
   END_TEST;
 }
@@ -356,10 +359,13 @@ int UtcDaliVisualFactoryGetColorVisual2(void)
   DummyControl actor = DummyControl::New();
   TestVisualRender( application, actor, visual );
 
-  Vector4 actualValue(Vector4::ZERO);
+  Vector3 actualValue;
+  float opacity;
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "mixColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<float>( "opacity", opacity ) );
+  DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION );
+  DALI_TEST_EQUALS( opacity, testColor.a, TEST_LOCATION );
 
   Stage::GetCurrent().Remove(actor);
   DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
index 6b0f6b3..3d9eed7 100644 (file)
@@ -23,7 +23,8 @@
 #include "dali-toolkit/devel-api/builder/tree-node.h"
 #include "dali-toolkit/internal/builder/tree-node-manipulator.h"
 
-namespace
+
+namespace Dali
 {
 
 bool CaseInsensitiveCharacterCompare( unsigned char a, unsigned char b )
@@ -45,12 +46,6 @@ bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b )
   return result;
 }
 
-} // anonymous namespace
-
-
-namespace Dali
-{
-
 namespace Toolkit
 {
 
index 71071db..306ce2d 100644 (file)
@@ -30,6 +30,13 @@ namespace Toolkit
 namespace DevelControl
 {
 
+enum State
+{
+  NORMAL,
+  FOCUSED,
+  DISABLED
+};
+
 namespace Property
 {
 
@@ -53,6 +60,22 @@ enum
    * @see Toolkit::Tooltip
    */
   TOOLTIP = BACKGROUND + 1,
+
+  /**
+   * @brief The current state of the control.
+   * @details Name "state", type DevelControl::State ( Property::INTEGER ) or Property::STRING
+   *
+   * @see DevelControl::State
+   */
+  STATE = BACKGROUND + 2,
+
+  /**
+   * @brief The current sub state of the control.
+   * @details Name "subState", type Property::INTEGER or Property::STRING. The enumeration used is dependent on the derived control.
+   *
+   * @see DevelControl::State
+   */
+  SUB_STATE = BACKGROUND + 3
 };
 
 } // namespace Property
index 9c9a628..b70d254 100644 (file)
@@ -76,11 +76,19 @@ enum Type
 
   /**
    * @brief Mix color is a blend color for any visual.
-   * @details Name "mixColor", type Property::VECTOR4
+   * @details Name "mixColor", type Property::VECTOR3 or Property::VECTOR4
    *
    * @note Optional
    */
   MIX_COLOR = SHADER + 3,
+
+  /**
+   * @brief Opacity is the alpha component of the mixColor, above.
+   * @details Name "opacity", type Property::FLOAT
+   *
+   * @note Optional
+   */
+  OPACITY = SHADER + 4
 };
 
 } //namespace Property
index a7fabdf..ac5ea3e 100644 (file)
 #include <sys/stat.h>
 #include <sstream>
 
-#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/type-info.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/property-array.h>
-#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/camera-actor.h>
-#include <dali/devel-api/scripting/scripting.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/signals/functor-delegate.h>
+#include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/devel-api/builder/json-parser.h>
 
-#include <dali-toolkit/internal/builder/builder-get-is.inl.h>
-#include <dali-toolkit/internal/builder/builder-filesystem.h>
 #include <dali-toolkit/internal/builder/builder-declarations.h>
+#include <dali-toolkit/internal/builder/builder-filesystem.h>
+#include <dali-toolkit/internal/builder/builder-get-is.inl.h>
+#include <dali-toolkit/internal/builder/builder-impl-debug.h>
 #include <dali-toolkit/internal/builder/builder-set-property.h>
 #include <dali-toolkit/internal/builder/replacement.h>
 #include <dali-toolkit/internal/builder/tree-node-manipulator.h>
 
-#include <dali-toolkit/internal/builder/builder-impl-debug.h>
-
 namespace Dali
 {
 
@@ -56,9 +56,12 @@ namespace Internal
 class Replacement;
 
 extern Animation CreateAnimation(const TreeNode& child, const Replacement& replacements, const Dali::Actor searchRoot, Builder* const builder );
+
 extern Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, Dali::Toolkit::Internal::Builder* const builder);
+
 extern Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, Dali::Toolkit::Internal::Builder* const builder);
 
+
 #if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gFilterScript  = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_SCRIPT");
 #endif
@@ -68,14 +71,20 @@ namespace
 
 #define TOKEN_STRING(x) #x
 
-const std::string KEYNAME_STYLES    = "styles";
-const std::string KEYNAME_TYPE      = "type";
-const std::string KEYNAME_ACTORS    = "actors";
-const std::string KEYNAME_SIGNALS   = "signals";
-const std::string KEYNAME_NAME      = "name";
-const std::string KEYNAME_TEMPLATES = "templates";
-const std::string KEYNAME_INCLUDES  = "includes";
-const std::string KEYNAME_MAPPINGS  = "mappings";
+const std::string KEYNAME_ACTORS           = "actors";
+const std::string KEYNAME_ENTRY_TRANSITION = "entryTransition";
+const std::string KEYNAME_EXIT_TRANSITION  = "exitTransition";
+const std::string KEYNAME_INCLUDES         = "includes";
+const std::string KEYNAME_INHERIT          = "inherit";
+const std::string KEYNAME_MAPPINGS         = "mappings";
+const std::string KEYNAME_NAME             = "name";
+const std::string KEYNAME_SIGNALS          = "signals";
+const std::string KEYNAME_STATES           = "states";
+const std::string KEYNAME_STYLES           = "styles";
+const std::string KEYNAME_TEMPLATES        = "templates";
+const std::string KEYNAME_TRANSITIONS      = "transitions";
+const std::string KEYNAME_TYPE             = "type";
+const std::string KEYNAME_VISUALS          = "visuals";
 
 const std::string PROPERTIES = "properties";
 const std::string ANIMATABLE_PROPERTIES = "animatableProperties";
@@ -121,7 +130,12 @@ void CollectAllStyles( const TreeNode& stylesCollection, const TreeNode& style,
         {
           styleList.push_back( &(*node) );
 
-          if( OptionalChild subStyle = IsChild( *node, KEYNAME_STYLES ) )
+          OptionalChild subStyle = IsChild( *node, KEYNAME_INHERIT );
+          if( ! subStyle )
+          {
+            subStyle = IsChild( *node, KEYNAME_STYLES );
+          }
+          if( subStyle )
           {
             CollectAllStyles( stylesCollection, *subStyle, styleList );
           }
@@ -134,379 +148,256 @@ void CollectAllStyles( const TreeNode& stylesCollection, const TreeNode& style,
 
 } // namespace anon
 
-/*
- * Sets the handle properties found in the tree node
- */
-void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replacement& constant )
+
+Builder::Builder()
+: mSlotDelegate( this )
 {
-  if( handle )
-  {
+  mParser = Dali::Toolkit::JsonParser::New();
 
-    for( TreeNode::ConstIterator iter = node.CBegin(); iter != node.CEnd(); ++iter )
-    {
-      const TreeNode::KeyNodePair& keyChild = *iter;
+  Property::Map defaultDirs;
+  defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ]       = DALI_IMAGE_DIR;
+  defaultDirs[ TOKEN_STRING(DALI_SOUND_DIR) ]       = DALI_SOUND_DIR;
+  defaultDirs[ TOKEN_STRING(DALI_STYLE_DIR) ]       = DALI_STYLE_DIR;
+  defaultDirs[ TOKEN_STRING(DALI_STYLE_IMAGE_DIR) ] = DALI_STYLE_IMAGE_DIR;
 
-      std::string key( keyChild.first );
+  AddConstants( defaultDirs );
+}
 
-      // ignore special fields; type,actors,signals,styles
-      if(key == KEYNAME_TYPE || key == KEYNAME_ACTORS || key == KEYNAME_SIGNALS || key == KEYNAME_STYLES || key == KEYNAME_MAPPINGS )
-      {
-        continue;
-      }
+void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::UIFormat format )
+{
+  // parser to get constants and includes only
+  Dali::Toolkit::JsonParser parser = Dali::Toolkit::JsonParser::New();
+
+  if( !parser.Parse( data ) )
+  {
+    DALI_LOG_WARNING( "JSON Parse Error:%d:%d:'%s'\n",
+                      parser.GetErrorLineNumber(),
+                      parser.GetErrorColumn(),
+                      parser.GetErrorDescription().c_str() );
 
-      Handle propertyObject( handle );
+    DALI_ASSERT_ALWAYS(!"Cannot parse JSON");
+  }
+  else
+  {
+    // load constant map (allows the user to override the constants in the json after loading)
+    LoadConstants( *parser.GetRoot(), mReplacementMap );
 
-      Dali::Property::Index index = propertyObject.GetPropertyIndex( key );
+    // merge includes
+    if( OptionalChild includes = IsChild(*parser.GetRoot(), KEYNAME_INCLUDES) )
+    {
+      Replacement replacer( mReplacementMap );
 
-      if( Property::INVALID_INDEX != index )
+      for(TreeNode::ConstIterator iter = (*includes).CBegin(); iter != (*includes).CEnd(); ++iter)
       {
-        Property::Type type = propertyObject.GetPropertyType(index);
-        Property::Value value;
-        bool mapped = false;
+        OptionalString filename = replacer.IsString( (*iter).second );
 
-        // if node.value is a mapping, get the property value from the "mappings" table
-        if( keyChild.second.GetType() == TreeNode::STRING )
-        {
-          std::string mappingKey;
-          if( GetMappingKey(keyChild.second.GetString(), mappingKey) )
-          {
-            OptionalChild mappingRoot = IsChild( mParser.GetRoot(), KEYNAME_MAPPINGS );
-            mapped = GetPropertyMap( *mappingRoot, mappingKey.c_str(), type, value );
-          }
-        }
-        if( ! mapped )
-        {
-          mapped = DeterminePropertyFromNode( keyChild.second, type, value, constant );
-          if( ! mapped )
-          {
-            // Just determine the property from the node and if it's valid, let the property object handle it
-            DeterminePropertyFromNode( keyChild.second, value, constant );
-            mapped = ( value.GetType() != Property::NONE );
-          }
-        }
-        if( mapped )
+        if( filename )
         {
-          DALI_SCRIPT_VERBOSE("SetProperty '%s' Index=:%d Value Type=%d Value '%s'\n", key.c_str(), index, value.GetType(), PropertyValueToString(value).c_str() );
-
-          propertyObject.SetProperty( index, value );
+#if defined(DEBUG_ENABLED)
+          DALI_SCRIPT_VERBOSE("Loading Include '%s'\n", (*filename).c_str());
+#endif
+          LoadFromString( GetFileContents(*filename) );
         }
       }
-      else
-      {
-        DALI_LOG_ERROR("Key '%s' not found.\n", key.c_str());
-      }
+    }
 
-      // Add custom properties
-      SetCustomProperties(node, handle, constant, PROPERTIES, Property::READ_WRITE);
-      SetCustomProperties(node, handle, constant, ANIMATABLE_PROPERTIES, Property::ANIMATABLE);
+    if( !mParser.Parse( data ) )
+    {
+      DALI_LOG_WARNING( "JSON Parse Error:%d:%d:'%s'\n",
+                        mParser.GetErrorLineNumber(),
+                        mParser.GetErrorColumn(),
+                        mParser.GetErrorDescription().c_str() );
 
-    } // for property nodes
-  }
-  else
-  {
-    DALI_SCRIPT_WARNING("Style applied to empty handle\n");
+      DALI_ASSERT_ALWAYS(!"Cannot parse JSON");
+    }
   }
+
+  DUMP_PARSE_TREE(parser); // This macro only writes out if DEBUG is enabled and the "DUMP_TREE" constant is defined in the stylesheet.
+  DUMP_TEST_MAPPINGS(parser);
+
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Cannot parse JSON");
 }
 
-void Builder::SetCustomProperties( const TreeNode& node, Handle& handle, const Replacement& constant,
-                          const std::string& childName, Property::AccessMode accessMode )
+void Builder::AddConstants( const Property::Map& map )
 {
-  // Add custom properties
-  if( OptionalChild customPropertiesChild = IsChild(node, childName) )
-  {
-    const TreeNode& customPropertiesNode = *customPropertiesChild;
-    const TreeConstIter endIter = customPropertiesNode.CEnd();
-    for( TreeConstIter iter = customPropertiesNode.CBegin(); endIter != iter; ++iter )
-    {
-      const TreeNode::KeyNodePair& keyChild = *iter;
-      std::string key( keyChild.first );
+  mReplacementMap.Merge( map );
+}
 
-      Property::Value value;
-      DeterminePropertyFromNode( keyChild.second, value, constant );
-      // Register/Set property.
-      handle.RegisterProperty( key, value, accessMode );
-    }
-  }
+void Builder::AddConstant( const std::string& key, const Property::Value& value )
+{
+  mReplacementMap[key] = value;
 }
 
-// Set properties from node on handle.
-void Builder::ApplyProperties( const TreeNode& root, const TreeNode& node,
-                               Dali::Handle& handle, const Replacement& constant )
+const Property::Map& Builder::GetConstants() const
 {
-  if( Actor actor = Actor::DownCast(handle) )
-  {
-    SetProperties( node, actor, constant );
+  return mReplacementMap;
+}
 
-    if( actor )
-    {
-      // add signals
-      SetupSignalAction( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
-      SetupPropertyNotification( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
-   }
+const Property::Value& Builder::GetConstant( const std::string& key ) const
+{
+  Property::Value* match = mReplacementMap.Find( key );
+  if( match )
+  {
+    return (*match);
   }
   else
   {
-    SetProperties( node, handle, constant );
+    static Property::Value invalid;
+    return invalid;
   }
 }
 
-// Appling by style helper
-// use FindChildByName() to apply properties referenced in KEYNAME_ACTORS in the node
-void Builder::ApplyStylesByActor(  const TreeNode& root, const TreeNode& node,
-                                   Dali::Handle& handle, const Replacement& constant )
+Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor )
 {
-  if( Dali::Actor actor = Dali::Actor::DownCast( handle ) )
-  {
-    if( const TreeNode* actors = node.GetChild( KEYNAME_ACTORS ) )
-    {
-      // in a style the actor subtree properties referenced by actor name
-      for( TreeConstIter iter = actors->CBegin(); iter != actors->CEnd(); ++iter )
-      {
-        Dali::Actor foundActor;
-
-        if( (*iter).first )
-        {
-          foundActor = actor.FindChildByName( (*iter).first );
-        }
-
-        if( !foundActor )
-        {
-          // debug log cannot find searched for actor
-#if defined(DEBUG_ENABLED)
-          DALI_SCRIPT_VERBOSE("Cannot find actor in style application '%s'\n", (*iter).first);
-#endif
-        }
-        else
-        {
-#if defined(DEBUG_ENABLED)
-          DALI_SCRIPT_VERBOSE("Styles applied to actor '%s'\n", (*iter).first);
-#endif
-          ApplyProperties( root, (*iter).second, foundActor, constant );
-        }
-      }
-    }
-  }
+  Replacement replacement(map, mReplacementMap);
+  return CreateAnimation( animationName, replacement, sourceActor);
 }
 
+Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map )
+{
+  Replacement replacement(map, mReplacementMap);
+  return CreateAnimation( animationName, replacement, Stage::GetCurrent().GetRootLayer() );
+}
 
-void Builder::ApplyAllStyleProperties( const TreeNode& root, const TreeNode& node,
-                                       Dali::Handle& handle, const Replacement& constant )
+Animation Builder::CreateAnimation( const std::string& animationName, Dali::Actor sourceActor )
 {
-  OptionalChild styles = IsChild(root, KEYNAME_STYLES);
-  OptionalChild style  = IsChild(node, KEYNAME_STYLES);
+  Replacement replacement( mReplacementMap );
 
-  if( styles && style )
-  {
-    TreeNodeList additionalStyles;
+  return CreateAnimation( animationName, replacement, sourceActor );
+}
 
-    CollectAllStyles( *styles, *style, additionalStyles );
+Animation Builder::CreateAnimation( const std::string& animationName )
+{
+  Replacement replacement( mReplacementMap );
 
-#if defined(DEBUG_ENABLED)
-    for(TreeNode::ConstIterator iter = (*style).CBegin(); iter != (*style).CEnd(); ++iter)
-    {
-      if( OptionalString styleName = IsString( (*iter).second ) )
-      {
-        DALI_SCRIPT_VERBOSE("Style Applied '%s'\n", (*styleName).c_str());
-      }
-    }
-#endif
+  return CreateAnimation( animationName, replacement, Dali::Stage::GetCurrent().GetRootLayer() );
+}
 
-    // a style may have other styles, which has other styles etc so we apply in reverse by convention.
-    for(TreeNodeList::reverse_iterator iter = additionalStyles.rbegin(); iter != additionalStyles.rend(); ++iter)
-    {
-      ApplyProperties( root, *(*iter), handle, constant );
+BaseHandle Builder::Create( const std::string& templateName )
+{
+  Replacement replacement( mReplacementMap );
+  return Create( templateName, replacement );
+}
 
-      ApplyStylesByActor( root, *(*iter), handle, constant );
-    }
-  }
+BaseHandle Builder::Create( const std::string& templateName, const Property::Map& map )
+{
+  Replacement replacement( map, mReplacementMap );
+  return Create( templateName, replacement );
+}
+
+BaseHandle Builder::CreateFromJson( const std::string& json )
+{
+  BaseHandle ret;
 
-  // applying given node last
-  ApplyProperties( root, node, handle, constant );
+  // merge in new template, hoping no one else has one named '@temp@'
+  std::string newTemplate =
+    std::string("{\"templates\":{\"@temp@\":") +                      \
+    json +                                                            \
+    std::string("}}");
 
-  ApplyStylesByActor( root, node, handle, constant );
+  if( mParser.Parse(newTemplate) )
+  {
+    Replacement replacement( mReplacementMap );
+    ret = Create( "@temp@", replacement );
+  }
 
+  return ret;
 }
 
-
-/*
- * Create a dali type from a node.
- * If parent given and an actor type was created then add it to the parent and
- * recursively add nodes children.
- */
-BaseHandle Builder::DoCreate( const TreeNode& root, const TreeNode& node,
-                              Actor parent, const Replacement& replacements )
+bool Builder::ApplyFromJson(  Handle& handle, const std::string& json )
 {
-  BaseHandle baseHandle;
-  TypeInfo typeInfo;
-  const TreeNode* templateNode = NULL;
-
-  if( OptionalString typeName = IsString(node, KEYNAME_TYPE) )
-  {
-    typeInfo = TypeRegistry::Get().GetTypeInfo( *typeName );
+  bool ret = false;
 
-    if( !typeInfo )
-    {
-      // a template name is also allowed inplace of the type name
-      OptionalChild templates = IsChild( root, KEYNAME_TEMPLATES);
-
-      if( templates )
-      {
-        if( OptionalChild isTemplate = IsChild( *templates, *typeName ) )
-        {
-          templateNode = &(*isTemplate);
-
-          if( OptionalString templateTypeName = IsString(*templateNode, KEYNAME_TYPE) )
-          {
-            typeInfo = TypeRegistry::Get().GetTypeInfo( *templateTypeName );
-          }
-        }
-      }
-    }
-  }
+  // merge new style, hoping no one else has one named '@temp@'
+  std::string newStyle =
+    std::string("{\"styles\":{\"@temp@\":") +                           \
+    json +                                                              \
+    std::string("}}");
 
-  if(!typeInfo)
+  if( mParser.Parse(newStyle) )
   {
-    DALI_SCRIPT_WARNING("Cannot create Dali type from node '%s'\n", node.GetName());
+    Replacement replacement( mReplacementMap );
+    ret = ApplyStyle( "@temp@", handle, replacement );
   }
-  else
-  {
-    baseHandle       = typeInfo.CreateInstance();
-    Handle handle    = Handle::DownCast(baseHandle);
-    Actor actor      = Actor::DownCast(handle);
-
-    if(handle)
-    {
-
-      DALI_SCRIPT_VERBOSE("Create:%s\n", typeInfo.GetName().c_str());
-
-#if defined(DEBUG_ENABLED)
-      if(handle)
-      {
-        DALI_SCRIPT_VERBOSE("  Is Handle Object=%d\n", (long*)handle.GetObjectPtr());
-        DALI_SCRIPT_VERBOSE("  Is Handle Property Count=%d\n", handle.GetPropertyCount());
-      }
-
-      if(actor)
-      {
-        DALI_SCRIPT_VERBOSE("  Is Actor id=%d\n", actor.GetId());
-      }
-
-      Toolkit::Control control  = Toolkit::Control::DownCast(handle);
-      if(control)
-      {
-        DALI_SCRIPT_VERBOSE("  Is Control id=%d\n", actor.GetId());
-      }
-#endif // DEBUG_ENABLED
 
-      if( templateNode )
-      {
-        ApplyProperties( root, *templateNode, handle, replacements );
+  return ret;
+}
 
-        if( OptionalChild actors = IsChild( *templateNode, KEYNAME_ACTORS ) )
-        {
-          for( TreeConstIter iter = (*actors).CBegin(); iter != (*actors).CEnd(); ++iter )
-          {
-            DoCreate( root, (*iter).second, actor, replacements );
-          }
-        }
-      }
+bool Builder::ApplyStyle( const std::string& styleName, Handle& handle )
+{
+  Replacement replacer( mReplacementMap );
+  return ApplyStyle( styleName, handle, replacer );
+}
 
-      if( actor )
-      {
-        // add children of all the styles
-        if( OptionalChild actors = IsChild( node, KEYNAME_ACTORS ) )
-        {
-          for( TreeConstIter iter = (*actors).CBegin(); iter != (*actors).CEnd(); ++iter )
-          {
-            DoCreate( root, (*iter).second, actor, replacements );
-          }
-        }
+bool Builder::LookupStyleName( const std::string& styleName )
+{
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
 
-        // apply style on top as they need the children to exist
-        ApplyAllStyleProperties( root, node, actor, replacements );
+  OptionalChild styles = IsChild( *mParser.GetRoot(), KEYNAME_STYLES );
+  OptionalChild style  = IsChildIgnoreCase( *styles, styleName );
 
-        // then add to parent
-        if( parent )
-        {
-          parent.Add( actor );
-        }
-      }
-      else
-      {
-        ApplyProperties( root, node, handle, replacements );
-      }
-    }
-    else
-    {
-      DALI_SCRIPT_WARNING("Cannot create handle from type '%s'\n", typeInfo.GetName().c_str());
-    }
+  if( styles && style )
+  {
+    return true;
   }
-
-  return baseHandle;
+  return false;
 }
 
-void Builder::SetupTask( RenderTask& task, const TreeNode& node, const Replacement& constant )
+const StylePtr Builder::GetStyle( const std::string& styleName )
 {
-  const Stage& stage = Stage::GetCurrent();
-  Layer root  = stage.GetRootLayer();
+  const StylePtr* style = mStyles.FindCaseInsensitiveC( styleName );
 
-  if( OptionalString s = constant.IsString( IsChild(node, "sourceActor") ) )
+  if( style==NULL )
   {
-    Actor actor = root.FindChildByName(*s);
-    if(actor)
-    {
-      task.SetSourceActor( actor );
-    }
-    else
-    {
-      DALI_SCRIPT_WARNING("Cannot find source actor on stage for render task called '%s'\n", (*s).c_str() );
-    }
+    return StylePtr(NULL);
   }
-
-  if( OptionalString s = constant.IsString( IsChild(node, "cameraActor") ) )
+  else
   {
-    CameraActor actor = CameraActor::DownCast( root.FindChildByName(*s) );
-    if(actor)
-    {
-      task.SetCameraActor( actor );
-    }
-    else
-    {
-      DALI_SCRIPT_WARNING("Cannot find camera actor on stage for render task called '%s'\n", (*s).c_str() );
-    }
+    return *style;
   }
+}
 
-  if( OptionalString s = constant.IsString( IsChild(node, "targetFrameBuffer") ) )
-  {
-    FrameBufferImage fb = GetFrameBufferImage( *s, constant );
-    if(fb)
-    {
-      task.SetTargetFrameBuffer( fb );
-    }
-    else
-    {
-      DALI_SCRIPT_WARNING("Cannot find target frame buffer '%s'\n", (*s).c_str() );
-    }
-  }
+void Builder::AddActors( Actor toActor )
+{
+  // 'stage' is the default/by convention section to add from
+  AddActors( "stage", toActor );
+}
 
-  if( OptionalString s = constant.IsString( IsChild(node, "screenToFrameBufferFunction") ) )
+void Builder::AddActors( const std::string &sectionName, Actor toActor )
+{
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
+
+  Property::Map overrideMap;
+  Replacement replacements(overrideMap, mReplacementMap);
+
+  OptionalChild add = IsChild(*mParser.GetRoot(), sectionName);
+
+  if( add )
   {
-    if("DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION" == *s)
-    {
-      task.SetScreenToFrameBufferFunction( RenderTask::DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION );
-    }
-    else if("FULLSCREEN_FRAMEBUFFER_FUNCTION" == *s)
+    for( TreeNode::ConstIterator iter = (*add).CBegin(); iter != (*add).CEnd(); ++iter )
     {
-      task.SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
+      // empty actor adds directly to the stage
+      BaseHandle baseHandle = DoCreate( *mParser.GetRoot(), (*iter).second, Actor(), replacements );
+      Actor actor = Actor::DownCast(baseHandle);
+      if(actor)
+      {
+        toActor.Add( actor );
+      }
     }
-    else
+
+    // if were adding the 'stage' section then also check for a render task called stage
+    // to add automatically
+    if( "stage" == sectionName )
     {
-      DALI_SCRIPT_WARNING("todo");
+      if( OptionalChild renderTasks = IsChild(*mParser.GetRoot(), "renderTasks") )
+      {
+        if( OptionalChild tasks = IsChild(*renderTasks, "stage") )
+        {
+          CreateRenderTask( "stage" );
+        }
+      }
     }
   }
-
-  // other setup is via the property system
-  SetProperties( node, task, constant );
 }
 
 void Builder::CreateRenderTask( const std::string &name )
@@ -741,6 +632,7 @@ PathConstrainer Builder::GetPathConstrainer( const std::string& name )
   return ret;
 }
 
+
 bool Builder::IsPathConstrainer( const std::string& name )
 {
   size_t count( mPathConstrainerLut.size() );
@@ -877,60 +769,67 @@ void Builder::EmitQuitSignal()
   mQuitSignal.Emit();
 }
 
-void Builder::AddActors( Actor toActor )
+Builder::~Builder()
 {
-  // 'stage' is the default/by convention section to add from
-  AddActors( "stage", toActor );
 }
 
-void Builder::AddActors( const std::string &sectionName, Actor toActor )
+void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
 {
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
-
-  Property::Map overrideMap;
-  Replacement replacements(overrideMap, mReplacementMap);
-
-  OptionalChild add = IsChild(*mParser.GetRoot(), sectionName);
+  Replacement replacer(intoMap);
 
-  if( add )
+  if( OptionalChild constants = IsChild(root, "constants") )
   {
-    for( TreeNode::ConstIterator iter = (*add).CBegin(); iter != (*add).CEnd(); ++iter )
-    {
-      // empty actor adds directly to the stage
-      BaseHandle baseHandle = DoCreate( *mParser.GetRoot(), (*iter).second, Actor(), replacements );
-      Actor actor = Actor::DownCast(baseHandle);
-      if(actor)
-      {
-        toActor.Add( actor );
-      }
-    }
-
-    // if were adding the 'stage' section then also check for a render task called stage
-    // to add automatically
-    if( "stage" == sectionName )
+    for(TreeNode::ConstIterator iter = (*constants).CBegin();
+        iter != (*constants).CEnd(); ++iter)
     {
-      if( OptionalChild renderTasks = IsChild(*mParser.GetRoot(), "renderTasks") )
+      Dali::Property::Value property;
+      if( (*iter).second.GetName() )
       {
-        if( OptionalChild tasks = IsChild(*renderTasks, "stage") )
-        {
-          CreateRenderTask( "stage" );
-        }
+#if defined(DEBUG_ENABLED)
+        DALI_SCRIPT_VERBOSE("Constant set from json '%s'\n", (*iter).second.GetName());
+#endif
+        DeterminePropertyFromNode( (*iter).second, property, replacer );
+        intoMap[ (*iter).second.GetName() ] = property;
       }
     }
   }
-}
-
-Animation Builder::CreateAnimation( const std::string& animationName, const Replacement& replacement, Dali::Actor sourceActor )
-{
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
-
-  Animation anim;
 
-  if( OptionalChild animations = IsChild(*mParser.GetRoot(), "animations") )
+#if defined(DEBUG_ENABLED)
+  Property::Value* iter = intoMap.Find( "CONFIG_SCRIPT_LOG_LEVEL" );
+  if( iter && iter->GetType() == Property::STRING )
   {
-    if( OptionalChild animation = IsChild(*animations, animationName) )
+    std::string logLevel( iter->Get< std::string >() );
+    if( logLevel == "NoLogging" )
     {
-      anim = Dali::Toolkit::Internal::CreateAnimation( *animation, replacement, sourceActor, this );
+      gFilterScript->SetLogLevel( Integration::Log::NoLogging );
+    }
+    else if( logLevel == "Concise" )
+    {
+      gFilterScript->SetLogLevel( Integration::Log::Concise );
+    }
+    else if( logLevel == "General" )
+    {
+      gFilterScript->SetLogLevel( Integration::Log::General );
+    }
+    else if( logLevel == "Verbose" )
+    {
+      gFilterScript->SetLogLevel( Integration::Log::Verbose );
+    }
+  }
+#endif
+}
+
+Animation Builder::CreateAnimation( const std::string& animationName, const Replacement& replacement, Dali::Actor sourceActor )
+{
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
+
+  Animation anim;
+
+  if( OptionalChild animations = IsChild(*mParser.GetRoot(), "animations") )
+  {
+    if( OptionalChild animation = IsChild(*animations, animationName) )
+    {
+      anim = Dali::Toolkit::Internal::CreateAnimation( *animation, replacement, sourceActor, this );
     }
     else
     {
@@ -945,412 +844,737 @@ Animation Builder::CreateAnimation( const std::string& animationName, const Repl
   return anim;
 }
 
-Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor )
+BaseHandle Builder::Create( const std::string& templateName, const Replacement& constant )
 {
-  Replacement replacement(map, mReplacementMap);
-  return CreateAnimation( animationName, replacement, sourceActor);
-}
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
 
-Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map )
-{
-  Replacement replacement(map, mReplacementMap);
-  return CreateAnimation( animationName, replacement, Stage::GetCurrent().GetRootLayer() );
-}
+  BaseHandle baseHandle;
 
-Animation Builder::CreateAnimation( const std::string& animationName, Dali::Actor sourceActor )
-{
-  Replacement replacement( mReplacementMap );
+  OptionalChild templates = IsChild(*mParser.GetRoot(), KEYNAME_TEMPLATES);
 
-  return CreateAnimation( animationName, replacement, sourceActor );
-}
+  if( !templates )
+  {
+    DALI_SCRIPT_WARNING("No template section found to CreateFromTemplate\n");
+  }
+  else
+  {
+    OptionalChild childTemplate = IsChild(*templates, templateName);
+    if(!childTemplate)
+    {
+      DALI_SCRIPT_WARNING("Template '%s' does not exist in template section\n", templateName.c_str());
+    }
+    else
+    {
+      OptionalString type = constant.IsString( IsChild(*childTemplate, KEYNAME_TYPE) );
 
-Animation Builder::CreateAnimation( const std::string& animationName )
-{
-  Replacement replacement( mReplacementMap );
+      if(!type)
+      {
+        DALI_SCRIPT_WARNING("Cannot create template '%s' as template section is missing 'type'\n", templateName.c_str());
+      }
+      else
+      {
+        baseHandle = DoCreate( *mParser.GetRoot(), *childTemplate, Actor(), constant );
+      }
+    }
+  }
 
-  return CreateAnimation( animationName, replacement, Dali::Stage::GetCurrent().GetRootLayer() );
+  return baseHandle;
 }
 
-bool Builder::ConvertChildValue( const TreeNode& mappingRoot, KeyStack& keyStack, Property::Value& child )
+/*
+ * Create a dali type from a node.
+ * If parent given and an actor type was created then add it to the parent and
+ * recursively add nodes children.
+ */
+BaseHandle Builder::DoCreate( const TreeNode& root, const TreeNode& node,
+                              Actor parent, const Replacement& replacements )
 {
-  bool result = false;
+  BaseHandle baseHandle;
+  TypeInfo typeInfo;
+  const TreeNode* templateNode = NULL;
 
-  switch( child.GetType() )
+  if( OptionalString typeName = IsString(node, KEYNAME_TYPE) )
   {
-    case Property::STRING:
+    typeInfo = TypeRegistry::Get().GetTypeInfo( *typeName );
+
+    if( !typeInfo )
     {
-      std::string value;
-      if( child.Get( value ) )
+      // a template name is also allowed inplace of the type name
+      OptionalChild templates = IsChild( root, KEYNAME_TEMPLATES);
+
+      if( templates )
       {
-        std::string key;
-        if( GetMappingKey( value, key ) )
+        if( OptionalChild isTemplate = IsChild( *templates, *typeName ) )
         {
-          // Check key for cycles:
-          result=true;
-          for( KeyStack::iterator iter = keyStack.begin() ; iter != keyStack.end(); ++iter )
-          {
-            if( key.compare(*iter) == 0 )
-            {
-              // key is already in stack; stop.
-              DALI_LOG_WARNING("Detected cycle in stylesheet mapping table:%s\n", key.c_str());
-              child = Property::Value("");
-              result=false;
-              break;
-            }
-          }
+          templateNode = &(*isTemplate);
 
-          if( result )
+          if( OptionalString templateTypeName = IsString(*templateNode, KEYNAME_TYPE) )
           {
-            // The following call will overwrite the child with the value
-            // from the mapping.
-            RecursePropertyMap( mappingRoot, keyStack, key.c_str(), Property::NONE, child );
-            result = true;
+            typeInfo = TypeRegistry::Get().GetTypeInfo( *templateTypeName );
           }
         }
       }
-      break;
     }
+  }
 
-    case Property::MAP:
+  if(!typeInfo)
+  {
+    DALI_SCRIPT_WARNING("Cannot create Dali type from node '%s'\n", node.GetName());
+  }
+  else
+  {
+    baseHandle       = typeInfo.CreateInstance();
+    Handle handle    = Handle::DownCast(baseHandle);
+    Actor actor      = Actor::DownCast(handle);
+
+    if(handle)
     {
-      Property::Map* map = child.GetMap();
-      if( map )
+
+      DALI_SCRIPT_VERBOSE("Create:%s\n", typeInfo.GetName().c_str());
+
+#if defined(DEBUG_ENABLED)
+      if(handle)
       {
-        for( Property::Map::SizeType i=0; i < map->Count(); ++i )
-        {
-          Property::Value& child = map->GetValue(i);
-          ConvertChildValue(mappingRoot, keyStack, child);
-        }
+        DALI_SCRIPT_VERBOSE("  Is Handle Object=%d\n", (long*)handle.GetObjectPtr());
+        DALI_SCRIPT_VERBOSE("  Is Handle Property Count=%d\n", handle.GetPropertyCount());
       }
-      break;
-    }
 
-    case Property::ARRAY:
-    {
-      Property::Array* array = child.GetArray();
-      if( array )
+      if(actor)
       {
-        for( Property::Array::SizeType i=0; i < array->Count(); ++i )
-        {
-          Property::Value& child = array->GetElementAt(i);
-          ConvertChildValue(mappingRoot, keyStack, child);
-        }
+        DALI_SCRIPT_VERBOSE("  Is Actor id=%d\n", actor.GetId());
       }
-      break;
-    }
-
-    default:
-      // Ignore other types.
-      break;
-  }
 
-  return result;
-}
+      Toolkit::Control control  = Toolkit::Control::DownCast(handle);
+      if(control)
+      {
+        DALI_SCRIPT_VERBOSE("  Is Control id=%d\n", actor.GetId());
+      }
+#endif // DEBUG_ENABLED
 
-bool Builder::RecursePropertyMap( const TreeNode& mappingRoot, KeyStack& keyStack, const char* theKey, Property::Type propertyType, Property::Value& value )
-{
-  Replacement replacer( mReplacementMap );
-  bool result = false;
+      if( templateNode )
+      {
+        ApplyProperties( root, *templateNode, handle, replacements );
 
-  keyStack.push_back( theKey );
+        if( OptionalChild actors = IsChild( *templateNode, KEYNAME_ACTORS ) )
+        {
+          for( TreeConstIter iter = (*actors).CBegin(); iter != (*actors).CEnd(); ++iter )
+          {
+            DoCreate( root, (*iter).second, actor, replacements );
+          }
+        }
+      }
 
-  for( TreeNode::ConstIterator iter = mappingRoot.CBegin(); iter != mappingRoot.CEnd(); ++iter )
-  {
-    std::string aKey( (*iter).first );
-    if( aKey.compare( theKey ) == 0 )
-    {
-      if( propertyType == Property::NONE )
+      if( actor )
       {
-        DeterminePropertyFromNode( (*iter).second, value, replacer );
-        result = true;
+        // add children of all the styles
+        if( OptionalChild actors = IsChild( node, KEYNAME_ACTORS ) )
+        {
+          for( TreeConstIter iter = (*actors).CBegin(); iter != (*actors).CEnd(); ++iter )
+          {
+            DoCreate( root, (*iter).second, actor, replacements );
+          }
+        }
+
+        // apply style on top as they need the children to exist
+        ApplyAllStyleProperties( root, node, actor, replacements );
+
+        // then add to parent
+        if( parent )
+        {
+          parent.Add( actor );
+        }
       }
       else
       {
-        result = DeterminePropertyFromNode( (*iter).second, propertyType, value, replacer );
-      }
-
-      if( result )
-      {
-        ConvertChildValue(mappingRoot, keyStack, value);
+        ApplyProperties( root, node, handle, replacements );
       }
-      break;
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Cannot create handle from type '%s'\n", typeInfo.GetName().c_str());
     }
   }
-  keyStack.pop_back();
-
-  return result;
-}
-
 
-bool Builder::GetPropertyMap( const TreeNode& mappingRoot, const char* theKey, Property::Type propertyType, Property::Value& value )
-{
-  KeyStack keyStack;
-  return RecursePropertyMap( mappingRoot, keyStack, theKey, propertyType, value );
+  return baseHandle;
 }
 
-
-void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::UIFormat format )
+void Builder::SetupTask( RenderTask& task, const TreeNode& node, const Replacement& constant )
 {
-  // parser to get constants and includes only
-  Dali::Toolkit::JsonParser parser = Dali::Toolkit::JsonParser::New();
+  const Stage& stage = Stage::GetCurrent();
+  Layer root  = stage.GetRootLayer();
 
-  if( !parser.Parse( data ) )
+  if( OptionalString s = constant.IsString( IsChild(node, "sourceActor") ) )
   {
-    DALI_LOG_WARNING( "JSON Parse Error:%d:%d:'%s'\n",
-                      parser.GetErrorLineNumber(),
-                      parser.GetErrorColumn(),
-                      parser.GetErrorDescription().c_str() );
-
-    DALI_ASSERT_ALWAYS(!"Cannot parse JSON");
+    Actor actor = root.FindChildByName(*s);
+    if(actor)
+    {
+      task.SetSourceActor( actor );
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Cannot find source actor on stage for render task called '%s'\n", (*s).c_str() );
+    }
   }
-  else
-  {
-    // load constant map (allows the user to override the constants in the json after loading)
-    LoadConstants( *parser.GetRoot(), mReplacementMap );
 
-    // merge includes
-    if( OptionalChild includes = IsChild(*parser.GetRoot(), KEYNAME_INCLUDES) )
+  if( OptionalString s = constant.IsString( IsChild(node, "cameraActor") ) )
+  {
+    CameraActor actor = CameraActor::DownCast( root.FindChildByName(*s) );
+    if(actor)
     {
-      Replacement replacer( mReplacementMap );
-
-      for(TreeNode::ConstIterator iter = (*includes).CBegin(); iter != (*includes).CEnd(); ++iter)
-      {
-        OptionalString filename = replacer.IsString( (*iter).second );
-
-        if( filename )
-        {
-#if defined(DEBUG_ENABLED)
-          DALI_SCRIPT_VERBOSE("Loading Include '%s'\n", (*filename).c_str());
-#endif
-          LoadFromString( GetFileContents(*filename) );
-        }
-      }
+      task.SetCameraActor( actor );
     }
-
-    if( !mParser.Parse( data ) )
+    else
     {
-      DALI_LOG_WARNING( "JSON Parse Error:%d:%d:'%s'\n",
-                        mParser.GetErrorLineNumber(),
-                        mParser.GetErrorColumn(),
-                        mParser.GetErrorDescription().c_str() );
+      DALI_SCRIPT_WARNING("Cannot find camera actor on stage for render task called '%s'\n", (*s).c_str() );
+    }
+  }
 
-      DALI_ASSERT_ALWAYS(!"Cannot parse JSON");
+  if( OptionalString s = constant.IsString( IsChild(node, "targetFrameBuffer") ) )
+  {
+    FrameBufferImage fb = GetFrameBufferImage( *s, constant );
+    if(fb)
+    {
+      task.SetTargetFrameBuffer( fb );
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Cannot find target frame buffer '%s'\n", (*s).c_str() );
     }
   }
 
-  DUMP_PARSE_TREE(parser); // This macro only writes out if DEBUG is enabled and the "DUMP_TREE" constant is defined in the stylesheet.
-  DUMP_TEST_MAPPINGS(parser);
+  if( OptionalString s = constant.IsString( IsChild(node, "screenToFrameBufferFunction") ) )
+  {
+    if("DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION" == *s)
+    {
+      task.SetScreenToFrameBufferFunction( RenderTask::DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION );
+    }
+    else if("FULLSCREEN_FRAMEBUFFER_FUNCTION" == *s)
+    {
+      task.SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("todo");
+    }
+  }
 
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Cannot parse JSON");
+  // other setup is via the property system
+  SetProperties( node, task, constant );
 }
 
-void Builder::AddConstants( const Property::Map& map )
+bool Builder::ApplyStyle( const std::string& styleName, Handle& handle, const Replacement& replacement )
 {
-  mReplacementMap.Merge( map );
-}
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
 
-void Builder::AddConstant( const std::string& key, const Property::Value& value )
-{
-  mReplacementMap[key] = value;
-}
+  OptionalChild styles = IsChild( *mParser.GetRoot(), KEYNAME_STYLES );
 
-const Property::Map& Builder::GetConstants() const
-{
-  return mReplacementMap;
-}
+  std::string styleNameLower(styleName);
+  OptionalChild style  = IsChildIgnoreCase( *styles, styleNameLower );
 
-const Property::Value& Builder::GetConstant( const std::string& key ) const
-{
-  Property::Value* match = mReplacementMap.Find( key );
-  if( match )
+  if( styles && style )
   {
-    return (*match);
+    ApplyAllStyleProperties( *mParser.GetRoot(), *style, handle, replacement );
+    return true;
   }
   else
   {
-    static Property::Value invalid;
-    return invalid;
+    return false;
   }
 }
 
-void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
+void Builder::ApplyAllStyleProperties( const TreeNode& root, const TreeNode& node,
+                                       Dali::Handle& handle, const Replacement& constant )
 {
-  Replacement replacer(intoMap);
+  const char* styleName = node.GetName();
 
-  if( OptionalChild constants = IsChild(root, "constants") )
+  StylePtr style = Style::New();
+
+  StylePtr* matchedStyle = NULL;
+  if( styleName )
   {
-    for(TreeNode::ConstIterator iter = (*constants).CBegin();
-        iter != (*constants).CEnd(); ++iter)
+    matchedStyle = mStyles.FindCaseInsensitive( styleName );
+    if( ! matchedStyle )
     {
-      Dali::Property::Value property;
-      if( (*iter).second.GetName() )
+      OptionalChild styleNodes = IsChild(root, KEYNAME_STYLES);
+      OptionalChild inheritFromNode = IsChild(node, KEYNAME_INHERIT);
+      if( !inheritFromNode )
+      {
+        inheritFromNode = IsChild( node, KEYNAME_STYLES );
+      }
+
+      if( styleNodes )
       {
+        if( inheritFromNode )
+        {
+          TreeNodeList additionalStyleNodes;
+
+          CollectAllStyles( *styleNodes, *inheritFromNode, additionalStyleNodes );
+
 #if defined(DEBUG_ENABLED)
-        DALI_SCRIPT_VERBOSE("Constant set from json '%s'\n", (*iter).second.GetName());
+          for(TreeNode::ConstIterator iter = (*inheritFromNode).CBegin(); iter != (*inheritFromNode).CEnd(); ++iter)
+          {
+            if( OptionalString styleName = IsString( (*iter).second ) )
+            {
+              DALI_SCRIPT_VERBOSE("Style Applied '%s'\n", (*styleName).c_str());
+            }
+          }
 #endif
-        DeterminePropertyFromNode( (*iter).second, property, replacer );
-        intoMap[ (*iter).second.GetName() ] = property;
+
+          // a style may have other styles, which has other styles etc so we apply in reverse by convention.
+          for(TreeNodeList::reverse_iterator iter = additionalStyleNodes.rbegin(); iter != additionalStyleNodes.rend(); ++iter)
+          {
+            RecordStyle( style, *(*iter), handle, constant );
+            ApplySignals( root, *(*iter), handle );
+            ApplyStylesByActor( root, *(*iter), handle, constant );
+          }
+        }
+
+        RecordStyle( style, node, handle, constant );
+        mStyles.Add( styleName, style ); // shallow copy
+        matchedStyle = &style;
       }
     }
   }
 
-#if defined(DEBUG_ENABLED)
-  Property::Value* iter = intoMap.Find( "CONFIG_SCRIPT_LOG_LEVEL" );
-  if( iter && iter->GetType() == Property::STRING )
+  if( matchedStyle )
   {
-    std::string logLevel( iter->Get< std::string >() );
-    if( logLevel == "NoLogging" )
+    StylePtr style( *matchedStyle );
+    style->ApplyVisualsAndPropertiesRecursively( handle ); // (recurses through states)
+  }
+  else // If there were no styles, instead set properties
+  {
+    SetProperties( node, handle, constant );
+  }
+  ApplySignals( root, node, handle );
+  ApplyStylesByActor( root, node, handle, constant );
+}
+
+void Builder::RecordStyle( StylePtr           style,
+                           const TreeNode&    node,
+                           Dali::Handle&      handle,
+                           const Replacement& replacements )
+{
+  // With repeated calls, accumulate inherited states, visuals and properties
+  // but override any with same name
+
+  for( TreeNode::ConstIterator iter = node.CBegin(); iter != node.CEnd(); ++iter )
+  {
+    const TreeNode::KeyNodePair& keyValue = *iter;
+    std::string key( keyValue.first );
+    if( key == KEYNAME_STATES )
     {
-      gFilterScript->SetLogLevel( Integration::Log::NoLogging );
+      const TreeNode& states = keyValue.second;
+      if( states.GetType() != TreeNode::OBJECT )
+      {
+        DALI_LOG_WARNING( "RecordStyle() Node \"%s\" is not a JSON object\n", key.c_str() );
+        continue;
+      }
+
+      for( TreeNode::ConstIterator iter = states.CBegin(); iter != states.CEnd(); ++iter )
+      {
+        const TreeNode& stateNode = (*iter).second;
+        const char* stateName = stateNode.GetName();
+        if( stateNode.GetType() != TreeNode::OBJECT )
+        {
+          DALI_LOG_WARNING( "RecordStyle() Node \"%s\" is not a JSON object\n", stateName );
+          continue;
+        }
+
+        StylePtr* stylePtr = style->subStates.FindCaseInsensitive( stateName );
+        if( stylePtr )
+        {
+          StylePtr style(*stylePtr);
+          RecordStyle( style, stateNode, handle, replacements );
+        }
+        else
+        {
+          StylePtr subState = Style::New();
+          RecordStyle( subState, stateNode, handle, replacements );
+          style->subStates.Add( stateName, subState );
+        }
+      }
     }
-    else if( logLevel == "Concise" )
+    else if( key == KEYNAME_VISUALS )
     {
-      gFilterScript->SetLogLevel( Integration::Log::Concise );
+      for( TreeNode::ConstIterator iter = keyValue.second.CBegin(); iter != keyValue.second.CEnd(); ++iter )
+      {
+        // Each key in this table should be a property name matching a visual.
+        const TreeNode::KeyNodePair& visual = *iter;
+        Dali::Property::Value property(Property::MAP);
+        if( DeterminePropertyFromNode( visual.second, Property::MAP, property, replacements ) )
+        {
+          Property::Map* mapPtr = style->visuals.FindCaseInsensitive( visual.first );
+          if( mapPtr )
+          {
+            // Override existing visuals
+            mapPtr->Clear();
+            mapPtr->Merge(*property.GetMap());
+          }
+          else
+          {
+            style->visuals.Add(visual.first, *property.GetMap());
+          }
+        }
+      }
     }
-    else if( logLevel == "General" )
+    else if( key == KEYNAME_ENTRY_TRANSITION )
     {
-      gFilterScript->SetLogLevel( Integration::Log::General );
+      Dali::Property::Value property(Property::MAP);
+      if( DeterminePropertyFromNode( keyValue.second, Property::MAP, property, replacements ) )
+      {
+        style->entryTransition = Toolkit::TransitionData::New( *property.GetMap() );
+      }
     }
-    else if( logLevel == "Verbose" )
+    else if( key == KEYNAME_EXIT_TRANSITION )
     {
-      gFilterScript->SetLogLevel( Integration::Log::Verbose );
+      Dali::Property::Value property(Property::MAP);
+      if( DeterminePropertyFromNode( keyValue.second, Property::MAP, property, replacements ) )
+      {
+        style->exitTransition = Toolkit::TransitionData::New( *property.GetMap() );
+      }
+    }
+    else if( key == KEYNAME_TRANSITIONS )
+    {
+      //@todo add new transitions to style.transitions
+      //      override existing transitions. A transition matches on target & property name
+      const TreeNode& node = keyValue.second;
+      if( node.GetType() == TreeNode::ARRAY )
+      {
+        Dali::Property::Value property(Property::ARRAY);
+        if( DeterminePropertyFromNode( node, Property::ARRAY, property, replacements ) )
+        {
+          style->transitions = *property.GetArray();
+        }
+      }
+      else if( node.GetType() == TreeNode::OBJECT )
+      {
+        Dali::Property::Value property(Property::MAP);
+        if( DeterminePropertyFromNode( node, Property::MAP, property, replacements ) )
+        {
+          Property::Array propertyArray;
+          propertyArray.Add( property );
+          style->transitions = propertyArray;
+        }
+      }
+      else
+      {
+        DALI_LOG_WARNING( "RecordStyle() Node \"%s\" is not a JSON array or object\n", key.c_str() );
+      }
+    }
+    else if( key == KEYNAME_TYPE ||
+             key == KEYNAME_ACTORS ||
+             key == KEYNAME_SIGNALS ||
+             key == KEYNAME_STYLES ||
+             key == KEYNAME_MAPPINGS ||
+             key == KEYNAME_INHERIT )
+    {
+      continue;
+    }
+    else // It's a property
+    {
+      Property::Index index;
+      Property::Value value;
+      if( MapToTargetProperty( handle, key, keyValue.second, replacements, index, value ) )
+      {
+        Property::Value* existingValuePtr = style->properties.Find( index );
+        if( existingValuePtr != NULL )
+        {
+          *existingValuePtr = value; // Overwrite existing property.
+        }
+        else
+        {
+          style->properties.Add( index, value );
+        }
+      }
     }
   }
-#endif
+}
 
+// Set properties from node on handle.
+void Builder::ApplyProperties( const TreeNode& root, const TreeNode& node,
+                               Dali::Handle& handle, const Replacement& constant )
+{
+  SetProperties( node, handle, constant );
+  ApplySignals( root, node, handle );
 }
 
-bool Builder::ApplyStyle( const std::string& styleName, Handle& handle )
+void Builder::ApplySignals(const TreeNode& root, const TreeNode& node, Dali::Handle& handle )
 {
-  Replacement replacer( mReplacementMap );
-  return ApplyStyle( styleName, handle, replacer );
+  Actor actor = Actor::DownCast(handle);
+  if( actor )
+  {
+    // add signals
+    SetupSignalAction( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
+    SetupPropertyNotification( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
+  }
 }
 
-bool Builder::ApplyStyle( const std::string& styleName, Handle& handle, const Replacement& replacement )
+
+// Appling by style helper
+// use FindChildByName() to apply properties referenced in KEYNAME_ACTORS in the node
+void Builder::ApplyStylesByActor(  const TreeNode& root, const TreeNode& node,
+                                   Dali::Handle& handle, const Replacement& constant )
 {
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
+  if( Dali::Actor actor = Dali::Actor::DownCast( handle ) )
+  {
+    if( const TreeNode* actors = node.GetChild( KEYNAME_ACTORS ) )
+    {
+      // in a style the actor subtree properties referenced by actor name
+      for( TreeConstIter iter = actors->CBegin(); iter != actors->CEnd(); ++iter )
+      {
+        Dali::Actor foundActor;
 
-  OptionalChild styles = IsChild( *mParser.GetRoot(), KEYNAME_STYLES );
+        if( (*iter).first )
+        {
+          foundActor = actor.FindChildByName( (*iter).first );
+        }
 
-  std::string styleNameLower(styleName);
-  OptionalChild style  = IsChildIgnoreCase( *styles, styleNameLower );
+        if( !foundActor )
+        {
+          DALI_SCRIPT_VERBOSE("Cannot find actor in style application '%s'\n", (*iter).first);
+        }
+        else
+        {
+          DALI_SCRIPT_VERBOSE("Styles applied to actor '%s'\n", (*iter).first);
+          ApplyProperties( root, (*iter).second, foundActor, constant );
+        }
+      }
+    }
+  }
+}
 
-  if( styles && style )
+/*
+ * Sets the handle properties found in the tree node
+ */
+void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replacement& constant )
+{
+  if( handle )
   {
-    ApplyAllStyleProperties( *mParser.GetRoot(), *style, handle, replacement );
-    return true;
+    for( TreeNode::ConstIterator iter = node.CBegin(); iter != node.CEnd(); ++iter )
+    {
+      const TreeNode::KeyNodePair& keyChild = *iter;
+
+      std::string key( keyChild.first );
+
+      // ignore special fields;
+      if( key == KEYNAME_TYPE ||
+          key == KEYNAME_ACTORS ||
+          key == KEYNAME_SIGNALS ||
+          key == KEYNAME_STYLES ||
+          key == KEYNAME_MAPPINGS ||
+          key == KEYNAME_INHERIT ||
+          key == KEYNAME_STATES ||
+          key == KEYNAME_VISUALS ||
+          key == KEYNAME_ENTRY_TRANSITION ||
+          key == KEYNAME_EXIT_TRANSITION ||
+          key == KEYNAME_TRANSITIONS )
+      {
+        continue;
+      }
+
+      Property::Index index;
+      Property::Value value;
+
+      bool mapped = MapToTargetProperty( handle, key, keyChild.second, constant, index, value );
+      if( mapped )
+      {
+        DALI_SCRIPT_VERBOSE("SetProperty '%s' Index=:%d Value Type=%d Value '%s'\n", key.c_str(), index, value.GetType(), PropertyValueToString(value).c_str() );
+
+        handle.SetProperty( index, value );
+      }
+
+      // Add custom properties
+      SetCustomProperties(node, handle, constant, PROPERTIES, Property::READ_WRITE);
+      SetCustomProperties(node, handle, constant, ANIMATABLE_PROPERTIES, Property::ANIMATABLE);
+
+    } // for property nodes
   }
   else
   {
-    return false;
+    DALI_SCRIPT_WARNING("Style applied to empty handle\n");
   }
 }
 
-BaseHandle Builder::Create( const std::string& templateName, const Property::Map& map )
+bool Builder::MapToTargetProperty(
+  Handle&            propertyObject,
+  const std::string& key,
+  const TreeNode&    node,
+  const Replacement& constant,
+  Property::Index&   index,
+  Property::Value&   value )
 {
-  Replacement replacement( map, mReplacementMap );
-  return Create( templateName, replacement );
+  bool mapped = false;
+
+  index = propertyObject.GetPropertyIndex( key );
+  if( Property::INVALID_INDEX != index )
+  {
+    Property::Type type = propertyObject.GetPropertyType(index);
+
+    // if node.value is a mapping, get the property value from the "mappings" table
+    if( node.GetType() == TreeNode::STRING )
+    {
+      std::string mappingKey;
+      if( GetMappingKey( node.GetString(), mappingKey) )
+      {
+        OptionalChild mappingRoot = IsChild( mParser.GetRoot(), KEYNAME_MAPPINGS );
+        mapped = GetPropertyMap( *mappingRoot, mappingKey.c_str(), type, value );
+      }
+    }
+    if( ! mapped )
+    {
+      mapped = DeterminePropertyFromNode( node, type, value, constant );
+      if( ! mapped )
+      {
+        // Just determine the property from the node and if it's valid, let the property object handle it
+        DeterminePropertyFromNode( node, value, constant );
+        mapped = ( value.GetType() != Property::NONE );
+      }
+    }
+  }
+  else
+  {
+    DALI_LOG_ERROR("Key '%s' not found.\n", key.c_str());
+  }
+  return mapped;
 }
 
-BaseHandle Builder::Create( const std::string& templateName, const Replacement& constant )
+bool Builder::GetPropertyMap( const TreeNode& mappingRoot, const char* theKey, Property::Type propertyType, Property::Value& value )
 {
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
+  KeyStack keyStack;
+  return RecursePropertyMap( mappingRoot, keyStack, theKey, propertyType, value );
+}
 
-  BaseHandle baseHandle;
+bool Builder::RecursePropertyMap( const TreeNode& mappingRoot, KeyStack& keyStack, const char* theKey, Property::Type propertyType, Property::Value& value )
+{
+  Replacement replacer( mReplacementMap );
+  bool result = false;
 
-  OptionalChild templates = IsChild(*mParser.GetRoot(), KEYNAME_TEMPLATES);
+  keyStack.push_back( theKey );
 
-  if( !templates )
-  {
-    DALI_SCRIPT_WARNING("No template section found to CreateFromTemplate\n");
-  }
-  else
+  for( TreeNode::ConstIterator iter = mappingRoot.CBegin(); iter != mappingRoot.CEnd(); ++iter )
   {
-    OptionalChild childTemplate = IsChild(*templates, templateName);
-    if(!childTemplate)
-    {
-      DALI_SCRIPT_WARNING("Template '%s' does not exist in template section\n", templateName.c_str());
-    }
-    else
+    std::string aKey( (*iter).first );
+    if( aKey.compare( theKey ) == 0 )
     {
-      OptionalString type = constant.IsString( IsChild(*childTemplate, KEYNAME_TYPE) );
-
-      if(!type)
+      if( propertyType == Property::NONE )
       {
-        DALI_SCRIPT_WARNING("Cannot create template '%s' as template section is missing 'type'\n", templateName.c_str());
+        DeterminePropertyFromNode( (*iter).second, value, replacer );
+        result = true;
       }
       else
       {
-        baseHandle = DoCreate( *mParser.GetRoot(), *childTemplate, Actor(), constant );
+        result = DeterminePropertyFromNode( (*iter).second, propertyType, value, replacer );
+      }
+
+      if( result )
+      {
+        ConvertChildValue(mappingRoot, keyStack, value);
       }
+      break;
     }
   }
+  keyStack.pop_back();
 
-  return baseHandle;
+  return result;
 }
 
-BaseHandle Builder::CreateFromJson( const std::string& json )
+bool Builder::ConvertChildValue( const TreeNode& mappingRoot, KeyStack& keyStack, Property::Value& child )
 {
-  BaseHandle ret;
-
-  // merge in new template, hoping no one else has one named '@temp@'
-  std::string newTemplate =
-    std::string("{\"templates\":{\"@temp@\":") +                      \
-    json +                                                            \
-    std::string("}}");
+  bool result = false;
 
-  if( mParser.Parse(newTemplate) )
+  switch( child.GetType() )
   {
-    Replacement replacement( mReplacementMap );
-    ret = Create( "@temp@", replacement );
-  }
+    case Property::STRING:
+    {
+      std::string value;
+      if( child.Get( value ) )
+      {
+        std::string key;
+        if( GetMappingKey( value, key ) )
+        {
+          // Check key for cycles:
+          result=true;
+          for( KeyStack::iterator iter = keyStack.begin() ; iter != keyStack.end(); ++iter )
+          {
+            if( key.compare(*iter) == 0 )
+            {
+              // key is already in stack; stop.
+              DALI_LOG_WARNING("Detected cycle in stylesheet mapping table:%s\n", key.c_str());
+              child = Property::Value("");
+              result=false;
+              break;
+            }
+          }
 
-  return ret;
-}
+          if( result )
+          {
+            // The following call will overwrite the child with the value
+            // from the mapping.
+            RecursePropertyMap( mappingRoot, keyStack, key.c_str(), Property::NONE, child );
+            result = true;
+          }
+        }
+      }
+      break;
+    }
 
-bool Builder::ApplyFromJson(  Handle& handle, const std::string& json )
-{
-  bool ret = false;
+    case Property::MAP:
+    {
+      Property::Map* map = child.GetMap();
+      if( map )
+      {
+        for( Property::Map::SizeType i=0; i < map->Count(); ++i )
+        {
+          Property::Value& child = map->GetValue(i);
+          ConvertChildValue(mappingRoot, keyStack, child);
+        }
+      }
+      break;
+    }
 
-  // merge new style, hoping no one else has one named '@temp@'
-  std::string newStyle =
-    std::string("{\"styles\":{\"@temp@\":") +                           \
-    json +                                                              \
-    std::string("}}");
+    case Property::ARRAY:
+    {
+      Property::Array* array = child.GetArray();
+      if( array )
+      {
+        for( Property::Array::SizeType i=0; i < array->Count(); ++i )
+        {
+          Property::Value& child = array->GetElementAt(i);
+          ConvertChildValue(mappingRoot, keyStack, child);
+        }
+      }
+      break;
+    }
 
-  if( mParser.Parse(newStyle) )
-  {
-    Replacement replacement( mReplacementMap );
-    ret = ApplyStyle( "@temp@", handle, replacement );
+    default:
+      // Ignore other types.
+      break;
   }
 
-  return ret;
-}
-
-
-BaseHandle Builder::Create( const std::string& templateName )
-{
-  Replacement replacement( mReplacementMap );
-  return Create( templateName, replacement );
+  return result;
 }
 
-Builder::Builder()
-: mSlotDelegate( this )
+void Builder::SetCustomProperties( const TreeNode& node, Handle& handle, const Replacement& constant,
+                          const std::string& childName, Property::AccessMode accessMode )
 {
-  mParser = Dali::Toolkit::JsonParser::New();
-
-  Property::Map defaultDirs;
-  defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ]       = DALI_IMAGE_DIR;
-  defaultDirs[ TOKEN_STRING(DALI_SOUND_DIR) ]       = DALI_SOUND_DIR;
-  defaultDirs[ TOKEN_STRING(DALI_STYLE_DIR) ]       = DALI_STYLE_DIR;
-  defaultDirs[ TOKEN_STRING(DALI_STYLE_IMAGE_DIR) ] = DALI_STYLE_IMAGE_DIR;
+  // Add custom properties
+  if( OptionalChild customPropertiesChild = IsChild(node, childName) )
+  {
+    const TreeNode& customPropertiesNode = *customPropertiesChild;
+    const TreeConstIter endIter = customPropertiesNode.CEnd();
+    for( TreeConstIter iter = customPropertiesNode.CBegin(); endIter != iter; ++iter )
+    {
+      const TreeNode::KeyNodePair& keyChild = *iter;
+      std::string key( keyChild.first );
+      Property::Value value;
+      DeterminePropertyFromNode( keyChild.second, value, constant );
 
-  AddConstants( defaultDirs );
+      // Register/Set property.
+      handle.RegisterProperty( key, value, accessMode );
+    }
+  }
 }
 
-Builder::~Builder()
-{
-}
 
 } // namespace Internal
 
index 4c018aa..b6db52d 100644 (file)
@@ -34,6 +34,7 @@
 #include <dali-toolkit/devel-api/builder/json-parser.h>
 #include <dali-toolkit/devel-api/builder/builder.h>
 #include <dali-toolkit/internal/builder/builder-declarations.h>
+#include <dali-toolkit/internal/builder/style.h>
 
 // Warning messages usually displayed
 #define DALI_SCRIPT_WARNING(format, args...) \
@@ -149,6 +150,24 @@ public:
   bool ApplyStyle( const std::string& styleName, Handle& handle );
 
   /**
+   * Lookup the stylename in builder. If it's found in the parse tree,
+   * then return true.
+   * @param[in] styleName The style name to search for
+   * @return true if the stylename exists
+   */
+  bool LookupStyleName( const std::string& styleName );
+
+  /**
+   * Lookup the stylename in the recorded Styles - if it exists,
+   * performs a shallow copy to the passed in style and returns true.
+   * Otherwise it returns false.
+
+   * @param[in] styleName The stylename to search for
+   * @return A const pointer to the style object
+   */
+  const StylePtr GetStyle( const std::string& styleName );
+
+  /**
    * @copydoc Toolkit::Builder::AddActors
    */
   void AddActors( Actor toActor );
@@ -214,99 +233,151 @@ public:
    */
   void EmitQuitSignal();
 
+
 protected:
 
   virtual ~Builder();
 
 private:
-  // Undefined
-  Builder(const Builder&);
-  Builder& operator=(const Builder& rhs);
-
-  void SetupTask( RenderTask& task, const Toolkit::TreeNode& node, const Replacement& replacement );
-
-  void SetCustomProperties( const TreeNode& node, Handle& handle, const Replacement& constant, const std::string& childName, Property::AccessMode accessMode );
-
-private:
-  Toolkit::JsonParser mParser;
-
-  typedef std::map<const std::string, FrameBufferImage> ImageLut;
-  ImageLut mFrameBufferImageLut;
-
-  typedef std::map<const std::string, Path> PathLut;
-  PathLut mPathLut;
-
-  typedef struct{ std::string name; Dali::PathConstrainer pathConstrainer; } PathConstrainerEntry;
-  typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
-  PathConstrainerLut mPathConstrainerLut;
-
+  typedef std::vector<const char*> KeyStack;
+  typedef std::vector< TreeNode::KeyNodePair > MappingsLut;
   typedef struct{ std::string name; Dali::LinearConstrainer linearConstrainer; } LinearConstrainerEntry;
   typedef std::vector<LinearConstrainerEntry> LinearConstrainerLut;
-  LinearConstrainerLut mLinearConstrainerLut;
-
-  SlotDelegate<Builder> mSlotDelegate;
-
-  Property::Map mReplacementMap;
-
-  typedef std::vector< TreeNode::KeyNodePair > MappingsLut;
-  MappingsLut mCompleteMappings;
+  typedef struct{ std::string name; Dali::PathConstrainer pathConstrainer; } PathConstrainerEntry;
+  typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
+  typedef std::map<const std::string, Path> PathLut;
+  typedef std::map<const std::string, FrameBufferImage> ImageLut;
 
-  BaseHandle Create( const std::string& templateName, const Replacement& constant );
+private:
+  // Undefined
+  Builder(const Builder&);
 
-  BaseHandle DoCreate( const TreeNode& root, const TreeNode& node, Actor parent, const Replacement& replacements );
+  // Undefined
+  Builder& operator=(const Builder& rhs);
 
   void LoadConstants( const TreeNode& root, Property::Map& intoMap );
 
-  void LoadIncludes( const std::string& data );
-
-  bool ApplyStyle( const std::string& styleName, Handle& handle, const Replacement& replacement);
-
-  Animation CreateAnimation( const std::string& animationName, const Replacement& replacement, Dali::Actor sourceActor );
-
-  typedef std::vector<const char*> KeyStack;
+  Animation CreateAnimation( const std::string& animationName,
+                             const Replacement& replacement,
+                             Dali::Actor        sourceActor );
+
+  BaseHandle Create( const std::string& templateName,
+                     const Replacement& constant );
+
+  BaseHandle DoCreate( const TreeNode&    root,
+                       const TreeNode&    node,
+                       Actor              parent,
+                       const Replacement& replacements );
+
+  void SetupTask( RenderTask&              task,
+                  const Toolkit::TreeNode& node,
+                  const Replacement&       replacement );
+
+  bool ApplyStyle( const std::string& styleName,
+                   Handle&            handle,
+                   const Replacement& replacement);
+
+  void ApplyAllStyleProperties( const TreeNode&    root,
+                                const TreeNode&    node,
+                                Dali::Handle&      handle,
+                                const Replacement& constant );
+
+  void RecordStyles( const char*        styleName,
+                     const TreeNode&    node,
+                     Dali::Handle&      handle,
+                     const Replacement& replacements );
+
+  void RecordStyle( StylePtr           style,
+                    const TreeNode&    node,
+                    Dali::Handle&      handle,
+                    const Replacement& replacements );
+
+  void ApplyProperties( const TreeNode&    root,
+                        const TreeNode&    node,
+                        Dali::Handle&      handle,
+                        const Replacement& constant );
+
+  void ApplySignals( const TreeNode& root,
+                     const TreeNode& node,
+                     Dali::Handle& handle );
+
+  void ApplyStylesByActor( const TreeNode&    root,
+                           const TreeNode&    node,
+                           Dali::Handle&      handle,
+                           const Replacement& constant );
+
+  void SetProperties( const TreeNode&    node,
+                      Handle&            handle,
+                      const Replacement& constant );
+
+  bool MapToTargetProperty( Handle&            propertyObject,
+                            const std::string& key,
+                            const TreeNode&    node,
+                            const Replacement& constant,
+                            Property::Index&   index,
+                            Property::Value&   value );
 
   /**
-   * Tests if the value is a string delimited by <>. If it is, then it attempts to
-   * change the value to the mapping from a matching key in the mappings table.
+   * Find the key in the mapping table, if it's present, then generate
+   * a property value for it (of the given type if available),
+   * recursing as necessary, and stopping if any cycles are detected.
+   *
    * @param[in] mappingRoot The JSON node containing the mappings
-   * @param[in,out] keyStack the stack of visited keys
+   * @param[in] theKey The key to search for
+   * @param[in] propertyType The property type if known, or NONE
    * @param[in,out] value The string value to test and write back to.
-   * @return true if the value was converted, false otherwise.
    */
-  bool ConvertChildValue( const TreeNode& mappingRoot, KeyStack& keyStack, Property::Value& value );
+  bool GetPropertyMap( const TreeNode&  mappingRoot,
+                       const char*      theKey,
+                       Property::Type   propertyType,
+                       Property::Value& value );
+
+  void SetCustomProperties( const TreeNode&      node,
+                            Handle&              handle,
+                            const Replacement&   constant,
+                            const std::string&   childName,
+                            Property::AccessMode accessMode );
 
   /**
-   * Find the key in the mapping table, if it's present, then generate a property value for it (of the given type if available), recursing as necessary, and stopping if any cycles
-   * are detected.
+   * Find the key in the mapping table, if it's present, then generate
+   * a property value for it (of the given type if available),
+   * recursing as necessary, and stopping if any cycles are detected.
+   *
    * @param[in] mappingRoot The JSON node containing the mappings
    * @param[in] theKey The key to search for
    * @param[in,out] keyStack the stack of visited keys
    * @param[in] propertyType The property type if known, or NONE
    * @param[in,out] value The string value to test and write back to.
    */
-  bool RecursePropertyMap( const TreeNode& mappingRoot, KeyStack& keyStack, const char* theKey, Property::Type propertyType, Property::Value& value );
+  bool RecursePropertyMap( const TreeNode&  mappingRoot,
+                           KeyStack&        keyStack,
+                           const char*      theKey,
+                           Property::Type   propertyType,
+                           Property::Value& value );
+
 
   /**
-   * Find the key in the mapping table, if it's present, then generate a property value for it (of the given type if available), recursing as necessary, and stopping if any cycles
-   * are detected.
+   * Tests if the value is a string delimited by <>. If it is, then it attempts to
+   * change the value to the mapping from a matching key in the mappings table.
    * @param[in] mappingRoot The JSON node containing the mappings
-   * @param[in] theKey The key to search for
-   * @param[in] propertyType The property type if known, or NONE
+   * @param[in,out] keyStack the stack of visited keys
    * @param[in,out] value The string value to test and write back to.
+   * @return true if the value was converted, false otherwise.
    */
-  bool GetPropertyMap( const TreeNode& mappingRoot, const char* theKey, Property::Type propertyType, Property::Value& value );
-
-  void ApplyProperties( const TreeNode& root, const TreeNode& node,
-                        Dali::Handle& handle, const Replacement& constant );
-
-  void ApplyStylesByActor( const TreeNode& root, const TreeNode& node,
-                           Dali::Handle& handle, const Replacement& constant );
-
-  void ApplyAllStyleProperties( const TreeNode& root, const TreeNode& node,
-                                Dali::Handle& handle, const Replacement& constant );
-
-  void SetProperties( const TreeNode& node, Handle& handle, const Replacement& constant );
+  bool ConvertChildValue( const TreeNode& mappingRoot,
+                          KeyStack& keyStack,
+                          Property::Value& value );
 
+private:
+  Toolkit::JsonParser                 mParser;
+  ImageLut                            mFrameBufferImageLut;
+  PathLut                             mPathLut;
+  PathConstrainerLut                  mPathConstrainerLut;
+  LinearConstrainerLut                mLinearConstrainerLut;
+  SlotDelegate<Builder>               mSlotDelegate;
+  Property::Map                       mReplacementMap;
+  MappingsLut                         mCompleteMappings;
+  Dictionary<StylePtr>                mStyles; // State based styles
   Toolkit::Builder::BuilderSignalType mQuitSignal;
 };
 
diff --git a/dali-toolkit/internal/builder/dictionary.h b/dali-toolkit/internal/builder/dictionary.h
new file mode 100644 (file)
index 0000000..22d2afe
--- /dev/null
@@ -0,0 +1,235 @@
+#ifndef DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H
+#define DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H
+
+/*
+ * 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.
+ */
+
+#include <dali/public-api/common/vector-wrapper.h>
+#include <algorithm>
+
+namespace Dali
+{
+extern bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b );
+
+namespace Toolkit
+{
+namespace Internal
+{
+
+/**
+ * The Dictionary template class enables a means of storing key-value
+ * pairs where the keys are strings and the value can be a complex
+ * type.
+ *
+ * It enables lookup of keys via case-insensitive match.
+ */
+template<typename EntryType>
+class Dictionary
+{
+private:
+  /**
+   * Element is a key-value pair
+   */
+  struct Element
+  {
+    std::string key;
+    EntryType entry;
+    Element( const std::string&name, EntryType entry )
+    : key( name ),
+      entry( entry )
+    {
+    }
+  };
+  typedef std::vector<Element> Elements;
+  Elements container;
+
+public:
+  /**
+   * Only allow const iteration over the dictionary
+   */
+  typedef typename Elements::const_iterator iterator;
+
+
+  /**
+   * Constructor
+   */
+  Dictionary<EntryType>()
+  {
+  }
+
+  /**
+   * Add a key value pair to the dictionary.
+   * If the entry does not already exist, add it to the dictionary
+   * using a shallow copy
+   */
+  bool Add( const std::string& name, const EntryType& entry )
+  {
+    for( typename Elements::iterator iter = container.begin(); iter != container.end(); ++iter )
+    {
+      if( iter->key == name )
+      {
+        return false;
+      }
+    }
+    container.push_back( Element(name, entry) );
+    return true;
+  }
+
+  /**
+   * Add a key-value pair to the dictionary
+   * If the entry does not already exist, add it to the dictionary
+   * (shallow copy)
+   */
+  bool Add( const char* name, const EntryType& entry )
+  {
+    bool result=false;
+    if( name != NULL )
+    {
+      std::string theName(name);
+      result=Add(theName, entry);
+    }
+    return result;
+  }
+
+  /**
+   * Find the element in the dictionary pointed at by key, and
+   * return a pointer to it, or NULL.
+   */
+  EntryType* Find( const std::string& key ) const
+  {
+    EntryType* result=NULL;
+
+    if( ! key.empty() )
+    {
+      for( typename Elements::iterator iter = container.begin(); iter != container.end(); ++iter )
+      {
+        if( iter->key == key )
+        {
+          result = &(iter->entry);
+          break;
+        }
+      }
+    }
+    return result;
+  }
+
+  /**
+   * Find the element in the dictionary pointed at by key, and
+   * return a pointer to it, or NULL
+   */
+  EntryType* Find( const char* key ) const
+  {
+    if( key != NULL )
+    {
+      std::string theKey(key);
+      return Find(theKey);
+    }
+    return NULL;
+  }
+
+  /**
+   * Find the element in the dictionary pointed at by key using a case
+   * insensitive search, and return a const pointer to it, or NULL
+   */
+  const EntryType* FindCaseInsensitiveC( const std::string& key ) const
+  {
+    if( ! key.empty() )
+    {
+      for( typename Elements::const_iterator iter = container.begin(); iter != container.end(); ++iter )
+      {
+        if( Dali::CaseInsensitiveStringCompare(iter->key, key ))
+        {
+          const EntryType* result = &(iter->entry);
+          return result;
+        }
+      }
+    }
+    return NULL;
+  }
+
+  /**
+   * Find the element in the dictionary pointed at by key using a case
+   * insensitive search, and return a non-const pointer to it, or NULL
+   */
+  EntryType* FindCaseInsensitive( const std::string& key ) const
+  {
+    EntryType* result = NULL;
+    if( ! key.empty() )
+    {
+      for( typename Elements::const_iterator iter = container.begin(); iter != container.end(); ++iter )
+      {
+        if( Dali::CaseInsensitiveStringCompare(iter->key, key ))
+        {
+          // Const cast because of const_iterator. const_iterator because, STL.
+          result = const_cast<EntryType*>(&(iter->entry));
+        }
+      }
+    }
+    return result;
+  }
+
+  /**
+   * Find the element in the dictionary pointed at by key using a case
+   * insensitive search, and return a const pointer to it, or NULL
+   */
+  const EntryType* FindCaseInsensitiveC( const char* key ) const
+  {
+    if( key != NULL )
+    {
+      std::string theKey(key);
+      return FindCaseInsensitiveC( theKey );
+    }
+    return NULL;
+  }
+
+  /**
+   * Find the element in the dictionary pointed at by key using a case
+   * insensitive search, and return a non-const pointer to it, or NULL
+   */
+  EntryType* FindCaseInsensitive( const char* key ) const
+  {
+    if( key != NULL )
+    {
+      std::string theKey(key);
+      return FindCaseInsensitive( theKey );
+    }
+    return NULL;
+  }
+
+  /**
+   * Return an iterator pointing at the first entry in the dictionary
+   */
+  typename Elements::const_iterator Begin() const
+  {
+    return container.begin();
+  }
+
+  /**
+   * Return an iterator pointing past the last entry in the dictionary
+   */
+  typename Elements::const_iterator End() const
+  {
+    return container.end();
+  }
+};
+
+
+
+}//Internal
+}//Toolkit
+}//Dali
+
+#endif // DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H
diff --git a/dali-toolkit/internal/builder/style.cpp b/dali-toolkit/internal/builder/style.cpp
new file mode 100644 (file)
index 0000000..eaf59dc
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ */
+
+#include <dali/public-api/object/handle.h>
+#include <dali-toolkit/public-api/controls/control.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/internal/builder/style.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+StylePtr Style::New()
+{
+  StylePtr stylePtr( new Style() );
+  return stylePtr;
+}
+
+void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
+{
+  ApplyVisuals( handle );
+  ApplyProperties( handle );
+
+  Toolkit::Control control = Toolkit::Control::DownCast(handle);
+  if( control )
+  {
+    Property::Value value = control.GetProperty(DevelControl::Property::STATE);
+    std::string stateName;
+    if( value.Get( stateName ) )
+    {
+      // Look up state in states table:
+      const StylePtr* stylePtr = subStates.FindCaseInsensitiveC( stateName );
+      if( stylePtr )
+      {
+        const StylePtr statePtr(*stylePtr);
+
+        // We have a state match.
+        statePtr->ApplyVisuals( handle );
+        statePtr->ApplyProperties( handle );
+
+        // Apply substate visuals
+        Property::Value value = control.GetProperty(DevelControl::Property::SUB_STATE);
+        std::string subStateName;
+        if( value.Get( subStateName ) && ! subStateName.empty() )
+        {
+          const StylePtr* stylePtr = statePtr->subStates.FindCaseInsensitiveC( subStateName );
+          if( stylePtr )
+          {
+            const StylePtr subStatePtr(*stylePtr);
+            // We have a sub-state match.
+            subStatePtr->ApplyVisuals( handle );
+            subStatePtr->ApplyProperties( handle );
+          }
+        }
+      }
+    }
+  }
+}
+
+void Style::ApplyVisuals( Handle handle ) const
+{
+  for( Dictionary<Property::Map>::iterator iter = visuals.Begin(); iter != visuals.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 )
+    {
+      const Property::Value value(const_cast<Property::Map&>(map));
+      handle.SetProperty( index, value );
+    }
+  }
+}
+
+void Style::ApplyProperties( Handle handle ) const
+{
+  for( Property::Map::SizeType i=0; i<properties.Count(); ++i )
+  {
+    KeyValuePair keyValue = properties.GetKeyValue( i );
+    if( keyValue.first.type == Property::Key::INDEX )
+    {
+      handle.SetProperty( keyValue.first.indexKey, keyValue.second );
+    }
+  }
+}
+
+Style::Style()
+{
+}
+
+Style::~Style()
+{
+}
+
+
+} // Internal
+} // Toolkit
+} // Dali
diff --git a/dali-toolkit/internal/builder/style.h b/dali-toolkit/internal/builder/style.h
new file mode 100644 (file)
index 0000000..2fb4e83
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef DALI_TOOLKIT_INTERNAL_BUILDER_STYLE_H
+#define DALI_TOOLKIT_INTERNAL_BUILDER_STYLE_H
+
+/*
+ * 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.
+ */
+
+#include <dali/public-api/object/ref-object.h>
+#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
+#include <dali-toolkit/internal/builder/dictionary.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+class Style;
+typedef IntrusivePtr<Style> StylePtr;
+
+/**
+ * This class encapsulates the style information for a given styled
+ * control.  It is generated only when a control instance looks up
+ * it's style information for the first time, and then stored by
+ * Builder.
+ *
+ * It contains the visual, property and transition definitions for the
+ * main control and for each state and sub-state within the control.
+ *
+ * It has methods to enable the base control to apply visuals and
+ * properties per state.
+ */
+class Style : public RefObject
+{
+public:
+  static StylePtr New();
+
+public:
+  /**
+   * Apply the visuals and properties for the current state/substate
+   * of the handle to the control pointed at by handle. Recurses
+   * through sub-states.
+   *
+   * @param[in] handle The handle to apply the visuals to
+   */
+  void ApplyVisualsAndPropertiesRecursively( Handle handle ) const;
+
+
+private:
+  /**
+   * Apply the visuals of the style to the control pointed at by
+   * handle.
+   *
+   * @param[in] handle The handle to apply the visuals to
+   */
+  void ApplyVisuals( Handle handle ) const;
+
+  /**
+   * Apply the properties of the style to the control pointed at by
+   * handle.
+   *
+   * @param[in] handle The handle to apply the properties to
+   */
+  void ApplyProperties( Handle handle ) const;
+
+protected:
+  /**
+   * @brief Default constructor.
+   */
+  Style();
+
+  /**
+   * @brief virtual destructor.
+   */
+  virtual ~Style();
+
+private:
+  // Not implemented
+  DALI_INTERNAL Style( const Style& rhs );
+
+  // Not implemented
+  DALI_INTERNAL Style& operator=(const Style& rhs);
+
+public:
+  // Everything must be shallow-copiable.
+  Dictionary<StylePtr> subStates; // Each named style maps to a state.
+  Dictionary<Property::Map> visuals;
+  Property::Map properties;
+  Property::Array transitions;
+  Toolkit::TransitionData entryTransition;
+  Toolkit::TransitionData exitTransition;
+};
+
+} // Internal
+} // Toolkit
+} // Dali
+
+
+#endif //DALI_TOOLKIT_INTERNAL_BUILDER_STYLE_H
index e3564df..7612185 100755 (executable)
@@ -251,12 +251,6 @@ void ScrollBar::SetScrollIndicator( Actor indicator )
     }
     mIndicator = indicator;
 
-    Toolkit::Control control = Toolkit::Control::DownCast( mIndicator );
-    if( control )
-    {
-      control.SetStyleName( "ScrollBarIndicator" );
-    }
-
     mIndicatorFirstShow = true;
     Self().Add( mIndicator );
 
index f322618..213818a 100755 (executable)
@@ -25,7 +25,7 @@
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/images/resource-image.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -520,8 +520,9 @@ void Slider::CreatePopupImage( const std::string& filename )
 {
   if( mPopup && ( filename.size() > 0 ) )
   {
-    Image image = ResourceImage::New( filename );
-    mPopup.SetImage( image );
+    Property::Map map;
+    map[Toolkit::ImageVisual::Property::URL] = filename;
+    mPopup.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
   }
 }
 
@@ -557,8 +558,9 @@ void Slider::CreatePopupArrowImage( const std::string& filename )
 {
   if( mPopupArrow && ( filename.size() > 0 ) )
   {
-    Image image = ResourceImage::New( filename );
-    mPopupArrow.SetImage( image );
+    Property::Map map;
+    map[Toolkit::ImageVisual::Property::URL] = filename;
+    mPopupArrow.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
   }
 }
 
index 317dbf9..0cb62af 100644 (file)
@@ -252,13 +252,20 @@ void TextSelectionToolbar::SetUpScrollBar( bool enable )
   {
     if( ! mScrollBar )
     {
+      Toolkit::ImageView indicator = Toolkit::ImageView::New();
+      indicator.SetParentOrigin( ParentOrigin::TOP_LEFT );
+      indicator.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+      indicator.SetStyleName( "TextSelectionScrollIndicator" );
+
       mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::Horizontal );
       mScrollBar.SetName( "Text popup scroll bar" );
+      mScrollBar.SetStyleName( "TextSelectionScrollBar" );
       mScrollBar.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
       mScrollBar.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       mScrollBar.SetPosition( mScrollBarPadding.x, -mScrollBarPadding.y );
       mScrollBar.SetResizePolicy( Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH );
       mScrollBar.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
+      mScrollBar.SetScrollIndicator( indicator );
       mScrollBar.GetPanGestureDetector().DetachAll();
       mScrollView.Add( mScrollBar );
     }
index 2fcc669..6ec0d0c 100755 (executable)
@@ -8,6 +8,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/builder/builder-signals.cpp \
    $(toolkit_src_dir)/builder/json-parser-state.cpp \
    $(toolkit_src_dir)/builder/json-parser-impl.cpp \
+   $(toolkit_src_dir)/builder/style.cpp \
    $(toolkit_src_dir)/builder/tree-node-manipulator.cpp \
    $(toolkit_src_dir)/builder/replacement.cpp \
    $(toolkit_src_dir)/visuals/visual-base-impl.cpp \
index 197550f..989997b 100644 (file)
@@ -38,6 +38,7 @@
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 namespace Dali
 {
@@ -162,9 +163,18 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID )
       actor.Add( GetFocusIndicatorActor() );
     }
     // Send notification for the change of focus actor
+    Actor currentFocusedActor = GetCurrentFocusActor();
+
     if( !mFocusChangedSignal.Empty() )
     {
-      mFocusChangedSignal.Emit(GetCurrentFocusActor(), actor);
+      mFocusChangedSignal.Emit(currentFocusedActor, actor);
+    }
+
+    Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast(currentFocusedActor);
+    if( currentlyFocusedControl )
+    {
+      // Do we need it to remember if it was previously DISABLED?
+      currentlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::NORMAL );
     }
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] Focus Changed\n", __FUNCTION__, __LINE__);
@@ -172,6 +182,12 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID )
     // Save the current focused actor
     mCurrentFocusActor = actorID;
 
+    Toolkit::Control newlyFocusedControl = Toolkit::Control::DownCast(actor);
+    if( newlyFocusedControl )
+    {
+      newlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::FOCUSED );
+    }
+
     // Push Current Focused Actor to FocusHistory
     mFocusHistory.PushBack( &actor.GetBaseObject() );
 
@@ -404,17 +420,23 @@ void KeyboardFocusManager::DoKeyboardEnter(Actor actor)
 void KeyboardFocusManager::ClearFocus()
 {
   Actor actor = GetCurrentFocusActor();
-  if(actor)
+  if( actor )
   {
-    if(mFocusIndicatorActor)
+    if( mFocusIndicatorActor )
     {
-      actor.Remove(mFocusIndicatorActor);
+      actor.Remove( mFocusIndicatorActor );
     }
 
     // Send notification for the change of focus actor
     if( !mFocusChangedSignal.Empty() )
     {
-      mFocusChangedSignal.Emit(actor, Actor());
+      mFocusChangedSignal.Emit( actor, Actor() );
+    }
+
+    Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast( actor );
+    if( currentlyFocusedControl )
+    {
+      currentlyFocusedControl.SetProperty( DevelControl::Property::STATE, DevelControl::NORMAL );
     }
   }
 
index d1fa388..b38d23b 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/adaptor-framework/application.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/internal/builder/builder-impl.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/styling/style-manager.h>
@@ -291,7 +292,7 @@ bool StyleManager::LoadJSON( Toolkit::Builder builder, const std::string& jsonFi
   }
 }
 
-void StyleManager::CollectQualifiers( StringList& qualifiersOut )
+static void CollectQualifiers( std::vector<std::string>& qualifiersOut )
 {
   // Append the relevant qualifier for orientation
   int orientation = 0; // Get the orientation from the system
@@ -313,11 +314,24 @@ void StyleManager::CollectQualifiers( StringList& qualifiersOut )
   }
 }
 
-void StyleManager::BuildQualifiedStyleName( const std::string& styleName, const StringList& qualifiers, std::string& qualifiedStyleOut )
+/**
+ * @brief Construct a qualified style name out of qualifiers
+ *
+ * A qualifed style name will be in the format: style-qualifier0-qualifier1-qualifierN
+ *
+ * @param[in] styleName The root name of the style
+ * @param[in] qualifiers List of qualifier names
+ * @param[out] qualifiedStyleOut The qualified style name
+ */
+static void BuildQualifiedStyleName(
+  const std::string& styleName,
+  const std::vector<std::string>& qualifiers,
+  std::string& qualifiedStyleOut )
 {
   qualifiedStyleOut.append( styleName );
 
-  for( StringList::const_iterator it = qualifiers.begin(), itEnd = qualifiers.end(); it != itEnd; ++it )
+  for( std::vector<std::string>::const_iterator it = qualifiers.begin(),
+         itEnd = qualifiers.end(); it != itEnd; ++it )
   {
     const std::string& str = *it;
 
@@ -326,9 +340,9 @@ void StyleManager::BuildQualifiedStyleName( const std::string& styleName, const
   }
 }
 
-void StyleManager::ApplyStyle( Toolkit::Builder builder, Toolkit::Control control )
+static bool GetStyleNameForControl( Toolkit::Builder builder, Toolkit::Control control, std::string& styleName)
 {
-  std::string styleName = control.GetStyleName();
+  styleName = control.GetStyleName();
 
   if( styleName.empty() )
   {
@@ -336,22 +350,43 @@ void StyleManager::ApplyStyle( Toolkit::Builder builder, Toolkit::Control contro
   }
 
   // Apply the style after choosing the correct actual style (e.g. landscape or portrait)
-  StringList qualifiers;
+  std::vector<std::string> qualifiers;
   CollectQualifiers( qualifiers );
 
-  while( true )
+  bool found = 0;
+  std::string qualifiedStyleName;
+  do
   {
-    std::string qualifiedStyleName;
+    qualifiedStyleName.clear();
     BuildQualifiedStyleName( styleName, qualifiers, qualifiedStyleName );
 
     // Break if style found or we have tried the root style name (qualifiers is empty)
-    if( builder.ApplyStyle( qualifiedStyleName, control ) || qualifiers.size() == 0 )
+    if( GetImpl(builder).LookupStyleName( qualifiedStyleName ) )
+    {
+      found = true;
+      break;
+    }
+    if( qualifiers.size() == 0 )
     {
       break;
     }
-
     // Remove the last qualifier in an attempt to find a style that is valid
     qualifiers.pop_back();
+  } while (!found);
+
+  if(found)
+  {
+    styleName = qualifiedStyleName;
+  }
+  return found;
+}
+
+void StyleManager::ApplyStyle( Toolkit::Builder builder, Toolkit::Control control )
+{
+  std::string styleName = control.GetStyleName();
+  if( GetStyleNameForControl( builder, control, styleName ) )
+  {
+    builder.ApplyStyle( styleName, control );
   }
 
   if( mDefaultFontSize >= 0 )
@@ -363,6 +398,21 @@ void StyleManager::ApplyStyle( Toolkit::Builder builder, Toolkit::Control contro
   }
 }
 
+const StylePtr StyleManager::GetRecordedStyle( Toolkit::Control control )
+{
+  if( mThemeBuilder )
+  {
+    std::string styleName = control.GetStyleName();
+
+    if( GetStyleNameForControl( mThemeBuilder, control, styleName ) )
+    {
+      const StylePtr style = GetImpl(mThemeBuilder).GetStyle( styleName );
+      return style;
+    }
+  }
+  return StylePtr(NULL);
+}
+
 Toolkit::Builder StyleManager::FindCachedBuilder( const std::string& key )
 {
   BuilderMap::iterator builderIt = mBuilderCache.find( key );
index f0c217c..aa514ea 100644 (file)
@@ -29,6 +29,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/styling/style-manager.h>
 #include <dali-toolkit/devel-api/builder/builder.h>
+#include <dali-toolkit/internal/builder/style.h>
 
 namespace Dali
 {
@@ -67,7 +68,7 @@ protected:
 
 public: // Public API
 
-/**
+  /**
    * @copydoc Toolkit::StyleManager::ApplyTheme
    */
   void ApplyTheme( const std::string& themeFile );
@@ -111,6 +112,13 @@ public: // Public API
    */
   void ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName );
 
+  /**
+   * Get the state/style information for the given control
+   * @param[in] control The control to get state information for
+   * @return The style information (or empty ptr if not found)
+   */
+  const StylePtr GetRecordedStyle( Toolkit::Control control );
+
 public:
   // SIGNALS
 
@@ -164,24 +172,6 @@ private:
   bool LoadJSON( Toolkit::Builder builder, const std::string& jsonFileName );
 
   /**
-   * @brief Collect qualifiers (e.g. Landscape, portrait etc) for a given style
-   *
-   * @param[in,out] qualifiersOut The list to populate with qualifiers
-   */
-  void CollectQualifiers( StringList& qualifiersOut );
-
-  /**
-   * @brief Construct a qualified style name out of qualifiers
-   *
-   * A qualifed style name will be in the format: style-qualifier0-qualifier1-qualifierN
-   *
-   * @param[in] styleName The root name of the style
-   * @param[in] qualifiers List of qualifier names
-   * @param[out] qualifiedStyleOut The qualified style name
-   */
-  void BuildQualifiedStyleName( const std::string& styleName, const StringList& qualifiers, std::string& qualifiedStyleOut );
-
-  /**
    * @brief Apply a style to the control using the given builder
    *
    * @param[in] builder The builder to apply the style from
index 05fa234..13b8633 100644 (file)
@@ -82,11 +82,12 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
   uniform lowp vec4 borderColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = mixColor*borderColor*uColor;\n
+    gl_FragColor = vec4(mixColor, opacity)*borderColor*uColor;\n
   }\n
 );
 
@@ -109,13 +110,14 @@ const char* VERTEX_SHADER_ANTI_ALIASING = DALI_COMPOSE_SHADER(
 const char* FRAGMENT_SHADER_ANTI_ALIASING = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
   uniform lowp vec4 borderColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   uniform mediump float borderSize;\n
   varying mediump float vAlpha;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = mixColor*borderColor*uColor;\n
+    gl_FragColor = vec4(mixColor, opacity)*borderColor*uColor;\n
     gl_FragColor.a *= smoothstep(0.0, 1.5, vAlpha)*smoothstep( borderSize+1.5, borderSize, vAlpha );\n
   }\n
 );
index 6313211..0ac80d6 100644 (file)
@@ -70,11 +70,12 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = mixColor*uColor;\n
+    gl_FragColor = vec4(mixColor, opacity)*uColor;\n
   }\n
 );
 }
@@ -105,7 +106,16 @@ void ColorVisual::DoSetProperties( const Property::Map& propertyMap )
     Vector4 color;
     if( colorValue->Get( color ) )
     {
-      SetMixColor( color );
+      Property::Type type = colorValue->GetType();
+      if( type == Property::VECTOR4 )
+      {
+        SetMixColor( color );
+      }
+      else if( type == Property::VECTOR3 )
+      {
+        Vector3 color3(color);
+        SetMixColor( color3 );
+      }
     }
     else
     {
@@ -152,7 +162,8 @@ void ColorVisual::InitializeRenderer()
   // ColorVisual has it's own index key for mix color - use this instead
   // of using the new base index to avoid changing existing applications
   // String keys will get to this property.
-  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, mImpl->mMixColor );
+  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
+
   if( mImpl->mMixColor.a < 1.f )
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
index 7f58d66..4ea6a28 100644 (file)
@@ -172,12 +172,13 @@ const char* FRAGMENT_SHADER[] =
 DALI_COMPOSE_SHADER(
   uniform sampler2D sTexture;\n // sampler1D?
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   varying mediump vec2 vTexCoord;\n
   \n
   void main()\n
   {\n
-      gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor.rgb*mixColor.a, mixColor.a) * uColor;\n
+    gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor*opacity, opacity) * uColor;\n
   }\n
 ),
 
@@ -185,12 +186,13 @@ DALI_COMPOSE_SHADER(
 DALI_COMPOSE_SHADER(
   uniform sampler2D sTexture;\n // sampler1D?
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   varying mediump vec2 vTexCoord;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor.rgb*mixColor.a, mixColor.a) * uColor;\n
+    gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor*opacity, opacity) * uColor;\n
   }\n
 )
 };
index a0197cd..f6e2a9f 100644 (file)
@@ -125,12 +125,13 @@ const char* FRAGMENT_SHADER_NO_ATLAS = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   uniform lowp float preMultipliedAlpha;\n
   \n
   lowp vec4 visualMixColor()\n
   {\n
-    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+    return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
   }\n
   void main()\n
   {\n
@@ -143,12 +144,13 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
     uniform sampler2D sTexture;\n
     uniform mediump vec4 uAtlasRect;\n
     uniform lowp vec4 uColor;\n
-    uniform lowp vec4 mixColor;\n
+    uniform lowp vec3 mixColor;\n
+    uniform lowp float opacity;\n
     uniform lowp float preMultipliedAlpha;\n
     \n
     lowp vec4 visualMixColor()\n
     {\n
-        return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+        return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
     }\n
     \n
     void main()\n
@@ -165,7 +167,8 @@ const char* FRAGMENT_SHADER_ATLAS_VARIOUS_WRAP = DALI_COMPOSE_SHADER(
     // WrapMode -- 0: CLAMP; 1: REPEAT; 2: REFLECT;
     uniform lowp vec2 wrapMode;\n
     uniform lowp vec4 uColor;\n
-    uniform lowp vec4 mixColor;\n
+    uniform lowp vec3 mixColor;\n
+    uniform lowp float opacity;\n
     uniform lowp float preMultipliedAlpha;\n
     \n
     mediump float wrapCoordinate( mediump vec2 range, mediump float coordinate, lowp float wrap )\n
@@ -180,7 +183,7 @@ const char* FRAGMENT_SHADER_ATLAS_VARIOUS_WRAP = DALI_COMPOSE_SHADER(
     \n
     lowp vec4 visualMixColor()\n
     {\n
-      return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+      return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
     }\n
     \n
     void main()\n
index 73140cf..051dfa3 100644 (file)
@@ -164,12 +164,13 @@ const char* SIMPLE_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   precision mediump float;\n
   varying mediump vec3 vIllumination;\n
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   uniform lowp float preMultipliedAlpha;\n
 
   lowp vec4 visualMixColor()\n
   {\n
-    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+    return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
   }\n
   void main()\n
   {\n
@@ -247,12 +248,13 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   varying mediump float vSpecular;\n
   uniform sampler2D sDiffuse;\n
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   uniform lowp float preMultipliedAlpha;\n
 
   lowp vec4 visualMixColor()\n
   {\n
-    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+    return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
   }\n
   void main()\n
   {\n
@@ -339,12 +341,13 @@ const char* NORMAL_MAP_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform sampler2D sNormal;\n
   uniform sampler2D sGloss;\n
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   uniform lowp float preMultipliedAlpha;\n
 
   lowp vec4 visualMixColor()\n
   {\n
-    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+    return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
   }\n
   void main()\n
   {\n
index b2f0cbb..6ecb818 100644 (file)
@@ -132,11 +132,12 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 mixColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
   uniform lowp float preMultipliedAlpha;\n
   lowp vec4 visualMixColor()\n
   {\n
-    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+    return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
   }\n
   void main()\n
   {\n
index 78f4c88..748564e 100644 (file)
@@ -166,11 +166,11 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   precision mediump float;\n
   varying   mediump vec3  vIllumination;\n
   uniform   lowp    vec4  uColor;\n
-  uniform   lowp    vec4  mixColor;\n
-
+  uniform   lowp    vec3  mixColor;\n
+  uniform   lowp    float opacity;\n
   void main()\n
   {\n
-    vec4 baseColor = mixColor * uColor;\n
+      vec4 baseColor = vec4(mixColor, opacity) * uColor;\n
     gl_FragColor = vec4( vIllumination.rgb * baseColor.rgb, baseColor.a );\n
   }\n
 );
@@ -225,7 +225,16 @@ void PrimitiveVisual::DoSetProperties( const Property::Map& propertyMap )
     Vector4 color;
     if( colorValue->Get( color ) )
     {
-      SetMixColor( color );
+      Property::Type type = colorValue->GetType();
+      if( type == Property::VECTOR4 )
+      {
+        SetMixColor( color );
+      }
+      else if( type == Property::VECTOR3 )
+      {
+        Vector3 color3(color);
+        SetMixColor( color3 );
+      }
     }
   }
 
@@ -455,7 +464,7 @@ void PrimitiveVisual::InitializeRenderer()
   // Register transform properties
   mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 
-  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, mImpl->mMixColor );
+  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
 }
 
 void PrimitiveVisual::UpdateShaderUniforms()
index 280fac2..55b1478 100644 (file)
@@ -128,12 +128,13 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
     uniform sampler2D sTexture;\n
     uniform mediump vec4 uAtlasRect;\n
     uniform lowp vec4 uColor;\n
-    uniform lowp vec4 mixColor;\n
+    uniform lowp vec3 mixColor;\n
+    uniform lowp float opacity;\n
     \n
     void main()\n
     {\n
       mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
-      gl_FragColor = texture2D( sTexture, texCoord ) * uColor * mixColor;\n
+      gl_FragColor = texture2D( sTexture, texCoord ) * uColor * vec4( mixColor, opacity );\n
     }\n
 );
 
index 8990c9a..19c2c74 100644 (file)
@@ -90,6 +90,7 @@ Internal::Visual::Base::Impl::Impl()
   mControlSize( Vector2::ZERO ),
   mDepthIndex( 0.0f ),
   mMixColorIndex( Property::INVALID_INDEX ),
+  mOpacityIndex( Property::INVALID_INDEX ),
   mFlags( 0 )
 {
 }
index 999b41c..347cf7d 100644 (file)
@@ -122,6 +122,7 @@ struct Base::Impl
   Size            mControlSize;
   float           mDepthIndex;
   Property::Index mMixColorIndex;
+  Property::Index mOpacityIndex;
   int             mFlags;
 };
 
index 701da0e..0d2b050 100644 (file)
@@ -24,6 +24,8 @@
 #include <dali/integration-api/debug.h>
 
 //INTERNAL HEARDER
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
+#include <dali-toolkit/public-api/visuals/primitive-visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
@@ -94,6 +96,10 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap )
       {
         matchKey = Property::Key( DevelVisual::Property::MIX_COLOR );
       }
+      else if( matchKey == OPACITY )
+      {
+        matchKey = Property::Key( DevelVisual::Property::OPACITY );
+      }
     }
 
     switch( matchKey.indexKey )
@@ -133,7 +139,25 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap )
         Vector4 mixColor;
         if( value.Get( mixColor ) )
         {
-          SetMixColor( mixColor );
+          if( value.GetType() == Property::VECTOR4 )
+          {
+            SetMixColor( mixColor );
+          }
+          else
+          {
+            Vector3 mixColor3(mixColor);
+            SetMixColor( mixColor3 );
+          }
+        }
+        break;
+      }
+      case DevelVisual::Property::OPACITY:
+      {
+        float opacity;
+        if( value.Get( opacity ) )
+        {
+          mImpl->mMixColor.a = opacity;
+          SetMixColor( mImpl->mMixColor );
         }
         break;
       }
@@ -236,6 +260,7 @@ void Visual::Base::SetOffStage( Actor& actor )
   {
     DoSetOffStage( actor );
     mImpl->mMixColorIndex = Property::INVALID_INDEX;
+    mImpl->mOpacityIndex = Property::INVALID_INDEX;
     mImpl->mFlags &= ~Impl::IS_ON_STAGE;
   }
 }
@@ -258,7 +283,8 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const
 
   // Note, Color and Primitive will also insert their own mix color into the map
   // which is ok, because they have a different key value range.
-  map.Insert( DevelVisual::Property::MIX_COLOR, GetMixColor() );
+  map.Insert( DevelVisual::Property::MIX_COLOR, mImpl->mMixColor ); // vec4
+  map.Insert( DevelVisual::Property::OPACITY, mImpl->mMixColor.a );
 }
 
 void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
@@ -309,20 +335,29 @@ void Visual::Base::RegisterMixColor()
       mImpl->mRenderer,
       Toolkit::DevelVisual::Property::MIX_COLOR,
       MIX_COLOR,
-      mImpl->mMixColor );
+      Vector3(mImpl->mMixColor) );
+  }
 
-    if( mImpl->mMixColor.a < 1.f )
-    {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
-    }
+  if( mImpl->mMixColor.a < 1.f )
+  {
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+  }
 
-    float preMultipliedAlpha = 0.0f;
-    if( IsPreMultipliedAlphaEnabled() )
-    {
-      preMultipliedAlpha = 1.0f;
-    }
-    mImpl->mRenderer.RegisterProperty( "preMultipliedAlpha", preMultipliedAlpha );
+  if( mImpl->mOpacityIndex == Property::INVALID_INDEX )
+  {
+    mImpl->mOpacityIndex = DevelHandle::RegisterProperty(
+      mImpl->mRenderer,
+      Toolkit::DevelVisual::Property::OPACITY,
+      OPACITY,
+      mImpl->mMixColor.a );
   }
+
+  float preMultipliedAlpha = 0.0f;
+  if( IsPreMultipliedAlphaEnabled() )
+  {
+    preMultipliedAlpha = 1.0f;
+  }
+  mImpl->mRenderer.RegisterProperty( "preMultipliedAlpha", preMultipliedAlpha );
 }
 
 void Visual::Base::SetMixColor( const Vector4& color )
@@ -331,7 +366,8 @@ void Visual::Base::SetMixColor( const Vector4& color )
 
   if( mImpl->mRenderer )
   {
-    mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, color );
+    mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, Vector3(color) );
+    mImpl->mRenderer.SetProperty( mImpl->mOpacityIndex, color.a );
     if( color.a < 1.f )
     {
       mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
@@ -339,6 +375,18 @@ void Visual::Base::SetMixColor( const Vector4& color )
   }
 }
 
+void Visual::Base::SetMixColor( const Vector3& color )
+{
+  mImpl->mMixColor.r = color.r;
+  mImpl->mMixColor.g = color.g;
+  mImpl->mMixColor.b = color.b;
+
+  if( mImpl->mRenderer )
+  {
+    mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, color );
+  }
+}
+
 const Vector4& Visual::Base::GetMixColor() const
 {
   return mImpl->mMixColor;
@@ -349,7 +397,6 @@ Renderer Visual::Base::GetRenderer()
   return mImpl->mRenderer;
 }
 
-
 Property::Index Visual::Base::GetPropertyIndex( Property::Key key )
 {
   Property::Index index = DevelHandle::GetPropertyIndex( mImpl->mRenderer, key );
@@ -385,7 +432,9 @@ Property::Index Visual::Base::GetPropertyIndex( Property::Key key )
 void Visual::Base::SetupTransition(
   Dali::Animation& transition,
   Internal::TransitionData::Animator& animator,
-  Property::Index index )
+  Property::Index index,
+  Property::Value& initialValue,
+  Property::Value& targetValue )
 {
   if( index != Property::INVALID_INDEX )
   {
@@ -393,13 +442,13 @@ void Visual::Base::SetupTransition(
     {
       if( animator.animate == false )
       {
-        mImpl->mRenderer.SetProperty( index, animator.targetValue );
+        mImpl->mRenderer.SetProperty( index, targetValue );
       }
       else
       {
         if( animator.initialValue.GetType() != Property::NONE )
         {
-          mImpl->mRenderer.SetProperty( index, animator.initialValue );
+          mImpl->mRenderer.SetProperty( index, initialValue );
         }
 
         if( ! transition )
@@ -408,7 +457,7 @@ void Visual::Base::SetupTransition(
         }
 
         transition.AnimateTo( Property( mImpl->mRenderer, index ),
-                              animator.targetValue,
+                              targetValue,
                               animator.alphaFunction,
                               TimePeriod( animator.timePeriodDelay,
                                           animator.timePeriodDuration ) );
@@ -429,44 +478,70 @@ void Visual::Base::AnimateProperty(
   }
 #endif
 
-  Property::Index index = Property::INVALID_INDEX;
-
-  bool isMixColor = false;
-  bool isMixColorOpaque = true;
+  Property::Map map;
+  DoCreatePropertyMap( map );
+  Property::Value* valuePtr = map.Find( Toolkit::DevelVisual::Property::TYPE );
+  int visualType;
+  valuePtr->Get(visualType);
 
-  // Get the property index
   if( animator.propertyKey == Toolkit::DevelVisual::Property::MIX_COLOR ||
-      animator.propertyKey == MIX_COLOR )
+      animator.propertyKey == MIX_COLOR ||
+      ( visualType == Toolkit::Visual::COLOR &&
+        animator.propertyKey == ColorVisual::Property::MIX_COLOR ) ||
+      ( visualType == Toolkit::Visual::PRIMITIVE &&
+        animator.propertyKey == PrimitiveVisual::Property::MIX_COLOR ) )
   {
-    isMixColor = true;
-    index = mImpl->mMixColorIndex;
-
-    Vector4 initialColor;
-    if( animator.initialValue.Get(initialColor) ) // if there is an initial color, test it
-    {
-      isMixColorOpaque = initialColor.a >= 1.0f;
-    }
-    else
-    {
-      isMixColorOpaque = mImpl->mMixColor.a >= 1.0f; // otherwise, test the current color
-    }
+    AnimateMixColorProperty( transition, animator );
+  }
+  else if(animator.propertyKey == Toolkit::DevelVisual::Property::OPACITY ||
+          animator.propertyKey == OPACITY )
+  {
+    AnimateOpacityProperty( transition, animator );
   }
   else if( mImpl->mRenderer )
   {
-    index = GetPropertyIndex( animator.propertyKey );
+    AnimateRendererProperty(transition, animator);
   }
+}
 
-  // Set target value into data store
-  if( animator.targetValue.GetType() != Property::NONE )
+void Visual::Base::AnimateOpacityProperty(
+  Dali::Animation& transition,
+  Internal::TransitionData::Animator& animator )
+{
+  Property::Index index = mImpl->mOpacityIndex;
+
+  bool isOpaque = mImpl->mMixColor.a >= 1.0f;
+
+  if( index != Property::INVALID_INDEX )
   {
-    if( isMixColor )
+    float initialOpacity;
+    if( animator.initialValue.Get( initialOpacity ) )
+    {
+      isOpaque = (initialOpacity >= 1.0f);
+    }
+
+    float targetOpacity;
+    if( animator.targetValue.Get( targetOpacity ) )
     {
-      animator.targetValue.Get( mImpl->mMixColor );
+      mImpl->mMixColor.a = targetOpacity;
     }
-    else
+
+    SetupTransition( transition, animator, index, animator.initialValue, animator.targetValue );
+    SetupBlendMode( transition, isOpaque, animator.animate );
+  }
+}
+
+void Visual::Base::AnimateRendererProperty(
+  Dali::Animation& transition,
+  Internal::TransitionData::Animator& animator )
+{
+  Property::Index index = GetPropertyIndex( animator.propertyKey );
+  if( index != Property::INVALID_INDEX )
+  {
+    if( animator.targetValue.GetType() != Property::NONE )
     {
-      // Note: there may be several of these calls if more than one
-      // transform property is animated.
+      // Try writing target value into transform property map
+      // if it's not a valid key, then it won't alter mTransform
       Property::Map map;
       if( animator.propertyKey.type == Property::Key::INDEX )
       {
@@ -479,28 +554,82 @@ void Visual::Base::AnimateProperty(
 
       mImpl->mTransform.UpdatePropertyMap( map );
     }
+
+    SetupTransition( transition, animator, index, animator.initialValue, animator.targetValue );
   }
+}
+
+void Visual::Base::AnimateMixColorProperty(
+  Dali::Animation& transition,
+  Internal::TransitionData::Animator& animator )
+{
+  Property::Index index = mImpl->mMixColorIndex;
+  bool animateOpacity = false;
+  bool isOpaque = true;
+
+  Property::Value initialOpacity;
+  Property::Value targetOpacity;
+  Property::Value initialMixColor;
+  Property::Value targetMixColor;
 
   if( index != Property::INVALID_INDEX )
   {
-    SetupTransition( transition, animator, index );
+    Vector4 initialColor;
+    if( animator.initialValue.Get(initialColor) )
+    {
+      if( animator.initialValue.GetType() == Property::VECTOR4 )
+      {
+        // if there is an initial color specifying alpha, test it
+        isOpaque = initialColor.a >= 1.0f;
+        initialOpacity = initialColor.a;
+      }
+      initialMixColor = Vector3( initialColor );
+    }
 
-    // For mix color, ensure the blend mode is on if the initial or final values are not opaque,
-    // and that it is turned off after the animation ends if the final value is opaque
-    if( isMixColor && (!isMixColorOpaque || mImpl->mMixColor.a < 1.0f) )
+    // Set target value into data store
+    if( animator.targetValue.GetType() != Property::NONE )
     {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+      Vector4 mixColor;
+      animator.targetValue.Get(mixColor);
+      if( animator.targetValue.GetType() == Property::VECTOR4 )
+      {
+        mImpl->mMixColor.a = mixColor.a;
+        targetOpacity = mixColor.a;
+        animateOpacity = true;
+      }
 
-      if( animator.animate == true && mImpl->mMixColor.a >= 1.0f )
+      mImpl->mMixColor.r = mixColor.r;
+      mImpl->mMixColor.g = mixColor.g;
+      mImpl->mMixColor.b = mixColor.b;
+      targetMixColor = Vector3(mixColor);
+    }
+
+    SetupTransition( transition, animator, index, initialMixColor, targetMixColor );
+    if( animateOpacity )
+    {
+      SetupTransition( transition, animator, mImpl->mOpacityIndex, initialOpacity, targetOpacity );
+      SetupBlendMode( transition, isOpaque, animator.animate );
+    }
+  }
+}
+
+void Visual::Base::SetupBlendMode( Animation& transition, bool isInitialOpaque, bool animating )
+{
+  // Ensure the blend mode is turned on if we are animating opacity, and
+  // turned off after the animation ends if the final value is opaque
+  if( ! isInitialOpaque || mImpl->mMixColor.a < 1.0f )
+  {
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+
+    if( animating == true && mImpl->mMixColor.a >= 1.0f )
+    {
+      // When it becomes opaque, set the blend mode back to automatically
+      if( ! mImpl->mBlendSlotDelegate )
       {
-        // When it becomes opaque, set the blend mode back to automatically
-        if( ! mImpl->mBlendSlotDelegate )
-        {
-          mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
-        }
-        transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate),
-                                             &Visual::Base::OnMixColorFinished );
+        mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
       }
+      transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate),
+                                           &Visual::Base::OnMixColorFinished );
     }
   }
 }
index 1722964..e7d8ddd 100644 (file)
@@ -166,12 +166,18 @@ public:
   Renderer GetRenderer();
 
   /**
-   * Sets the mix color of the visual.
+   * Sets the mix color ( including opacity )  of the visual.
    * @param[in] mixColor The new mix color
    */
   void SetMixColor( const Vector4& color );
 
   /**
+   * Sets the mix color of the visual.
+   * @param[in] mixColor The new mix color
+   */
+  void SetMixColor( const Vector3& color );
+
+  /**
    * Gets the mix color of the visual.
    * @return The mix color
    */
@@ -285,10 +291,62 @@ private:
    * @param[in] transition The transition to use or set up.
    * @param[in] animator The animation data to use
    * @param[in] index The property index on the renderer to animate
+   * @param[in] initialValue The optional initial value
+   * @param[in] targetValue The target value to use
    */
   void SetupTransition( Dali::Animation& transition,
                         Internal::TransitionData::Animator& animator,
-                        Property::Index index );
+                        Property::Index index,
+                        Property::Value& initialValue,
+                        Property::Value& targetValue );
+
+  /**
+   * Animate the opacity property - Special handling to
+   * ensure that the blend mode is set to ON whilst animating,
+   * and set back to AUTO if it's opaque at the end of the
+   * animation.
+   *
+   * @param[in] transition The transition to use or set up.
+   * @param[in] animator The animation data to use
+   */
+  void AnimateOpacityProperty( Dali::Animation& transition,
+                               Internal::TransitionData::Animator& animator );
+
+  /**
+   * Animate the renderer property - no special handling
+   *
+   * @param[in] transition The transition to use or set up.
+   * @param[in] animator The animation data to use
+   */
+  void AnimateRendererProperty( Dali::Animation& transition,
+                                Internal::TransitionData::Animator& animator );
+
+  /**
+   * Animate the mix color property.
+   *
+   * If the animator is a vec3, then it only animates the color
+   * channels without animating the opacity.  If it's a vec4, then it
+   * runs 2 animators, one for the the vec3 mixColor, and one for the
+   * opacity. (They are separate uniforms in the shader )
+   *
+   * @param[in] transition The transition to use or set up.
+   * @param[in] animator The animation data to use
+   */
+  void AnimateMixColorProperty( Dali::Animation& transition,
+                                Internal::TransitionData::Animator& animator );
+
+  /**
+   * Set up the right blend mode if the opacity is being animated.
+   * Also ensure that when the animation finishes, the blend mode is
+   * set to the appropriate value. It also uses the target value as
+   * set into mMixColor.
+   *
+   * @param[in] transition The transition to listen to
+   * @param[in] isInitialOpaque Whether the initial value is opaque
+   * @param[in] animating If the transition animates the value.
+   */
+  void SetupBlendMode( Dali::Animation& transition,
+                       bool isInitialOpaque, bool animating );
 
   /**
    * When a mix color animation has finished, ensure the blend mode is set back
index 864227e..c57a8cf 100644 (file)
@@ -66,6 +66,7 @@ const char * const PREMULTIPLIED_ALPHA( "premultipliedAlpha" );
 
 // Mix color
 const char * const MIX_COLOR( "mixColor" );
+const char * const OPACITY( "opacity" );
 
 // Image visual
 const char * const IMAGE_URL_NAME( "url" );
index 8079d34..1a8df73 100644 (file)
@@ -56,6 +56,7 @@ extern const char * const PREMULTIPLIED_ALPHA;
 
 // Mix color
 extern const char * const MIX_COLOR;
+extern const char * const OPACITY;
 
 // Image visual
 extern const char * const IMAGE_URL_NAME;
index 0a5221d..764ba27 100644 (file)
@@ -67,12 +67,13 @@ void main()\n
 );
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(\n
-uniform lowp vec4 uColor;\n
-uniform lowp vec4 mixColor;\n
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
 \n
 void main()\n
 {\n
-  gl_FragColor = uColor*mixColor;\n
+  gl_FragColor = uColor * vec4( mixColor, opacity );\n
 }\n
 );
 
index c94ebb1..3f58064 100644 (file)
@@ -54,6 +54,7 @@
 
 namespace Dali
 {
+extern bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b );
 
 namespace Toolkit
 {
@@ -217,6 +218,12 @@ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   return connected;
 }
 
+const Scripting::StringEnum ControlStateTable[] = {
+  { "NORMAL",   Toolkit::DevelControl::NORMAL   },
+  { "FOCUSED",  Toolkit::DevelControl::FOCUSED  },
+  { "DISABLED", Toolkit::DevelControl::DISABLED },
+}; const unsigned int ControlStateTableCount = sizeof( ControlStateTable ) / sizeof( ControlStateTable[0] );
+
 // Setup signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
 
@@ -246,6 +253,8 @@ public:
   // Construction & Destruction
   Impl(Control& controlImpl)
   : mControlImpl( controlImpl ),
+    mState( Toolkit::DevelControl::NORMAL ),
+    mSubState(""),
     mStyleName(""),
     mBackgroundColor(Color::TRANSPARENT),
     mStartingPinchScale( NULL ),
@@ -312,6 +321,27 @@ public:
           break;
         }
 
+        case Toolkit::DevelControl::Property::STATE:
+        {
+          Toolkit::DevelControl::State state( controlImpl.mImpl->mState );
+
+          if( Scripting::GetEnumerationProperty< Toolkit::DevelControl::State >( value, ControlStateTable, ControlStateTableCount, state ) )
+          {
+            controlImpl.mImpl->SetState( state );
+          }
+        }
+        break;
+
+        case Toolkit::DevelControl::Property::SUB_STATE:
+        {
+          std::string subState;
+          if( value.Get( subState ) )
+          {
+            controlImpl.mImpl->SetSubState( subState );
+          }
+        }
+        break;
+
         case Toolkit::Control::Property::BACKGROUND_COLOR:
         {
           DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
@@ -411,6 +441,12 @@ public:
           break;
         }
 
+        case Toolkit::DevelControl::Property::STATE:
+        {
+          value = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( controlImpl.mImpl->mState, ControlStateTable, ControlStateTableCount );
+          break;
+        }
+
         case Toolkit::Control::Property::BACKGROUND_COLOR:
         {
           DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
@@ -467,9 +503,50 @@ public:
     return value;
   }
 
+  void SetState( DevelControl::State state )
+  {
+    if( mState != state )
+    {
+      // 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;
+
+      // Trigger state change and transitions
+      // Apply new style, if stylemanager is available
+      Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+      if( styleManager )
+      {
+        const StylePtr stylePtr = GetImpl( styleManager ).GetRecordedStyle( Toolkit::Control( mControlImpl.GetOwner() ) );
+        if( stylePtr )
+        {
+          for( int i=mVisuals.Count()-1; i >= 0; i-- )
+          {
+            mControlImpl.UnregisterVisual( mVisuals[i]->index );
+          }
+
+          Dali::CustomActor handle( mControlImpl.GetOwner() );
+          stylePtr->ApplyVisualsAndPropertiesRecursively( handle );
+        }
+      }
+    }
+  }
+
+  void SetSubState( const std::string& state )
+  {
+    if( mSubState != state )
+    {
+      mSubState = state;
+      // Trigger transitions
+
+    }
+  }
+
   // Data
 
   Control& mControlImpl;
+  DevelControl::State mState;
+  std::string mSubState;
+
   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
@@ -498,6 +575,8 @@ public:
   static const PropertyRegistration PROPERTY_4;
   static const PropertyRegistration PROPERTY_5;
   static const PropertyRegistration PROPERTY_6;
+  static const PropertyRegistration PROPERTY_7;
+  static const PropertyRegistration PROPERTY_8;
 };
 
 // Properties registered without macro to use specific member variables.
@@ -507,6 +586,8 @@ const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "backgro
 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 );
 
 Toolkit::Control Control::New()
 {
index 6ff9c12..6ebc98e 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 = 26;
+const unsigned int TOOLKIT_MICRO_VERSION = 27;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index f6f2361..84470a9 100644 (file)
@@ -32,12 +32,24 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief BorderVisual is to render a solid color as an internal border to the control's quad.
+ * @SINCE_1_1.45
+ */
 namespace BorderVisual
 {
 
+/**
+ * @brief BorderVisual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief BorderVisual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
index 5a23abc..fb87e54 100644 (file)
@@ -32,12 +32,24 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief ColorVisual is to render a solid color to the control's quad.
+ * @SINCE_1_1.45
+ */
 namespace ColorVisual
 {
 
+/**
+ * @brief ColorVisual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief ColorVisual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
index 9c3929f..ae895ca 100644 (file)
@@ -32,12 +32,24 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief GradientVisual is to render a smooth transition of colors to the control's quad.
+ * @SINCE_1_1.45
+ */
 namespace GradientVisual
 {
 
+/**
+ * @brief GradientVisual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief GradientVisual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
@@ -109,6 +121,14 @@ enum
 
 } // namespace Property
 
+/**
+ * @brief The type of coordinate system for certain attributes of the points in a gradient.
+ *
+ * This applies to the:
+ * - Start (x1, y1) and End (x2 and y2) points of a line if using a linear gradient.
+ * - Center point (cx, cy) and radius (r) of a circle if using a radial gradient.
+ * @SINCE_1_1.45
+ */
 namespace Units
 {
 
@@ -118,6 +138,7 @@ namespace Units
  * This applies to the:
  * - Start (x1, y1) and End (x2 and y2) points of a line if using a linear gradient.
  * - Center point (cx, cy) and radius (r) of a circle if using a radial gradient.
+ * @SINCE_1_1.45
  */
 enum Type
 {
@@ -127,11 +148,16 @@ enum Type
 
 } // namespace Units
 
+/**
+ * @brief Policies that define what happens if the gradient starts or ends inside the bounds of the target rectangle.
+ * @SINCE_1_1.45
+ */
 namespace SpreadMethod
 {
 
 /**
  * @brief Policies that define what happens if the gradient starts or ends inside the bounds of the target rectangle.
+ * @SINCE_1_1.45
  */
 enum Type
 {
index fd08176..edd94cc 100644 (file)
@@ -32,12 +32,24 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief ImageVisual is to render an image into the control's quad.
+ * @SINCE_1_1.45
+ */
 namespace ImageVisual
 {
 
+/**
+ * @brief ImageVisual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief ImageVisual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
index d9b7348..765fce7 100644 (file)
@@ -32,12 +32,24 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief MeshVisual is to render a mesh using a .obj file, optionally with textures provided by a mtl file.
+ * @SINCE_1_1.45
+ */
 namespace MeshVisual
 {
 
+/**
+ * @brief MeshVisual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief MeshVisual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
@@ -103,9 +115,17 @@ enum
 
 } // namespace Property
 
+/**
+ * @brief The shading mode used by MeshVisual.
+ * @SINCE_1_1.45
+ */
 namespace ShadingMode
 {
 
+/**
+ * @brief The shading mode used by MeshVisual.
+ * @SINCE_1_1.45
+ */
 enum Value
 {
   TEXTURELESS_WITH_DIFFUSE_LIGHTING, ///< *Simplest*. One color that is lit by ambient and diffuse lighting. @SINCE_1_1.45
index 4b31dc6..12f56e5 100644 (file)
@@ -32,12 +32,24 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief PrimitiveVisual is to render a simple 3D shape, such as a cube or sphere.
+ * @SINCE_1_1.45
+ */
 namespace PrimitiveVisual
 {
 
+/**
+ * @brief PrimitiveVisual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief PrimitiveVisual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
@@ -182,11 +194,16 @@ enum
 
 } // namespace Property
 
+/**
+ * @brief The primitive shape to render as a PrimitiveVisual.
+ * @SINCE_1_1.45
+ */
 namespace Shape
 {
 
 /**
- * @brief The primitive shape to render.
+ * @brief The primitive shape to render as a PrimitiveVisual.
+ * @SINCE_1_1.45
  */
 enum Type
 {
index 65d452a..ee24889 100644 (file)
@@ -32,6 +32,10 @@ namespace Toolkit
  * @{
  */
 
+/**
+ * @brief All the visual types
+ * @SINCE_1_1.45
+ */
 namespace Visual
 {
 
@@ -50,9 +54,17 @@ enum Type
   WIREFRAME ///< Renders a simple wire-frame outlining a quad. @SINCE_1_2_2
 };
 
+/**
+ * @brief Visual Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief Visual Property
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
@@ -77,12 +89,24 @@ enum
 
 } // namespace Property
 
+/**
+ * @brief Shader for Visuals
+ * @SINCE_1_1.45
+ */
 namespace Shader
 {
 
+/**
+ * @brief Shader Property
+ * @SINCE_1_1.45
+ */
 namespace Property
 {
 
+/**
+ * @brief The type of Shader
+ * @SINCE_1_1.45
+ */
 enum
 {
   /**
index 6e1c7f1..23af0f7 100644 (file)
         "overshootSize":[480.0,42.0]
       }
     },
+    "TextSelectionScrollBar":
+    {
+      "indicatorShowDuration":0.25,
+      "indicatorHideDuration":0.25
+    },
+    "TextSelectionScrollIndicator":
+    {
+      "image":
+      {
+        "visualType":"IMAGE",
+        "url":"{DALI_IMAGE_DIR}text_selection_scroll_indicator.9.png"
+      },
+      "color":[0.0,0.72,0.9,0.7]
+    },
     "ScrollView":
     {
       "overshootEffectColor":"B018",
     "ScrollBar":
     {
       "indicatorShowDuration":0.25,
-      "indicatorHideDuration":0.25,
-      "color":[0.0,0.72,0.9,0.7]
+      "indicatorHideDuration":0.25
+    },
+    "ScrollBarIndicator":
+    {
+      "image":
+      {
+        "visualType":"IMAGE",
+        "url":"{DALI_IMAGE_DIR}popup_scroll.9.png"
+      }
     },
     "TextEditor":
     {
diff --git a/dali-toolkit/styles/images-common/text_selection_scroll_indicator.9.png b/dali-toolkit/styles/images-common/text_selection_scroll_indicator.9.png
new file mode 100644 (file)
index 0000000..5bf5b3f
Binary files /dev/null and b/dali-toolkit/styles/images-common/text_selection_scroll_indicator.9.png differ
index d2bda2d..f7855fe 100644 (file)
@@ -54,7 +54,9 @@ Alternatively a font may be requested using either or all of FONT_FAMILY, FONT_S
 // C++
 
 label.SetProperty( TextLabel::Property::FONT_FAMILY, "FreeSerif" );
-label.SetProperty( TextLabel::Property::FONT_STYLE,  "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
+label.SetProperty( TextLabel::Property::FONT_STYLE,
+                   Property::Map().Add( "weight", "bold" )
+                                  .Add( "slant", "italic" ) );
 label.SetProperty( TextLabel::Property::POINT_SIZE,  12.0f );
 ~~~
 
@@ -62,7 +64,10 @@ label.SetProperty( TextLabel::Property::POINT_SIZE,  12.0f );
 // JavaScript
 
 label.fontFamily = "FreeSerif";
-label.fontStyle = "{\"weight\":\"bold\",\"slant\":\"italic\"}";
+label.fontStyle = {
+                    "weight" : "bold",
+                    "slant"  : "italic"
+                  };
 label.pointSize = 12;
 ~~~
 
@@ -92,7 +97,11 @@ To change the font for standard text controls, this JSON syntax can be used:
     "textlabel":
     {
       "fontFamily":"FreeSerif",
-      "fontStyle":"{\"weight\":\"bold\",\"slant\":\"italic\"}",
+      "fontStyle":
+      {
+        "weight":"bold",
+        "slant":"italic"
+      },
       "pointSize":8
     }
   }
@@ -126,7 +135,11 @@ in the style sheet are applied after the base section ("textlabel"), so take pre
     "textlabel":
     {
       "fontFamily":"FreeSerif",
-      "fontStyle":"{\"weight\":\"bold\",\"slant\":\"italic\"}",
+      "fontStyle":
+      {
+        "weight":"bold",
+        "slant":"italic"
+      },
     },
 
     "textlabelFontSize0":
@@ -153,7 +166,11 @@ in the style sheet are applied after the base section ("textlabel"), so take pre
     "customLabel":
     {
       "fontFamily":"TimesNewRoman",
-      "fontStyle":"{\"weight\":\"regular\",\"slant\":\"regular\"}",
+      "fontStyle":
+      {
+        "weight":"regular",
+        "slant":"regular"
+      },
     },
     "customLabelFontSize0":
     {
index d8137c7..6f95ef9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-addon
 Summary:    DALi module for Node.JS
-Version:    1.2.26
+Version:    1.2.27
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index ef6a3a3..9f0cb7a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.26
+Version:    1.2.27
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
index 3034cf4..b59ff97 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.
@@ -188,6 +188,7 @@ typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair;
 %include <dali/public-api/math/random.h>
 %include <dali/public-api/math/angle-axis.h>
 %include <dali/public-api/math/viewport.h>
+%include <dali/public-api/math/math-utils.h>
 
 %include <dali/public-api/object/property-index-ranges.h>
 %include <dali/public-api/object/property.h>
@@ -284,10 +285,8 @@ typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair;
 
 %template(StringValuePair) std::pair<std::string, Dali::Property::Value>;
 %template(TouchPointContainer) std::vector<Dali::TouchPoint>;
-%template(RectDouble) Dali::Rect<double>;
-%template(RectInteger)  Dali::Rect<int>;
-%template(RectUnsignedInteger)  Dali::Rect<unsigned int>;
-%template(RectFloat)  Dali::Rect<float>;
+%template(Rectangle)  Dali::Rect<int>;
+%template(PaddingType)  Dali::Rect<float>;
 %template(VectorInteger) Dali::Vector<int>;
 %template(VectorFloat) Dali::Vector<float>;
 %template(VectorUnsignedChar) Dali::Vector<unsigned char>;
index cf7bdab..808cd07 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.
 %}
 %enddef
 
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VIDEOVIEWSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~VideoViewSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VIDEOVIEWSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_VideoViewSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_APPLICATIONSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ApplicationSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_APPLICATIONSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ApplicationSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_APPLICATIONCONTROLSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ApplicationControlSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_APPLICATIONCONTROLSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ApplicationControlSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_IMAGESIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ImageSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_IMAGESIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ImageSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RESOURCESIMAGESIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ResourceImageSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RESOURCESIMAGESIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ResourceImageSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTINT( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~RectInteger() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTINT( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_RectInteger(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTDOUBLE( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~RectDouble() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTDOUBLE( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_RectDouble(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTFLOAT( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~RectFloat() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTFLOAT( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_RectFloat(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTUNSIGNEDINT( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~RectUnsignedInteger() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTUNSIGNEDINT( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_RectUnsignedInteger(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STRINGVALUEPAIR( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~StringValuePair() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STRINGVALUEPAIR( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_StringValuePair(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TOUCHCONTAINER( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~TouchPointContainer() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TOUCHCONTAINER( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_TouchPointContainer(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_BOOLSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~BoolSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_BOOLSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_BoolSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACCESSIBILITYACTIONSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~AccessibilityActionSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYACTIONSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_AccessibilityActionSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACCESSIBILITYACTIONSCROLLSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~AccessibilityActionScrollSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYACTIONSCROLLSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_AccessibilityActionScrollSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACCESSIBILITYFOCUSSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~AccessibilityFocusOvershotSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYFOCUSSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_AccessibilityFocusOvershotSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORINT( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~VectorInteger() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORINT( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_VectorInteger(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORFLOAT( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~VectorFloat() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORFLOAT( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_VectorFloat(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORUNSIGNEDCHAR( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~VectorUnsignedChar() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORUNSIGNEDCHAR( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_VectorUnsignedChar(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORUINT16PAIR( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~VectorUint16Pair() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORUINT16PAIR( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_VectorUint16Pair(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TIMERSIGNALTYPE( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~TimerSignalType() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TIMERSIGNALTYPE( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_TimerSignalType(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACTOR( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ActorSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACTOR( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ActorSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ANIMATIONSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~AnimationSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ANIMATIONSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_AnimationSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_BUTTON( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ButtonSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_BUTTON( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ButtonSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PAGETURNSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~PageTurnSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PAGETURNSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_PageTurnSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PAGEVIEWSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~PagePanSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PAGEVIEWSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_PagePanSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PANGESTURESIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~PanGestureDetectedSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PANGESTURESIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_PanGestureDetectedSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PINCHGESTURESIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~PinchGestureDetectedSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PINCHGESTURESIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_PinchGestureDetectedSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENDERTASKSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~RenderTaskSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENDERTASKSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_RenderTaskSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SCROLLABLESIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ScrollableSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SCROLLABLESIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ScrollableSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SCROLLVIEWSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~ScrollViewSnapStartedSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SCROLLVIEWSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_ScrollViewSnapStartedSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SLIDERVALUECHANGEDSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~SliderValueChangedSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SLIDERVALUECHANGEDSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_SliderValueChangedSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SLIDERMARKCHANGEDSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~SliderMarkReachedSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SLIDERMARKCHANGEDSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_SliderMarkReachedSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STAGESIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~StageWheelSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STAGESIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_StageWheelSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STYLECHANGEDSIGNAL( NameSpace, ClassName )
-%typemap(csfinalize) NameSpace::ClassName %{
-  ~StyleChangedSignal() {
-    DisposeQueue.Instance.Add(this);
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STYLECHANGEDSIGNAL( NameSpace, ClassName )
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
-    if (!Stage.IsInstalled()) {
-      DisposeQueue.Instance.Add(this);
-      return;
-    }
-
-    lock(this) {
-      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          NDalicPINVOKE.delete_StyleChangedSignal(swigCPtr);
-        }
-        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-      }
-      global::System.GC.SuppressFinalize(this);
-    }
-  }
-%}
-%enddef
-
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TAPGESTURESIGNAL( NameSpace, ClassName )
+%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STRINGVALUEPAIR( NameSpace, ClassName )
 %typemap(csfinalize) NameSpace::ClassName %{
-  ~TapGestureDetectedSignal() {
+  ~StringValuePair() {
     DisposeQueue.Instance.Add(this);
   }
 %}
 %enddef
 
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TAPGESTURESIGNAL( NameSpace, ClassName )
+%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STRINGVALUEPAIR( NameSpace, ClassName )
 %typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
     if (!Stage.IsInstalled()) {
       DisposeQueue.Instance.Add(this);
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwn) {
           swigCMemOwn = false;
-          NDalicPINVOKE.delete_TapGestureDetectedSignal(swigCPtr);
+          NDalicPINVOKE.delete_StringValuePair(swigCPtr);
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
 %}
 %enddef
 
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TEXTFIELDSIGNAL( NameSpace, ClassName )
+%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_BOOLSIGNAL( NameSpace, ClassName )
 %typemap(csfinalize) NameSpace::ClassName %{
-  ~TextFieldSignal() {
+  ~BoolSignal() {
     DisposeQueue.Instance.Add(this);
   }
 %}
 %enddef
 
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TEXTFIELDSIGNAL( NameSpace, ClassName )
+%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_BOOLSIGNAL( NameSpace, ClassName )
 %typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
     if (!Stage.IsInstalled()) {
       DisposeQueue.Instance.Add(this);
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwn) {
           swigCMemOwn = false;
-          NDalicPINVOKE.delete_TextFieldSignal(swigCPtr);
+          NDalicPINVOKE.delete_BoolSignal(swigCPtr);
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
 %}
 %enddef
 
-%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TEXTEDITORSIGNAL( NameSpace, ClassName )
+%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TIMERSIGNALTYPE( NameSpace, ClassName )
 %typemap(csfinalize) NameSpace::ClassName %{
-  ~TextEditorSignal() {
+  ~TimerSignalType() {
     DisposeQueue.Instance.Add(this);
   }
 %}
 %enddef
 
-%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TEXTEDITORSIGNAL( NameSpace, ClassName )
+%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TIMERSIGNALTYPE( NameSpace, ClassName )
 %typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{
     if (!Stage.IsInstalled()) {
       DisposeQueue.Instance.Add(this);
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwn) {
           swigCMemOwn = false;
-          NDalicPINVOKE.delete_TextEditorSignal(swigCPtr);
+          NDalicPINVOKE.delete_TimerSignalType(swigCPtr);
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
@@ -1444,45 +458,41 @@ DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali::Toolkit, VideoView );
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali::Toolkit, VisualFactory );
 DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali::Toolkit, VisualFactory );
 
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_APPLICATIONSIGNAL( Dali, Signal<void(Dali::Application&)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_APPLICATIONSIGNAL( Dali, Signal<void(Dali::Application&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_APPLICATIONCONTROLSIGNAL( Dali, Signal<void(Dali::Application&, void*)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_APPLICATIONCONTROLSIGNAL( Dali, Signal<void(Dali::Application&, void*)>);
-
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VIDEOVIEWSIGNAL( Dali, Signal<void(Dali::Toolkit::VideoView&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VIDEOVIEWSIGNAL( Dali, Signal<void(Dali::Toolkit::VideoView&)>);
-
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_IMAGESIGNAL( Dali, Signal<void(Dali::Image)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_IMAGESIGNAL( Dali, Signal<void(Dali::Image)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RESOURCESIMAGESIGNAL( Dali, Signal<void(Dali::ResourceImage)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RESOURCESIMAGESIGNAL( Dali, Signal<void(Dali::ResourceImage)>);
-
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTINT( Dali, Rect<int>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTINT( Dali, Rect<int>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTDOUBLE( Dali, Rect<double>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTDOUBLE( Dali, Rect<double>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTFLOAT( Dali, Rect<float>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTFLOAT( Dali, Rect<float>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RECTUNSIGNEDINT( Dali, Rect<unsigned int>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RECTUNSIGNEDINT( Dali, Rect<unsigned int>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TOUCHCONTAINER( std, vector<Dali::TouchPoint>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TOUCHCONTAINER( std, vector<Dali::TouchPoint>);
-
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORINT( Dali, Vector<int>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORINT( Dali, Vector<int>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORFLOAT( Dali, Vector<float>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORFLOAT( Dali, Vector<float>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORUNSIGNEDCHAR( Dali, Vector<unsigned char>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORUNSIGNEDCHAR( Dali, Vector<unsigned char>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VECTORUINT16PAIR( Dali, Vector<Dali::Uint16Pair>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_VECTORUINT16PAIR( Dali, Vector<Dali::Uint16Pair>);
-
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACCESSIBILITYACTIONSIGNAL( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYACTIONSIGNAL( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACCESSIBILITYACTIONSCROLLSIGNAL( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&, const Dali::TouchEvent&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYACTIONSCROLLSIGNAL( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&, const Dali::TouchEvent&)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACCESSIBILITYFOCUSSIGNAL( Dali, Signal<void(Dali::Actor, Dali::Toolkit::AccessibilityManager::FocusOvershotDirection)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYFOCUSSIGNAL( Dali, Signal<void(Dali::Actor, Dali::Toolkit::AccessibilityManager::FocusOvershotDirection)>);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Application&)>, ApplicationSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Application&)>, ApplicationSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Application&, void*)>, ApplicationControlSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Application&, void*)>, ApplicationControlSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::VideoView&)>, VideoViewSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::VideoView&)>, VideoViewSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Image)>, ImageSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Image)>, ImageSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::ResourceImage)>, ResourceImageSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::ResourceImage)>, ResourceImageSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Rect<int>, Rectangle);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Rect<int>, Rectangle);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Rect<float>, PaddingType);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Rect<float>, PaddingType);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( std, vector<Dali::TouchPoint>, TouchPointContainer);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( std, vector<Dali::TouchPoint>, TouchPointContainer);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Vector<int>, VectorInteger);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Vector<int>, VectorInteger);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Vector<float>, VectorFloat);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Vector<float>, VectorFloat);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Vector<unsigned char>, VectorUnsignedChar);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Vector<unsigned char>, VectorUnsignedChar);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Vector<Dali::Uint16Pair>, VectorUint16Pair);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Vector<Dali::Uint16Pair>, VectorUint16Pair);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&)>, AccessibilityActionSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&)>, AccessibilityActionSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&, const Dali::TouchEvent&)>, AccessibilityActionScrollSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::AccessibilityManager&, const Dali::TouchEvent&)>, AccessibilityActionScrollSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Actor, Dali::Toolkit::AccessibilityManager::FocusOvershotDirection)>, AccessibilityFocusOvershotSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Actor, Dali::Toolkit::AccessibilityManager::FocusOvershotDirection)>, AccessibilityFocusOvershotSignal);
 //DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STRINGVALUEPAIR( Dali, pair<std::string, Dali::Property::Value>);
 //DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STRINGVALUEPAIR( Dali, pair<std::string, Dali::Property::Value>);
 //DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_BOOLSIGNAL( Dali, Signal<bool()>);
@@ -1490,51 +500,144 @@ DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACCESSIBILITYFOCUSSIGNAL( Dali, Signal<void(
 //DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TIMERSIGNALTYPE( Dali, Signal<bool()>);
 //DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TIMERSIGNALTYPE( Dali, Signal<bool()>);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ACTOR( Dali, Signal<void (Dali::Actor)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ACTOR( Dali, Signal<void (Dali::Actor)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor)>, ActorSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor)>, ActorSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Animation&)>, AnimationSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Animation&)>, AnimationSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Button)>, ButtonSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Button)>, ButtonSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::PageTurnView, unsigned int, bool)>, PageTurnSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::PageTurnView, unsigned int, bool)>, PageTurnSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::PageTurnView)>, PagePanSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::PageTurnView)>, PagePanSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::PanGesture&)>, PanGestureDetectedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::PanGesture&)>, PanGestureDetectedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::PinchGesture&)>, PinchGestureDetectedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::PinchGesture&)>, PinchGestureDetectedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::RenderTask&)>, RenderTaskSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::RenderTask&)>, RenderTaskSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal< void(const Dali::Vector2&)>, ScrollableSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal< void(const Dali::Vector2&)>, ScrollableSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal< void(const Dali::Toolkit::ScrollView::SnapEvent&)>, ScrollViewSnapStartedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal< void(const Dali::Toolkit::ScrollView::SnapEvent&)>, ScrollViewSnapStartedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Slider, float)>, SliderValueChangedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Slider, float)>, SliderValueChangedSignal);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Slider, int)>, SliderMarkReachedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Slider, int)>, SliderMarkReachedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (const Dali::WheelEvent&)>, StageWheelSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (const Dali::WheelEvent&)>, StageWheelSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::StyleManager, Dali::StyleChange::Type)>, StyleChangedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::StyleManager, Dali::StyleChange::Type)>,StyleChangedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::TapGesture&)>, TapGestureDetectedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::TapGesture&)>, TapGestureDetectedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::TextEditor)>, TextEditorSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::TextEditor)>, TextEditorSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::TextField)>, TextFieldSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::TextField)>, TextFieldSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( std, vector<Dali::Actor>, ActorContainer);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( std, vector<Dali::Actor>, ActorContainer);
+
+//DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ITEM( std, pair<unsigned int, Dali::Actor));
+//DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ITEM( std, pair<unsigned int, Dali::Actor>);
+
+//DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ITEMCONTAINER( std, vector<std::pair<unsigned int, Dali::Actor>>);
+//DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ITEMCONTAINER( std, vector<std::pair<unsigned int, Dali::Actor>>);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( std, vector<unsigned int>, ItemIdContainer);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( std, vector<unsigned int>, ItemIdContainer);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Actor, Dali::Actor)>, FocusChangedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Actor, Dali::Actor)>, FocusChangedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Actor, bool)>, FocusGroupChangedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Actor, bool)>, FocusGroupChangedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (Dali::Toolkit::GaussianBlurView)>, GaussianBlurViewSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (Dali::Toolkit::GaussianBlurView)>, GaussianBlurViewSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Control, const Dali::KeyEvent&)>, ControlKeySignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool(Dali::Toolkit::Control, const Dali::KeyEvent&)>, ControlKeySignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (const Dali::KeyEvent&)>, KeyEventSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (const Dali::KeyEvent&)>, KeyEventSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::Control)>, KeyInputFocusSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::Control)>, KeyInputFocusSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, IntrusivePtr<Dali::Toolkit::Ruler>, RulerPtr);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, IntrusivePtr<Dali::Toolkit::Ruler>, RulerPtr);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void()>, VoidSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void()>, VoidSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(float)>, FloatSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(float)>, FloatSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(const Dali::RefObject*)>, ObjectDestroyedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(const Dali::RefObject*)>, ObjectDestroyedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::BaseHandle)>, ObjectCreatedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::BaseHandle)>, ObjectCreatedSignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::PropertyNotification&)>, PropertyNotifySignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::PropertyNotification&)>, PropertyNotifySignal);
+
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::LongPressGesture&)>, LongPressGestureDetectedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (Dali::Actor, const Dali::LongPressGesture&)>, LongPressGestureDetectedSignal);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_ANIMATIONSIGNAL( Dali, Signal<void(Dali::Animation&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_ANIMATIONSIGNAL( Dali, Signal<void(Dali::Animation&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool (Dali::Actor, const Dali::HoverEvent&)>, ActorHoverSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool (Dali::Actor, const Dali::HoverEvent&)>, ActorHoverSignal);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_BUTTON( Dali, Signal<bool(Dali::Toolkit::Button)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_BUTTON( Dali, Signal<bool(Dali::Toolkit::Button)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool (Dali::Actor, const Dali::TouchData&)>, ActorTouchDataSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool (Dali::Actor, const Dali::TouchData&)>, ActorTouchDataSignal);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PAGETURNSIGNAL( Dali, Signal<void(Dali::Toolkit::PageTurnView, unsigned int, bool)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PAGETURNSIGNAL( Dali, Signal<void(Dali::Toolkit::PageTurnView, unsigned int, bool)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PAGEVIEWSIGNAL( Dali, Signal<void(Dali::Toolkit::PageTurnView)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PAGEVIEWSIGNAL( Dali, Signal<void(Dali::Toolkit::PageTurnView)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<bool (Dali::Actor, const Dali::WheelEvent&)>, ActorWheelSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<bool (Dali::Actor, const Dali::WheelEvent&)>, ActorWheelSignal);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PANGESTURESIGNAL( Dali, Signal<void (Dali::Actor, const Dali::PanGesture&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PANGESTURESIGNAL( Dali, Signal<void (Dali::Actor, const Dali::PanGesture&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void (const Dali::TouchData&)>, TouchSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (const Dali::TouchData&)>, TouchSignal);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_PINCHGESTURESIGNAL( Dali, Signal<void (Dali::Actor, const Dali::PinchGesture&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_PINCHGESTURESIGNAL( Dali, Signal<void (Dali::Actor, const Dali::PinchGesture&)>);
+//DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, (std::pair< Dali::Radian, Dali::Radian >), AngleThresholdPair);
+//DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, (std::pair< Dali::Radian, Dali::Radian >), AngleThresholdPair);
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENDERTASKSIGNAL( Dali, Signal<void(Dali::RenderTask&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENDERTASKSIGNAL( Dali, Signal<void(Dali::RenderTask&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, ApplicationExtensions );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, ApplicationExtensions );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SCROLLABLESIGNAL( Dali, Signal< void(const Dali::Vector2&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SCROLLABLESIGNAL( Dali, Signal< void(const Dali::Vector2&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, SlotObserver );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, SlotObserver );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SCROLLVIEWSIGNAL( Dali, Signal< void(const Dali::Toolkit::ScrollView::SnapEvent&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SCROLLVIEWSIGNAL( Dali, Signal< void(const Dali::Toolkit::ScrollView::SnapEvent&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, SignalObserver );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, SignalObserver );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SLIDERVALUECHANGEDSIGNAL( Dali, Signal<bool(Dali::Toolkit::Slider, float)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SLIDERVALUECHANGEDSIGNAL( Dali, Signal<bool(Dali::Toolkit::Slider, float)>);
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_SLIDERMARKCHANGEDSIGNAL( Dali, Signal<bool(Dali::Toolkit::Slider, int)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_SLIDERMARKCHANGEDSIGNAL( Dali, Signal<bool(Dali::Toolkit::Slider, int)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, AnimatablePropertyComponentRegistration );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, AnimatablePropertyComponentRegistration );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STAGESIGNAL( Dali, Signal<void (const Dali::WheelEvent&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STAGESIGNAL( Dali, Signal<void (const Dali::WheelEvent&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, AnimatablePropertyRegistration );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, AnimatablePropertyRegistration );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STYLECHANGEDSIGNAL( Dali, Signal<void(Dali::Toolkit::StyleManager, Dali::StyleChange::Type)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_STYLECHANGEDSIGNAL( Dali, Signal<void(Dali::Toolkit::StyleManager, Dali::StyleChange::Type)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali::Toolkit, AsyncImageLoader );
+DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali::Toolkit, AsyncImageLoader );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TAPGESTURESIGNAL( Dali, Signal<void (Dali::Actor, const Dali::TapGesture&)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TAPGESTURESIGNAL( Dali, Signal<void (Dali::Actor, const Dali::TapGesture&)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, ChildPropertyRegistration );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, ChildPropertyRegistration );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TEXTEDITORSIGNAL( Dali, Signal<void(Dali::Toolkit::TextEditor)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TEXTEDITORSIGNAL( Dali, Signal<void(Dali::Toolkit::TextEditor)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali::Toolkit, ClampState2D );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali::Toolkit, ClampState2D );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_TEXTFIELDSIGNAL( Dali, Signal<void(Dali::Toolkit::TextField)>);
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_TEXTFIELDSIGNAL( Dali, Signal<void(Dali::Toolkit::TextField)>);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, DaliException );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, DaliException );
index d2d4e28..aeb8558 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.
@@ -267,7 +267,8 @@ using namespace Dali::Toolkit;
 %include events/pangesture-event.i
 %include events/propertynotification-event.i
 %include events/longpressgesture-event.i
-%include events/rectinteger.i
+%include events/rectangle.i
+%include events/padding.i
 %include events/resourceimage-event.i
 %include events/scrollable-event.i
 %include events/scrollbar-event.i
old mode 100644 (file)
new mode 100755 (executable)
index 38d4c47..4d277de
 %}
 
 %typemap(cscode) Dali::Actor::Property %{
-  public static readonly int BATCH_PARENT = NDalicManualPINVOKE.Actor_Property_BATCH_PARENT_get();
   public static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get();
 %}
 
-%typemap(cscode) Dali::Renderer::Property %{
-  public static readonly int BATCHING_ENABLED = NDalicManualPINVOKE.Renderer_Property_BATCHING_ENABLED_get();
-%}
-
-%typemap(cscode) Dali::Renderer %{
-  public bool BatchingEnabled
-  {
-    get
-    {
-      bool temp = false;
-      GetProperty( Renderer.Property.BATCHING_ENABLED).Get( ref temp );
-      return temp;
-    }
-    set
-    {
-      SetProperty( Renderer.Property.BATCHING_ENABLED, new Dali.Property.Value( value ) );
-    }
-  }
-%}
-
 %typemap(cscode) Dali::Toolkit::Control::Property %{
   public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
+  public static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
+  public static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
 %}
 
 %typemap(cscode) Dali::Toolkit::ItemView::Property %{
index 93f803c..93b5c15 100755 (executable)
        return (IntPtr)swigCPtr;
     }
 
+    public Position CurrentPosition
+    {
+      get
+      {
+        return GetCurrentPosition();
+      }
+    }
+
+    public Size3D CurrentSize
+    {
+      get
+      {
+        return GetCurrentSize();
+      }
+    }
+
     public Actor Parent
     {
       get
       }
     }
 
-    public bool BatchParent
-    {
-      get
-      {
-        bool temp = false;
-        GetProperty( Actor.Property.BATCH_PARENT).Get( ref temp );
-        return temp;
-      }
-      set
-      {
-        SetProperty( Actor.Property.BATCH_PARENT, new Dali.Property.Value( value ) );
-      }
-    }
-
     public int SiblingOrder
     {
       get
diff --git a/plugins/dali-swig/SWIG/events/padding.i b/plugins/dali-swig/SWIG/events/padding.i
new file mode 100644 (file)
index 0000000..0fa03a6
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ *
+ */
+%csmethodmodifiers Dali::Rect<float>::x "private";
+%csmethodmodifiers Dali::Rect<float>::y "private";
+%csmethodmodifiers Dali::Rect<float>::left "private";
+%csmethodmodifiers Dali::Rect<float>::right "private";
+%csmethodmodifiers Dali::Rect<float>::width "private";
+%csmethodmodifiers Dali::Rect<float>::bottom "private";
+%csmethodmodifiers Dali::Rect<float>::height "private";
+%csmethodmodifiers Dali::Rect<float>::top "private";
+%ignore Dali::Rect<float>::IsEmpty;
+%ignore Dali::Rect<float>::Left;
+%ignore Dali::Rect<float>::Right;
+%ignore Dali::Rect<float>::Top;
+%ignore Dali::Rect<float>::Bottom;
+%ignore Dali::Rect<float>::Area;
+%ignore Dali::Rect<float>::Intersects;
+%ignore Dali::Rect<float>::Contains;
+
+%define DALI_PADDINGTYPE_PROPERTY_PARAM(NameSpace,ClassName)
+  %typemap(cscode) NameSpace::ClassName %{
+    public static bool operator ==(PaddingType a, PaddingType b)
+    {
+        // If both are null, or both are same instance, return true.
+        if (System.Object.ReferenceEquals(a, b))
+        {
+            return true;
+        }
+
+        // If one is null, but not both, return false.
+        if (((object)a == null) || ((object)b == null))
+        {
+            return false;
+        }
+
+        // Return true if the fields match:
+        return ( System.Math.Abs( a.Left - b.Left ) < NDalic.GetRangedEpsilon(a.Left, b.Left) )&&
+               ( System.Math.Abs( a.Right - b.Right ) < NDalic.GetRangedEpsilon(a.Right, b.Right) )&&
+               ( System.Math.Abs( a.Bottom - b.Bottom ) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom) )&&
+               ( System.Math.Abs( a.Top - b.Top ) < NDalic.GetRangedEpsilon(a.Top, b.Top) );
+    }
+
+    public static bool operator !=(PaddingType a, PaddingType b)
+    {
+        return !(a == b);
+    }
+
+    ///< The Left value
+    public float Left
+    {
+        set
+        {
+            left = value;
+        }
+        get
+        {
+            return left;
+        }
+    }
+
+    ///< The Right value
+    public float Right
+    {
+        set
+        {
+            right = value;
+        }
+        get
+        {
+            return right;
+        }
+    }
+
+    ///< The Bottom value
+    public float Bottom
+    {
+        set
+        {
+            bottom = value;
+        }
+        get
+        {
+            return bottom;
+        }
+    }
+
+    ///< The Top value
+    public float Top
+    {
+        set
+        {
+            top = value;
+        }
+        get
+        {
+            return top;
+        }
+    }
+
+%}
+
+%enddef
+
+namespace Dali
+{
+  DALI_PADDINGTYPE_PROPERTY_PARAM( Dali, Rect<float>);
+}
diff --git a/plugins/dali-swig/SWIG/events/rectangle.i b/plugins/dali-swig/SWIG/events/rectangle.i
new file mode 100644 (file)
index 0000000..b9e9c95
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ *
+ */
+%csmethodmodifiers Dali::Rect<int>::x "private";
+%csmethodmodifiers Dali::Rect<int>::y "private";
+%csmethodmodifiers Dali::Rect<int>::left "private";
+%csmethodmodifiers Dali::Rect<int>::right "private";
+%csmethodmodifiers Dali::Rect<int>::width "private";
+%csmethodmodifiers Dali::Rect<int>::bottom "private";
+%csmethodmodifiers Dali::Rect<int>::height "private";
+%csmethodmodifiers Dali::Rect<int>::top "private";
+
+%define DALI_RECTANGLE_PROPERTY_PARAM(NameSpace,ClassName)
+  %typemap(cscode) NameSpace::ClassName %{
+    public static bool operator ==(Rectangle a, Rectangle b)
+    {
+        // If both are null, or both are same instance, return true.
+        if (System.Object.ReferenceEquals(a, b))
+        {
+            return true;
+        }
+
+        // If one is null, but not both, return false.
+        if (((object)a == null) || ((object)b == null))
+        {
+            return false;
+        }
+
+        // Return true if the fields match:
+        return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height;
+    }
+
+    public static bool operator !=(Rectangle a, Rectangle b)
+    {
+        return !(a == b);
+    }
+
+    ///< X position of the rectangle
+    public int X
+    {
+        set
+        {
+            x = value;
+        }
+        get
+        {
+            return x;
+        }
+    }
+
+    ///< Y position of the rectangle
+    public int Y
+    {
+        set
+        {
+            y = value;
+        }
+        get
+        {
+            return y;
+        }
+    }
+
+    ///< Width of the rectangle
+    public int Width
+    {
+        set
+        {
+            width = value;
+        }
+        get
+        {
+            return width;
+        }
+    }
+
+    ///< Height of the rectangle
+    public int Height
+    {
+        set
+        {
+            height = value;
+        }
+        get
+        {
+            return height;
+        }
+    }
+%}
+
+%enddef
+
+namespace Dali
+{
+  DALI_RECTANGLE_PROPERTY_PARAM( Dali, Rect<int>);
+}
diff --git a/plugins/dali-swig/SWIG/events/rectinteger.i b/plugins/dali-swig/SWIG/events/rectinteger.i
deleted file mode 100644 (file)
index b89d1f5..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-%define DALI_RECTINTEGER_PROPERTY_PARAM(NameSpace,ClassName)
-  %typemap(cscode) NameSpace::ClassName %{
-
-  public int X {
-    set {
-      NDalicPINVOKE.RectInteger_x_set(swigCPtr, value);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    }
-    get {
-      int ret = NDalicPINVOKE.RectInteger_x_get(swigCPtr);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    }
-  }
-
-  public int Y {
-    set {
-      NDalicPINVOKE.RectInteger_y_set(swigCPtr, value);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    }
-    get {
-      int ret = NDalicPINVOKE.RectInteger_y_get(swigCPtr);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    }
-  }
-
-  public int W {
-    set {
-      NDalicPINVOKE.RectInteger_width_set(swigCPtr, value);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    }
-    get {
-      int ret = NDalicPINVOKE.RectInteger_width_get(swigCPtr);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    }
-  }
-
-  public int H {
-    set {
-      NDalicPINVOKE.RectInteger_height_set(swigCPtr, value);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-    }
-    get {
-      int ret = NDalicPINVOKE.RectInteger_height_get(swigCPtr);
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    }
-  }
-
-%}
-
-%enddef
-
-namespace Dali
-{
-  DALI_RECTINTEGER_PROPERTY_PARAM( Dali, Rect<int>);
-}
index ff1e87e..0ddd6f1 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.
@@ -283,7 +283,7 @@ namespace MyCSharpExample
           text.MultiLine = true;
           text.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
           text.SetResizePolicy(ResizePolicyType.DIMENSION_DEPENDENCY, DimensionType.HEIGHT);
-          text.SetPadding(new RectFloat(10.0f, 10.0f, 20.0f, 0.0f));
+          text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f));
           _popup.SetContent(text);
           _popup.SetKeyboardFocusable(true);
           _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
index 274b97a..ce7899b 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.
@@ -21,385 +21,412 @@ using Dali;
 
 namespace MyCSharpExample
 {
-  class Example
-  {
-    [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-    delegate void CallbackDelegate(IntPtr appPtr); // void, void delgate
-
-    private Dali.Application _application;
-
-    public Example(Dali.Application application)
-    {
-      _application = application;
-      Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
-
-      _application.Initialized += Initialize;
-      Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
-    }
-
-    public void Initialize(object source, NUIApplicationInitEventArgs e)
-    {
-      OperatorTests();
-
-      CustomViewPropertyTest();
-
-      Handle handle = new Handle();
-      int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
-      float myProperty = 0.0f;
-      handle.GetProperty(myPropertyIndex).Get(ref myProperty);
-      Console.WriteLine( "myProperty value: " + myProperty );
-
-      int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f)), Property.AccessMode.READ_WRITE);
-      Size myProperty2 = new Size(0.0f, 0.0f);
-      handle.GetProperty(myPropertyIndex2).Get(myProperty2);
-      Console.WriteLine( "myProperty2 value: " + myProperty2.W + ", " + myProperty2.H );
-
-      Actor actor = new Actor();
-      actor.Size = new Position(200.0f, 200.0f, 0.0f);
-      actor.Name = "MyActor";
-      actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f);
-      Console.WriteLine("Actor id: {0}", actor.GetId());
-      Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
-      Console.WriteLine("Actor name: " + actor.Name);
-
-      Stage stage = Stage.GetCurrent();
-      stage.BackgroundColor = Color.White;
-
-      Size stageSize = stage.Size;
-      Console.WriteLine("Stage size: " + stageSize.W + ", " + stageSize.H);
-      stage.Add(actor);
-
-      TextLabel text = new TextLabel("Hello Mono World");
-      text.ParentOrigin = NDalic.ParentOriginCenter;
-      text.AnchorPoint = NDalic.AnchorPointCenter;
-      text.HorizontalAlignment = "CENTER";
-      stage.Add(text);
-
-      Console.WriteLine( "Text label text:  " + text.Text );
-
-      Console.WriteLine( "Text label point size:  " + text.PointSize );
-      text.PointSize = 32.0f;
-      Console.WriteLine( "Text label new point size:  " + text.PointSize );
-
-      using (RectInteger ri = new RectInteger(02,05,20,30))
-      {
-        Console.WriteLine( "    Created " + ri );
-        Console.WriteLine( "    IsEmpty() =  " + ri.IsEmpty() );
-        Console.WriteLine( "    Left =  " + ri.Left() );
-        Console.WriteLine( "    Right =  " + ri.Right() );
-        Console.WriteLine( "    Top  = " + ri.Top() );
-        Console.WriteLine( "    Bottom  = " + ri.Bottom() );
-        Console.WriteLine( "    Area  = " + ri.Area() );
-      }
-      Console.WriteLine( " *************************" );
-      using (RectInteger ri2 = new RectInteger(02,05,20,30))
-      {
-        Console.WriteLine( "    Created " + ri2 );
-        ri2.Set(1,1,40,40);
-        Console.WriteLine( "    IsEmpty() =  " + ri2.IsEmpty() );
-        Console.WriteLine( "    Left =  " + ri2.Left() );
-        Console.WriteLine( "    Right =  " + ri2.Right() );
-        Console.WriteLine( "    Top  = " + ri2.Top() );
-        Console.WriteLine( "    Bottom  = " + ri2.Bottom() );
-        Console.WriteLine( "    Area  = " + ri2.Area() );
-      }
-      Console.WriteLine( " *************************" );
-      using (RectDouble rd = new RectDouble(02,05,20.5,30.5))
-      {
-        Console.WriteLine( "    Created " + rd );
-        Console.WriteLine( "    IsEmpty() =  " + rd.IsEmpty() );
-        Console.WriteLine( "    Left =  " + rd.Left() );
-        Console.WriteLine( "    Right =  " + rd.Right() );
-        Console.WriteLine( "    Top  = " + rd.Top() );
-        Console.WriteLine( "    Bottom  = " + rd.Bottom() );
-        Console.WriteLine( "    Area  = " + rd.Area() );
-      }
-      Console.WriteLine( " *************************" );
-      RectDouble rd2 = new RectDouble();
-      rd2.x = 10;
-      rd2.y = 10;
-      rd2.width = 20;
-      rd2.height = 20;
-      Console.WriteLine( "    Created " + rd2 );
-      Console.WriteLine( "    IsEmpty() =  " + rd2.IsEmpty() );
-      Console.WriteLine( "    Left =  " + rd2.Left() );
-      Console.WriteLine( "    Right =  " + rd2.Right() );
-      Console.WriteLine( "    Top  = " + rd2.Top() );
-      Console.WriteLine( "    Bottom  = " + rd2.Bottom() );
-      Console.WriteLine( "    Area  = " + rd2.Area() );
-
-      Console.WriteLine( " *************************" );
-      Size Size = new Size(100, 50);
-      Console.WriteLine( "    Created " + Size );
-      Console.WriteLine( "    Size x =  " + Size.W + ", y = " + Size.H );
-      Size += new Size(20, 20);
-      Console.WriteLine( "    Size x =  " + Size.W + ", y = " + Size.H );
-      Size.W += 10;
-      Size.H += 10;
-      Console.WriteLine( "    Size width =  " + Size.W + ", height = " + Size.H );
-
-      Console.WriteLine( " *************************" );
-      Position Position = new Position(20, 100, 50);
-      Console.WriteLine( "    Created " + Position );
-      Console.WriteLine( "    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
-      Position += new Position(20, 20, 20);
-      Console.WriteLine( "    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
-      Position.X += 10;
-      Position.Y += 10;
-      Position.Z += 10;
-      Console.WriteLine( "    Position width =  " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z );
-      Position parentOrigin = new Dali.Position(NDalic.ParentOriginBottomRight);
-      Console.WriteLine( "    parentOrigin x =  " + parentOrigin.X + ", y = " + parentOrigin.Y + ", z = " + parentOrigin.Z );
-
-      Console.WriteLine( " *************************" );
-      Color color = new Color(20, 100, 50, 200);
-      Console.WriteLine( "    Created " + color );
-      Console.WriteLine( "    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
-      color += new Color(20, 20, 20, 20);
-      Console.WriteLine( "    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
-      color.R += 10;
-      color.G += 10;
-      color.B += 10;
-      color.A += 10;
-      Console.WriteLine( "    Color r =  " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A );
-    }
-
-
-  public void OperatorTests()
-  {
-    Actor actor = new Actor();
-    Actor differentActor = new Actor();
-    Actor actorSame = actor;
-    Actor nullActor = null;
-
-      // test the true operator
-    if ( actor )
-    {
-      Console.WriteLine ("BaseHandle Operator true (actor) : test passed ");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator true (actor): test failed ");
-    }
-
-    Actor parent = actor.GetParent ();
-
-    if ( parent )
-    {
-      Console.WriteLine ("Handle with Empty body  :failed ");
-    }
-    else
-    {
-      Console.WriteLine ("Valid with Empty body  :passed ");
-    }
-
-    actor.Add( differentActor );
-    // here we test two different C# objects, which on the native side have the same body/ ref-object
-    if ( actor == differentActor.GetParent() )
-    {
-       Console.WriteLine ("actor == differentActor.GetParent() :passed ");
-    }
-    else
-    {
-      Console.WriteLine ("actor == differentActor.GetParent() :failed ");
-    }
-
-    if ( differentActor == differentActor.GetParent() )
-    {
-       Console.WriteLine ("differentActor == differentActor.GetParent() :failed ");
-    }
-    else
-    {
-      Console.WriteLine ("differentActor == differentActor.GetParent() :passed ");
-    }
-
-
-    if ( nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator true (nullActor) : test failed ");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator true (nullActor): test passed ");
-    }
-
-    // ! operator
-    if ( !actor )
-    {
-      Console.WriteLine ("BaseHandle Operator !(actor) : test failed ");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator !(actor): test passed ");
-    }
-
-    if ( !nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator !(nullActor) : test passed ");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator !(nullActor): test failed ");
-    }
-
-    // Note: operator false only used inside & operator
-    // test equality operator ==
-    if ( actor == actorSame )
-    {
-      Console.WriteLine ("BaseHandle Operator  (actor == actorSame) : test passed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator  (actor == actorSame) : test failed");
-    }
-
-    if ( actor == differentActor )
+    class Example
     {
-      Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test failed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test passed");
-    }
-
-    if ( actor == nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test failed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test passed");
-    }
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        delegate void CallbackDelegate(IntPtr appPtr); // void, void delgate
 
-    if ( nullActor == nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test passed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test failed");
-    }
-
-    // test || operator
-    if ( actor || actorSame )
-    {
-      Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test passed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test failed");
-    }
-
-    if ( actor || nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test passed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test failed");
-    }
-
-    if ( nullActor || nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test failed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test passed");
-    }
+        private Dali.Application _application;
 
+        public Example(Dali.Application application)
+        {
+            _application = application;
+            Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
 
-    // test && operator
-    if ( actor && actorSame )
-    {
-      Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test passed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test failed");
-    }
-
-    if ( actor && nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test failed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test passed");
-    }
-
-    if ( nullActor && nullActor )
-    {
-      Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test failed");
-    }
-    else
-    {
-      Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test passed");
-    }
-
-  }
+            _application.Initialized += Initialize;
+            Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
+        }
 
-    public void CustomViewPropertyTest()
-    {
-        // Create a Spin control
-        Spin spin = new Spin();
-
-        // 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) );
-        spin.Background = background;
-
-        background = spin.Background;
-        Vector4 backgroundColor = new Vector4();
-        background.Find(Dali.Constants.ColorVisualProperty.MixColor).Get(backgroundColor);
-        if( backgroundColor == Color.Red )
+        public void Initialize(object source, NUIApplicationInitEventArgs e)
         {
-            Console.WriteLine ("Custom View Background property : test passed");
+            OperatorTests();
+
+            CustomViewPropertyTest();
+
+            Handle handle = new Handle();
+            int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
+            float myProperty = 0.0f;
+            handle.GetProperty(myPropertyIndex).Get(ref myProperty);
+            Console.WriteLine( "myProperty value: " + myProperty );
+
+            int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f)), Property.AccessMode.READ_WRITE);
+            Size myProperty2 = new Size(0.0f, 0.0f);
+            handle.GetProperty(myPropertyIndex2).Get(myProperty2);
+            Console.WriteLine( "myProperty2 value: " + myProperty2.W + ", " + myProperty2.H );
+
+            Actor actor = new Actor();
+            actor.Size = new Position(200.0f, 200.0f, 0.0f);
+            actor.Name = "MyActor";
+            actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f);
+            Console.WriteLine("Actor id: {0}", actor.GetId());
+            Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
+            Console.WriteLine("Actor name: " + actor.Name);
+
+            Stage stage = Stage.GetCurrent();
+            stage.BackgroundColor = Color.White;
+            Size stageSize = stage.Size;
+            Console.WriteLine("Stage size: " + stageSize.W + ", " + stageSize.H);
+            stage.Add(actor);
+
+            TextLabel text = new TextLabel("Hello Mono World");
+            text.ParentOrigin = NDalic.ParentOriginCenter;
+            text.AnchorPoint = NDalic.AnchorPointCenter;
+            text.HorizontalAlignment = "CENTER";
+            stage.Add(text);
+
+            Console.WriteLine( "Text label text:  " + text.Text );
+
+            Console.WriteLine( "Text label point size:  " + text.PointSize );
+            text.PointSize = 32.0f;
+            Console.WriteLine( "Text label new point size:  " + text.PointSize );
+
+            RectanglePaddingClassTest();
+
+            Console.WriteLine( " *************************" );
+            Size Size = new Size(100, 50);
+            Console.WriteLine( "    Created " + Size );
+            Console.WriteLine( "    Size x =  " + Size.W + ", y = " + Size.H );
+            Size += new Size(20, 20);
+            Console.WriteLine( "    Size x =  " + Size.W + ", y = " + Size.H );
+            Size.W += 10;
+            Size.H += 10;
+            Console.WriteLine( "    Size width =  " + Size.W + ", height = " + Size.H );
+
+            Console.WriteLine( " *************************" );
+            Position Position = new Position(20, 100, 50);
+            Console.WriteLine( "    Created " + Position );
+            Console.WriteLine( "    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
+            Position += new Position(20, 20, 20);
+            Console.WriteLine( "    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
+            Position.X += 10;
+            Position.Y += 10;
+            Position.Z += 10;
+            Console.WriteLine( "    Position width =  " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z );
+            Position parentOrigin = new Dali.Position(NDalic.ParentOriginBottomRight);
+            Console.WriteLine( "    parentOrigin x =  " + parentOrigin.X + ", y = " + parentOrigin.Y + ", z = " + parentOrigin.Z );
+
+            Console.WriteLine( " *************************" );
+            Color color = new Color(20, 100, 50, 200);
+            Console.WriteLine( "    Created " + color );
+            Console.WriteLine( "    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
+            color += new Color(20, 20, 20, 20);
+            Console.WriteLine( "    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
+            color.R += 10;
+            color.G += 10;
+            color.B += 10;
+            color.A += 10;
+            Console.WriteLine( "    Color r =  " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A );
         }
-        else
+
+        public void RectanglePaddingClassTest()
         {
-            Console.WriteLine ("Custom View Background property : test failed");
+            using (Rectangle r1 = new Rectangle(2, 5, 20, 30))
+            {
+                Console.WriteLine( "    Created " + r1 );
+                Console.WriteLine( "    IsEmpty() =  " + r1.IsEmpty() );
+                Console.WriteLine( "    Left =  " + r1.Left() );
+                Console.WriteLine( "    Right =  " + r1.Right() );
+                Console.WriteLine( "    Top  = " + r1.Top() );
+                Console.WriteLine( "    Bottom  = " + r1.Bottom() );
+                Console.WriteLine( "    Area  = " + r1.Area() );
+            }
+
+            Console.WriteLine( " *************************" );
+
+            using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
+            {
+                Console.WriteLine( "    Created " + r2 );
+                r2.Set(1,1,40,40);
+                Console.WriteLine( "    IsEmpty() =  " + r2.IsEmpty() );
+                Console.WriteLine( "    Left =  " + r2.Left() );
+                Console.WriteLine( "    Right =  " + r2.Right() );
+                Console.WriteLine( "    Top  = " + r2.Top() );
+                Console.WriteLine( "    Bottom  = " + r2.Bottom() );
+                Console.WriteLine( "    Area  = " + r2.Area() );
+            }
+
+            Console.WriteLine( " *************************" );
+
+            Rectangle r3 = new Rectangle(10, 10, 20, 20);
+            Rectangle r4 = new Rectangle(10, 10, 20, 20);
+
+            if (r3 == r4)
+            {
+                Console.WriteLine("r3 == r4");
+            }
+            else
+            {
+                Console.WriteLine("r3 != r4");
+            }
+
+            r4 = new Rectangle(12, 10, 20, 20);
+
+            if (r3 == r4)
+            {
+                Console.WriteLine("r3 == r4");
+            }
+            else
+            {
+                Console.WriteLine("r3 != r4");
+            }
+
+            PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
+            PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
+
+            if (p1 == p2)
+            {
+                Console.WriteLine("p1 == p2");
+            }
+            else
+            {
+                Console.WriteLine("p1 != p2");
+            }
+
+            p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f);
+
+            if (p1 == p2)
+            {
+                Console.WriteLine("p1 == p2");
+            }
+            else
+            {
+                Console.WriteLine("p1 != p2");
+            }
         }
 
-        // BackgroundColor property
-        spin.BackgroundColor = Color.Yellow;
-        if(spin.BackgroundColor == Color.Yellow)
+        public void OperatorTests()
         {
-            Console.WriteLine ("Custom View BackgroundColor property : test passed");
+            Actor actor = new Actor();
+            Actor differentActor = new Actor();
+            Actor actorSame = actor;
+            Actor nullActor = null;
+
+            // test the true operator
+            if ( actor )
+            {
+                Console.WriteLine ("BaseHandle Operator true (actor) : test passed ");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator true (actor): test failed ");
+            }
+
+            Actor parent = actor.GetParent ();
+
+            if ( parent )
+            {
+                Console.WriteLine ("Handle with Empty body  :failed ");
+            }
+            else
+            {
+                Console.WriteLine ("Valid with Empty body  :passed ");
+            }
+
+            actor.Add( differentActor );
+
+            // here we test two different C# objects, which on the native side have the same body/ ref-object
+            if ( actor == differentActor.GetParent() )
+            {
+                Console.WriteLine ("actor == differentActor.GetParent() :passed ");
+            }
+            else
+            {
+                Console.WriteLine ("actor == differentActor.GetParent() :failed ");
+            }
+
+            if ( differentActor == differentActor.GetParent() )
+            {
+                Console.WriteLine ("differentActor == differentActor.GetParent() :failed ");
+            }
+            else
+            {
+                Console.WriteLine ("differentActor == differentActor.GetParent() :passed ");
+            }
+
+            if ( nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator true (nullActor) : test failed ");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator true (nullActor): test passed ");
+            }
+
+            // ! operator
+            if ( !actor )
+            {
+                Console.WriteLine ("BaseHandle Operator !(actor) : test failed ");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator !(actor): test passed ");
+            }
+
+            if ( !nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator !(nullActor) : test passed ");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator !(nullActor): test failed ");
+            }
+
+            // Note: operator false only used inside & operator
+            // test equality operator ==
+            if ( actor == actorSame )
+            {
+                Console.WriteLine ("BaseHandle Operator  (actor == actorSame) : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator  (actor == actorSame) : test failed");
+            }
+
+            if ( actor == differentActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test failed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test passed");
+            }
+
+            if ( actor == nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test failed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test passed");
+            }
+
+            if ( nullActor == nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test failed");
+            }
+
+            // test || operator
+            if ( actor || actorSame )
+            {
+                Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test failed");
+            }
+
+            if ( actor || nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test failed");
+            }
+
+            if ( nullActor || nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test failed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test passed");
+            }
+
+            // test && operator
+            if ( actor && actorSame )
+            {
+                Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test failed");
+            }
+
+            if ( actor && nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test failed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test passed");
+            }
+
+            if ( nullActor && nullActor )
+            {
+                Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test failed");
+            }
+            else
+            {
+                Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test passed");
+            }
         }
-        else
+
+        public void CustomViewPropertyTest()
         {
-            Console.WriteLine ("Custom View BackgroundColor property : test failed");
+            // Create a Spin control
+            Spin spin = new Spin();
+
+            // 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) );
+            spin.Background = background;
+
+            background = spin.Background;
+            Vector4 backgroundColor = new Vector4();
+            background.Find(Dali.Constants.ColorVisualProperty.MixColor).Get(backgroundColor);
+            if( backgroundColor == Color.Red )
+            {
+                Console.WriteLine ("Custom View Background property : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("Custom View Background property : test failed");
+            }
+
+            // BackgroundColor property
+            spin.BackgroundColor = Color.Yellow;
+            if(spin.BackgroundColor == Color.Yellow)
+            {
+                Console.WriteLine ("Custom View BackgroundColor property : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("Custom View BackgroundColor property : test failed");
+            }
+
+            // StyleName property
+            spin.StyleName = "MyCustomStyle";
+            if(spin.StyleName == "MyCustomStyle")
+            {
+                Console.WriteLine ("Custom View StyleName property : test passed");
+            }
+            else
+            {
+                Console.WriteLine ("Custom View StyleName property : test failed");
+            }
         }
 
-        // StyleName property
-        spin.StyleName = "MyCustomStyle";
-        if(spin.StyleName == "MyCustomStyle")
+        public void MainLoop()
         {
-            Console.WriteLine ("Custom View StyleName property : test passed");
+            _application.MainLoop ();
         }
-        else
+
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main(string[] args)
         {
-            Console.WriteLine ("Custom View StyleName property : test failed");
-        }
-    }
+            Console.WriteLine ("Hello Mono World");
 
-    public void MainLoop()
-    {
-      _application.MainLoop ();
+            Example example = new Example(Application.NewApplication());
+            example.MainLoop ();
+        }
     }
-
-    /// <summary>
-    /// The main entry point for the application.
-    /// </summary>
-    [STAThread]
-      static void Main(string[] args)
-      {
-        Console.WriteLine ("Hello Mono World");
-
-        Example example = new Example(Application.NewApplication());
-        example.MainLoop ();
-      }
-  }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 8f8940d..bbadec9
 extern "C" {
 #endif
 
-SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_BATCH_PARENT_get() {
+SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_SIBLING_ORDER_get() {
   int jresult ;
   int result;
 
-  result = (int)Dali::DevelActor::Property::BATCH_PARENT;
+  result = (int)Dali::DevelActor::Property::SIBLING_ORDER;
   jresult = (int)result;
   return jresult;
 }
 
-SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_SIBLING_ORDER_get() {
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_TOOLTIP_get() {
   int jresult ;
   int result;
 
-  result = (int)Dali::DevelActor::Property::SIBLING_ORDER;
+  result = (int)Dali::Toolkit::DevelControl::Property::TOOLTIP;
   jresult = (int)result;
   return jresult;
 }
 
-SWIGEXPORT int SWIGSTDCALL CSharp_Renderer_Property_BATCHING_ENABLED_get() {
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_STATE_get() {
   int jresult ;
   int result;
 
-  result = (int)Dali::DevelRenderer::Property::BATCHING_ENABLED;
+  result = (int)Dali::Toolkit::DevelControl::Property::STATE;
   jresult = (int)result;
   return jresult;
 }
 
-SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_TOOLTIP_get() {
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_SUB_STATE_get() {
   int jresult ;
   int result;
 
-  result = (int)Dali::Toolkit::DevelControl::Property::TOOLTIP;
+  result = (int)Dali::Toolkit::DevelControl::Property::SUB_STATE;
   jresult = (int)result;
   return jresult;
 }
index 69f6377..4b5d1f5 100755 (executable)
  */
 using System;
 
-namespace Dali 
+namespace Dali
 {
   namespace Constants
   {
 
-    public enum TextureType 
+    public enum TextureType
     {
       Texture2D     = Dali.TextureType.TEXTURE_2D,   ///< One 2D image                            @SINCE_1_1.43
       TextureCube   = Dali.TextureType.TEXTURE_CUBE  ///< Six 2D images arranged in a cube-shape  @SINCE_1_1.43
     }
 
-    public enum ViewMode 
+    public enum ViewMode
     {
       Mono              = Dali.ViewMode.MONO,                          ///< Monoscopic (single camera). This is the default @SINCE_1_0.0
       StereoHorizontal  = Dali.ViewMode.STEREO_HORIZONTAL, ///< Stereoscopic. Frame buffer is split horizontally with the left and right camera views in their respective sides. @SINCE_1_0.0
@@ -161,7 +161,6 @@ namespace Dali
       public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT;
       public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING;
       public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY;
-      public static readonly int BatchingEnabled = NDalic.IMAGE_VISUAL_BATCHING_ENABLED;
       public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA;
       public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U;
       public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V;
index 6d7f471..82c2f2f 100755 (executable)
@@ -187,18 +187,18 @@ namespace Dali
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_MakeCallback")]
         public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
 
-        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_BATCH_PARENT_get")]
-        public static extern int Actor_Property_BATCH_PARENT_get();
-
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_SIBLING_ORDER_get")]
         public static extern int Actor_Property_SIBLING_ORDER_get();
 
-        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Renderer_Property_BATCHING_ENABLED_get")]
-        public static extern int Renderer_Property_BATCHING_ENABLED_get();
-
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_TOOLTIP_get")]
         public static extern int View_Property_TOOLTIP_get();
 
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_STATE_get")]
+        public static extern int View_Property_STATE_get();
+
+        [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_ItemView_Property_LAYOUT_get")]
         public static extern int ItemView_Property_LAYOUT_get();
 
index fe2e91c..9d6ea2d 100755 (executable)
@@ -20,7 +20,7 @@ $typeTable =  [
         ["VECTOR4",     "Vector4",          "",     "Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);"],
         ["MATRIX3",     "Matrix3",          "",     "Matrix3 temp = new Matrix3();"],
         ["MATRIX",      "Matrix",           "",     "Matrix temp = new Matrix();"  ],
-        ["RECTANGLE",   "RectInteger",      "",     "RectInteger temp = new RectInteger(0,0,0,0);"],
+        ["RECTANGLE",   "Rectangle",      "",     "Rectangle temp = new Rectangle(0,0,0,0);"],
         ["ROTATION",    "Quaternion",       "",    "Quaternion temp = new Quaternion();"],
         ["STRING",      "string",           "out",  "string temp;"],
         ["ARRAY",       "Dali.Property.Array",   "",     "Dali.Property.Array temp = new Dali.Property.Array();"],