Merge "Changed to use ImfManager for virtual keyboard APIs" into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 3 Mar 2017 18:03:05 +0000 (10:03 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 3 Mar 2017 18:03:05 +0000 (10:03 -0800)
84 files changed:
automated-tests/resources/fonts/tizen/BreezeColorEmoji.ttf [new file with mode: 0644]
automated-tests/resources/fonts/tizen/TizenColorEmoji.ttf [deleted file]
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Typesetter.cpp
automated-tests/src/dali-toolkit-styling/default-theme.json
automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h
automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp
automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h [new file with mode: 0644]
dali-toolkit/devel-api/file.list
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/dictionary.h
dali-toolkit/internal/builder/style.cpp
dali-toolkit/internal/builder/style.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.h
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
packaging/dali-addon.spec
packaging/dali-toolkit.spec
plugins/dali-swig/SWIG/dali-core.i
plugins/dali-swig/SWIG/dali-gc.i
plugins/dali-swig/SWIG/dali-toolkit.i
plugins/dali-swig/SWIG/dali.i
plugins/dali-swig/SWIG/events/actor-event.i
plugins/dali-swig/SWIG/events/progress-bar-event.i [new file with mode: 0644]
plugins/dali-swig/SWIG/events/timer-event.i
plugins/dali-swig/SWIG/signals.i
plugins/dali-swig/examples/control-dashboard.cs
plugins/dali-swig/examples/date-picker-using-json.cs
plugins/dali-swig/manual/cpp/view-wrapper-impl-wrap.cpp
plugins/dali-swig/manual/cpp/view-wrapper-impl-wrap.h
plugins/dali-swig/manual/csharp/CustomView.cs
plugins/dali-swig/manual/csharp/ViewWrapperImpl.cs
plugins/dali-swig/views/spin.cs

diff --git a/automated-tests/resources/fonts/tizen/BreezeColorEmoji.ttf b/automated-tests/resources/fonts/tizen/BreezeColorEmoji.ttf
new file mode 100644 (file)
index 0000000..2a6b046
Binary files /dev/null and b/automated-tests/resources/fonts/tizen/BreezeColorEmoji.ttf differ
diff --git a/automated-tests/resources/fonts/tizen/TizenColorEmoji.ttf b/automated-tests/resources/fonts/tizen/TizenColorEmoji.ttf
deleted file mode 100644 (file)
index 25234ea..0000000
Binary files a/automated-tests/resources/fonts/tizen/TizenColorEmoji.ttf and /dev/null differ
index eba6b05..3904faa 100644 (file)
@@ -69,7 +69,7 @@ namespace
 {
 
 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-const unsigned int EMOJI_FONT_SIZE = 3968u;
+const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
 const unsigned int NON_DEFAULT_FONT_SIZE = 40u;
 
 struct MergeFontDescriptionsData
@@ -1303,7 +1303,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
   // Load some fonts.
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
-  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf", EMOJI_FONT_SIZE );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf", pointSize01 );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf", pointSize02 );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf", pointSize01 );
@@ -1311,7 +1311,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
 
   // Font id 1 --> TizenSansArabicRegular.ttf
   // Font id 2 --> TizenSansHebrewRegular.ttf
-  // Font id 3 --> TizenColorEmoji.ttf
+  // Font id 3 --> BreezeColorEmoji.ttf
   // Font id 4 --> TizenSansRegular.ttf, size 8
   // Font id 5 --> TizenSansRegular.ttf, size 16
   // Font id 6 --> TizenSansHebrewRegular.ttf, size 8
@@ -1484,8 +1484,8 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       0u,
       4u
     },
-    const_cast<char*>( "TizenColorEmoji" ),
-    15u,
+    const_cast<char*>( "BreezeColorEmoji" ),
+    16u,
     TextAbstraction::FontWeight::NORMAL,
     TextAbstraction::FontWidth::NORMAL,
     TextAbstraction::FontSlant::NORMAL,
@@ -1699,7 +1699,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
     {
       "Emojis",
       "\xF0\x9F\x98\x81\xF0\x9F\x98\x82\xF0\x9F\x98\x83\xF0\x9F\x98\x84",
-      "/tizen/TizenColorEmoji.ttf",
+      "/tizen/BreezeColorEmoji.ttf",
       EMOJI_FONT_SIZE,
       0u,
       4u,
index 63f9a22..e742a9e 100644 (file)
@@ -35,7 +35,7 @@ using namespace Text;
 namespace
 {
 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-const PointSize26Dot6 EMOJI_FONT_SIZE = 62u * 64u;
+const PointSize26Dot6 EMOJI_FONT_SIZE = 3840u; // 60 * 64
 } // namespace
 
 int UtcDaliTextTypesetter(void)
@@ -86,7 +86,7 @@ int UtcDaliTextRenderingControllerRender(void)
   const std::string pathName( pathNamePtr );
   free( pathNamePtr );
 
-  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf", EMOJI_FONT_SIZE );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
 
   // Creates a text controller.
@@ -97,7 +97,7 @@ int UtcDaliTextRenderingControllerRender(void)
 
   // Sets the text.
   controller->SetMarkupProcessorEnabled( true );
-  controller->SetText( "<font family='TizenSansRegular'>Hello world </font><font family='TizenColorEmoji'>\xF0\x9F\x98\x81</font>" );
+  controller->SetText( "<font family='TizenSansRegular'>Hello world </font><font family='BreezeColorEmoji'>\xF0\x9F\x98\x81</font>" );
 
   // Creates the text's model and relais-out the text.
   const Size relayoutSize( 120.f, 60.f );
index aea0422..4f9fb77 100644 (file)
             {
               "visuals":
               {
-                "foregroundVisual":
+                "testVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"0001.png"
+                },
+                "testVisual2":
                 {
                   "visualType":"GRADIENT",
                   "startPosition": [-1, -1],
                   "spreadMethod": "REPEAT",
                   "stopOffset": [0.2, 0.8],
                   "stopColor": [ [ 1,0,0,1], [0,1,0,1] ]
+                },
+                "foregroundVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"theSameImage.png"
+                },
+                "labelVisual":
+                {
+                  "visualType":"TEXT",
+                  "pointSize":8,
+                  "text":"Some text"
                 }
               }
             },
             {
               "visuals":
               {
-                "foregroundVisual":
+                "testVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"0002.png"
+                },
+                "testVisual2":
                 {
                   "visualType":"COLOR",
                   "mixColor": [ 1,0,0,1]
+                },
+                "foregroundVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"theSameImage.png"
+                },
+                "labelVisual":
+                {
+                  "visualType":"TEXT",
+                  "pointSize":8,
+                  "text":"Some different text"
                 }
               }
             }
             },
             "focusVisual":
             {
-              "visualType":"IMAGE",
-              "url": "focus.png"
+              "visualType":"NPATCH",
+              "url": "focus.9.png"
             }
           },
           "entryTransition":
         },
         "DISABLED":
         {
+          "states":
+          {
+            "SELECTED":
+            {
+              "visuals":
+              {
+                "testVisual":
+                {
+                  "visualType":"IMAGE",
+                  "url":"0001.png"
+                },
+                "testVisual2":
+                {
+                  "visualType":"GRADIENT",
+                  "startPosition": [-1, -1],
+                  "endPosition": [1, 1],
+                  "spreadMethod": "REPEAT",
+                  "stopOffset": [0.2, 0.8],
+                  "stopColor": [ [ 1,0,0,1], [0,1,0,1] ]
+                }
+              }
+            }
+          },
           "visuals":
           {
             "foregroundVisual":
               "spreadMethod": "REPEAT",
               "stopOffset": [0.2, 0.8],
               "stopColor": [ [ 1,0,0,1], [0,1,0,1] ]
+            },
+            "labelVisual":
+            {
+              "visualType":"TEXT",
+              "pointSize":8,
+              "textColor":[1,0,1,1]
             }
           }
         },
               "stopOffset": [0.3, 0.9],
               "stopColor": [ [ 0,0,1,1], [0,1,1,1] ]
             },
+            "labelVisual":
+            {
+              "visualType":"TEXT",
+              "pointSize":10
+            },
             "focusVisual":
             {
               "visualType":"IMAGE",
             {
               "visualType":"COLOR",
               "mixColor": [1,0,0,1]
+            },
+            "labelVisual":
+            {
+              "visualType":"TEXT",
+              "pointSize":9,
+              "textColor":[1,1,1,1]
             }
           }
         }
           }
         }
       ]
+    },
+    "NoStateStyle":
+    {
+      "testVisual2":
+      {
+        "visualType":"COLOR",
+        "mixColor":[1,1,1,1]
+      }
     }
   }
 }
index 34f604a..6a81e06 100644 (file)
@@ -29,6 +29,8 @@
 #include <toolkit-style-monitor.h>
 #include <dummy-control.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 
 using namespace Dali;
@@ -56,6 +58,54 @@ void dali_style_manager_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+
+Visual::Base CheckVisual( Impl::DummyControl& dummyImpl, Property::Index visualId, int type, const char* location )
+{
+    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(visualId), true, location);
+    Visual::Base visual = dummyImpl.GetVisual(visualId);
+    DALI_TEST_EQUALS( (bool)visual, true, location );
+    Property::Map map;
+    visual.CreatePropertyMap( map );
+    Property::Value* value = map.Find( Visual::Property::TYPE );
+    DALI_TEST_EQUALS( value != NULL, true, location );
+
+    int visualType;
+    value->Get( visualType );
+    DALI_TEST_EQUALS( visualType, type, location );
+    return visual;
+}
+
+
+Integration::Bitmap* CreateBitmap( unsigned int imageWidth, unsigned int imageHeight, unsigned int initialColor, Pixel::Format pixelFormat )
+{
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
+  Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
+  unsigned int bytesPerPixel = GetBytesPerPixel( pixelFormat );
+
+  memset( pixbuffer, initialColor, imageHeight * imageWidth * bytesPerPixel );
+
+  return bitmap;
+}
+
+Integration::ResourcePointer CustomizeNinePatch( TestApplication& application,
+                                                 unsigned int ninePatchImageWidth,
+                                                 unsigned int ninePatchImageHeight)
+{
+  TestPlatformAbstraction& platform = application.GetPlatform();
+
+  Pixel::Format pixelFormat = Pixel::RGBA8888;
+
+  tet_infoline("Create Bitmap");
+  platform.SetClosestImageSize(Vector2( ninePatchImageWidth, ninePatchImageHeight));
+  Integration::Bitmap* bitmap = CreateBitmap( ninePatchImageWidth, ninePatchImageHeight, 0xFF, pixelFormat );
+
+  tet_infoline("Getting resource");
+  Integration::ResourcePointer resourcePtr(bitmap);
+  platform.SetSynchronouslyLoadedResource( resourcePtr);
+
+  return resourcePtr;
+}
+
 int UtcDaliStyleManagerConstructorP(void)
 {
   ToolkitTestApplication application;
@@ -884,17 +934,38 @@ int UtcDaliStyleManagerSetState01(void)
   Stage::GetCurrent().Add(actor);
 
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
 
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
   Visual::Base visual1 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+  Visual::Base labelVisual1 = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  Property::Map labelMap;
+  labelVisual1.CreatePropertyMap( labelMap );
+  labelMap[TextVisual::Property::TEXT] = "New text";
+  VisualFactory factory = VisualFactory::Get();
+  labelVisual1 = factory.CreateVisual(labelMap);
+  dummyImpl.UnregisterVisual(DummyControl::Property::LABEL_VISUAL );
+  dummyImpl.RegisterVisual(DummyControl::Property::LABEL_VISUAL, labelVisual1 );
 
   actor.SetProperty( DevelControl::Property::STATE, DevelControl::FOCUSED );
 
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOCUS_VISUAL), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::LABEL_VISUAL), true, TEST_LOCATION);
 
   Visual::Base visual2 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
+  Visual::Base labelVisual2 = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
   DALI_TEST_CHECK( visual1 != visual2 );
+  DALI_TEST_CHECK( labelVisual1 != labelVisual2 );
+  labelMap.Clear();
+  labelVisual2.CreatePropertyMap( labelMap );
+  Property::Value* textValue = labelMap.Find( Toolkit::TextVisual::Property::TEXT, "text");
+  DALI_TEST_CHECK( textValue );
+  Property::Value* pointSizeValue = labelMap.Find( Toolkit::TextVisual::Property::POINT_SIZE, "pointSize");
+  tet_infoline( "Check that the instance data has been copied to the new text visual\n");
+  DALI_TEST_EQUALS( textValue->Get<std::string>(), "New text", TEST_LOCATION );
+  DALI_TEST_EQUALS( pointSizeValue->Get<int>(), 10, TEST_LOCATION );
+
 
   actor.SetProperty( DevelControl::Property::STATE, DevelControl::DISABLED );
 
@@ -908,6 +979,17 @@ int UtcDaliStyleManagerSetState01(void)
   DALI_TEST_CHECK( visual1 != visual3 );
   DALI_TEST_CHECK( visual2 != visual3 );
 
+  Visual::Base labelVisual3 = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  DALI_TEST_CHECK( labelVisual2 != labelVisual3 );
+
+  labelVisual2.CreatePropertyMap( labelMap );
+  textValue = labelMap.Find(Toolkit::TextVisual::Property::TEXT, "text");
+  DALI_TEST_CHECK( textValue );
+  pointSizeValue = labelMap.Find(Toolkit::TextVisual::Property::POINT_SIZE, "pointSize");
+  tet_infoline( "Check that the instance data has been copied to the new text visual\n");
+  DALI_TEST_EQUALS( textValue->Get<std::string>(), "New text", TEST_LOCATION );
+  DALI_TEST_EQUALS( pointSizeValue->Get<int>(), 10, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -928,6 +1010,7 @@ int UtcDaliStyleManagerSetState02(void)
   Stage::GetCurrent().Add(actor);
 
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
 
   int state = actor.GetProperty<int>( DevelControl::Property::STATE );
   DALI_TEST_EQUALS( state, (int) DevelControl::NORMAL, TEST_LOCATION );
@@ -956,9 +1039,16 @@ int UtcDaliStyleManagerSetState02(void)
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
 
   Visual::Base visual3 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-  Visual::Base focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
-  DALI_TEST_CHECK( !focusVisual );
-  DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOCUS_VISUAL), false, TEST_LOCATION);
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  DALI_TEST_CHECK( !testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( !testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL2);
+  DALI_TEST_CHECK( !testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  DALI_TEST_CHECK( testVisual );
+
 
   DALI_TEST_CHECK( visual1 != visual3 );
   DALI_TEST_CHECK( visual2 != visual3 );
@@ -974,7 +1064,7 @@ int UtcDaliStyleManagerSetState02(void)
   visual1 = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
   DALI_TEST_CHECK( visual1 );
 
-  focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  Visual::Base focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
   DALI_TEST_CHECK( !focusVisual );
   DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOCUS_VISUAL), false, TEST_LOCATION);
 
@@ -983,7 +1073,104 @@ int UtcDaliStyleManagerSetState02(void)
 }
 
 
-int UtcDaliStyleManagerSetSubState(void)
+int UtcDaliStyleManagerSetState03N(void)
+{
+  tet_infoline("Instantiate dummy control and test state transition without state style" );
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
+                                          defaultTheme );
+
+  ToolkitTestApplication application;
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  DummyControl actor = DummyControl::New(true);
+  actor.SetStyleName("NoStyles");
+  Stage::GetCurrent().Add(actor);
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  VisualFactory factory = VisualFactory::Get();
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  int state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::NORMAL, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "FOCUSED" ).Add("withTransitions", false));
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::FOCUSED, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "DISABLED" ).Add("withTransitions", false));
+
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::DISABLED, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerSetState04N(void)
+{
+  tet_infoline("Instantiate dummy control and test state transition with style without state" );
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
+                                          defaultTheme );
+
+  ToolkitTestApplication application;
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  DummyControl actor = DummyControl::New(true);
+  actor.SetStyleName("NoStateStyle");
+  Stage::GetCurrent().Add(actor);
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  VisualFactory factory = VisualFactory::Get();
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  int state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::NORMAL, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "FOCUSED" ).Add("withTransitions", false));
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::FOCUSED, TEST_LOCATION );
+
+  actor.SetProperty( DevelControl::Property::STATE,
+                     Property::Map().Add( "state", "DISABLED" ).Add("withTransitions", false));
+
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::TEST_VISUAL);
+  DALI_TEST_CHECK( testVisual = visual );
+
+  state = actor.GetProperty<int>( DevelControl::Property::STATE );
+  DALI_TEST_EQUALS( state, (int) DevelControl::DISABLED, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliStyleManagerSetSubState01(void)
 {
   tet_infoline("Instantiate dummy control and test state/visual/transition capture" );
   Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
@@ -1001,53 +1188,97 @@ int UtcDaliStyleManagerSetSubState(void)
   actor.SetStyleName("ComplexControl");
   Stage::GetCurrent().Add(actor);
 
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
+
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
 
-  {
-    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
-    Visual::Base visual = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-    DALI_TEST_CHECK( visual );
-    Property::Map map;
-    visual.CreatePropertyMap( map );
-    Property::Value* value = map.Find( Visual::Property::TYPE );
-    DALI_TEST_CHECK( value );
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
 
-    int visualType;
-    value->Get( visualType );
-    DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::GRADIENT, TEST_LOCATION );
-  }
+  actor.SetProperty(DevelControl::Property::SUB_STATE, "UNSELECTED");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::COLOR, TEST_LOCATION);
+
+  actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+
+  END_TEST;
+}
+
+
+int UtcDaliStyleManagerSetSubState02(void)
+{
+  tet_infoline("Instantiate complex control and test state/substate change" );
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json",
+                                          defaultTheme );
+
+  ToolkitTestApplication application;
+
+  StyleChangedSignalChecker styleChangedSignalHandler;
+  Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
+  StyleManager styleManager = StyleManager::Get();
+
+  DummyControl actor = DummyControl::New(true);
+  actor.SetProperty(DevelControl::Property::STATE, "NORMAL");
+  actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
+  tet_infoline( "Setting state to NORMAL/SELECTED before re-styling\n");
+
+  actor.SetStyleName("ComplexControl");
+  Stage::GetCurrent().Add(actor);
+
+  Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
+
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
 
   actor.SetProperty(DevelControl::Property::SUB_STATE, "UNSELECTED");
+  tet_infoline( "Changing substate to UNSELECTED - check visual changes\n");
 
-  {
-    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
-    Visual::Base visual = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-    DALI_TEST_CHECK( visual );
-    Property::Map map;
-    visual.CreatePropertyMap( map );
-    Property::Value* value = map.Find( Visual::Property::TYPE );
-    DALI_TEST_CHECK( value );
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::COLOR, TEST_LOCATION);
 
-    int visualType;
-    value->Get( visualType );
-    DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::COLOR, TEST_LOCATION );
-  }
+  actor.SetProperty(DevelControl::Property::STATE, "FOCUSED");
+  tet_infoline( "Changing state to FOCUSED - check visual changes\n");
+
+  Visual::Base fgVisual1 = CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+  Visual::Base focusVisual1 = CheckVisual( dummyImpl, DummyControl::Property::FOCUS_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
 
   actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
+  tet_infoline( "Changing  substate to SELECTED - Expect no change\n");
 
-  {
-    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
-    DALI_TEST_EQUALS(dummyImpl.IsVisualEnabled(DummyControl::Property::FOREGROUND_VISUAL), true, TEST_LOCATION);
-    Visual::Base visual = dummyImpl.GetVisual(DummyControl::Property::FOREGROUND_VISUAL);
-    DALI_TEST_CHECK( visual );
-    Property::Map map;
-    visual.CreatePropertyMap( map );
-    Property::Value* value = map.Find( Visual::Property::TYPE );
-    DALI_TEST_CHECK( value );
+  Visual::Base fgVisual2 = CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+  Visual::Base focusVisual2 = CheckVisual( dummyImpl, DummyControl::Property::FOCUS_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+
+  DALI_TEST_CHECK( fgVisual1 == fgVisual2 );
+  DALI_TEST_CHECK( focusVisual1 == focusVisual2 );
+
+  actor.SetProperty(DevelControl::Property::STATE, "NORMAL");
+  tet_infoline( "Changing state to NORMAL - Expect to change to NORMAL/SELECTED \n");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, Toolkit::Visual::GRADIENT, TEST_LOCATION);
+
+  Visual::Base focusVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  DALI_TEST_CHECK( ! focusVisual );
+
+  actor.SetProperty(DevelControl::Property::STATE, "DISABLED");
+  tet_infoline( "Changing state to DISABLED - Expect to change to DISABLED/SELECTED \n");
+
+  CheckVisual( dummyImpl, DummyControl::Property::FOREGROUND_VISUAL, Toolkit::Visual::COLOR, TEST_LOCATION);
+  CheckVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, Toolkit::Visual::IMAGE, TEST_LOCATION);
+
+  Visual::Base testVisual = dummyImpl.GetVisual(DummyControl::Property::FOCUS_VISUAL);
+  DALI_TEST_CHECK( ! testVisual );
+  testVisual = dummyImpl.GetVisual(DummyControl::Property::LABEL_VISUAL);
+  DALI_TEST_CHECK( ! testVisual );
 
-    int visualType;
-    value->Get( visualType );
-    DALI_TEST_EQUALS( visualType, (int)Toolkit::Visual::GRADIENT, TEST_LOCATION );
-  }
   END_TEST;
 }
index 979e56a..8f70228 100644 (file)
@@ -72,7 +72,7 @@ Dali::PropertyRegistration dummyControlVisualProperty01(
   typeRegistration, "testVisual", Dali::Toolkit::DummyControl::Property::TEST_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
 
 Dali::PropertyRegistration dummyControlVisualProperty02(
-  typeRegistration, "testVisual", Dali::Toolkit::DummyControl::Property::TEST_VISUAL2, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
+  typeRegistration, "testVisual2", Dali::Toolkit::DummyControl::Property::TEST_VISUAL2, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
 
 Dali::PropertyRegistration dummyControlVisualProperty03(
   typeRegistration, "foregroundVisual", Dali::Toolkit::DummyControl::Property::FOREGROUND_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
@@ -80,6 +80,9 @@ Dali::PropertyRegistration dummyControlVisualProperty03(
 Dali::PropertyRegistration dummyControlVisualProperty04(
   typeRegistration, "focusVisual", Dali::Toolkit::DummyControl::Property::FOCUS_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
 
+Dali::PropertyRegistration dummyControlVisualProperty05(
+  typeRegistration, "labelVisual", Dali::Toolkit::DummyControl::Property::LABEL_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
+
 }
 
 DummyControl DummyControlImpl::New()
@@ -125,6 +128,12 @@ void DummyControlImpl::RegisterVisual( Property::Index index, Toolkit::Visual::B
 void DummyControlImpl::UnregisterVisual( Property::Index index )
 {
   Control::UnregisterVisual( index );
+
+  VisualIndices::iterator iter = std::find( mRegisteredVisualIndices.begin(), mRegisteredVisualIndices.end(), index );
+  if( iter != mRegisteredVisualIndices.end() )
+  {
+    mRegisteredVisualIndices.erase(iter);
+  }
 }
 
 Toolkit::Visual::Base DummyControlImpl::GetVisual( Property::Index index )
@@ -142,7 +151,6 @@ bool DummyControlImpl::IsVisualEnabled( Property::Index index )
   return Control::IsVisualEnabled( index );
 }
 
-
 Animation DummyControlImpl::CreateTransition( const Toolkit::TransitionData& transition )
 {
   return Control::CreateTransition( transition );
@@ -159,6 +167,7 @@ void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index in
     case Toolkit::DummyControl::Property::TEST_VISUAL2:
     case Toolkit::DummyControl::Property::FOREGROUND_VISUAL:
     case Toolkit::DummyControl::Property::FOCUS_VISUAL:
+    case Toolkit::DummyControl::Property::LABEL_VISUAL:
     {
       Property::Map* map = value.GetMap();
       if( map != NULL )
index 75d3efe..d4b8b18 100644 (file)
@@ -48,7 +48,8 @@ public:
       TEST_VISUAL = PROPERTY_START_INDEX,
       TEST_VISUAL2,
       FOREGROUND_VISUAL,
-      FOCUS_VISUAL
+      FOCUS_VISUAL,
+      LABEL_VISUAL
     };
   };
 
@@ -92,7 +93,7 @@ public:
   void UnregisterVisual( Property::Index index );
   void EnableVisual( Property::Index index, bool enabled );
   bool IsVisualEnabled( Property::Index index );
-
+  int GetVisualCount();
   Toolkit::Visual::Base GetVisual( Property::Index index );
   Animation CreateTransition( const Toolkit::TransitionData& transition );
 
index 1613bb5..5e71779 100644 (file)
@@ -1135,9 +1135,12 @@ public:
     mTextureTrace.PushCall("TexSubImage2D", out.str(), namedParams);
   }
 
-  inline void Uniform1f(GLint location, GLfloat x)
+  inline void Uniform1f(GLint location, GLfloat value )
   {
-    if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, x ) )
+    std::string params = ToString( value );
+    AddUniformCallToTraceStack( location, params );
+
+    if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, value ) )
     {
       mGetErrorResult = GL_INVALID_OPERATION;
     }
@@ -1145,6 +1148,14 @@ public:
 
   inline void Uniform1fv(GLint location, GLsizei count, const GLfloat* v)
   {
+    std::string params;
+    for( int i = 0; i < count; ++i )
+    {
+      params = params + ToString( v[i] ) + ",";
+    }
+
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, v[i] ) )
@@ -1157,6 +1168,10 @@ public:
 
   inline void Uniform1i(GLint location, GLint x)
   {
+    std::string params = ToString( x );
+
+    AddUniformCallToTraceStack( location,  params );
+
     if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram, location, x ) )
     {
       mGetErrorResult = GL_INVALID_OPERATION;
@@ -1165,6 +1180,9 @@ public:
 
   inline void Uniform1iv(GLint location, GLsizei count, const GLint* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram,
@@ -1179,6 +1197,9 @@ public:
 
   inline void Uniform2f(GLint location, GLfloat x, GLfloat y)
   {
+    std::string params = ToString( x ) + "," + ToString( y );
+    AddUniformCallToTraceStack( location, params );
+
     if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
                                                location,
                                                Vector2( x, y ) ) )
@@ -1189,6 +1210,9 @@ public:
 
   inline void Uniform2fv(GLint location, GLsizei count, const GLfloat* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
@@ -1203,14 +1227,21 @@ public:
 
   inline void Uniform2i(GLint location, GLint x, GLint y)
   {
+    std::string params = ToString( x ) + "," + ToString( y );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void Uniform2iv(GLint location, GLsizei count, const GLint* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
   {
+    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
+    AddUniformCallToTraceStack( location, params );
+
     if( ! mProgramUniforms3f.SetUniformValue( mCurrentProgram,
                                                location,
                                                Vector3( x, y, z ) ) )
@@ -1221,6 +1252,9 @@ public:
 
   inline void Uniform3fv(GLint location, GLsizei count, const GLfloat* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniforms3f.SetUniformValue(
@@ -1236,14 +1270,21 @@ public:
 
   inline void Uniform3i(GLint location, GLint x, GLint y, GLint z)
   {
+    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void Uniform3iv(GLint location, GLsizei count, const GLint* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   {
+    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
+    AddUniformCallToTraceStack( location, params );
+
     if( ! mProgramUniforms4f.SetUniformValue( mCurrentProgram,
                                               location,
                                               Vector4( x, y, z, w ) ) )
@@ -1254,6 +1295,9 @@ public:
 
   inline void Uniform4fv(GLint location, GLsizei count, const GLfloat* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniforms4f.SetUniformValue(
@@ -1269,18 +1313,27 @@ public:
 
   inline void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
   {
+    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void Uniform4iv(GLint location, GLsizei count, const GLint* v)
   {
+    std::string params = ToString( v );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
   {
+    std::string params = ToString( value );
+    AddUniformCallToTraceStack( location, params );
   }
 
   inline void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
   {
+    std::string params = ToString( value );
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniformsMat3.SetUniformValue(
@@ -1296,6 +1349,9 @@ public:
 
   inline void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
   {
+    std::string params = ToString( value );
+    AddUniformCallToTraceStack( location, params );
+
     for( int i = 0; i < count; ++i )
     {
       if( ! mProgramUniformsMat4.SetUniformValue(
@@ -1789,6 +1845,31 @@ public:
   {
   }
 
+private:
+
+  inline void AddUniformCallToTraceStack( GLint location, std::string& value )
+    {
+    std::string name = "<not found>";
+    bool matched = false;
+
+    UniformIDMap& map = mUniforms[mCurrentProgram];
+    for (UniformIDMap::iterator it=map.begin(); it!=map.end(); ++it)
+    {
+      if( it->second == location )
+      {
+        name = it->first;
+        matched = true;
+        break;
+      }
+    }
+
+    if ( matched )
+    {
+      mSetUniformTrace.PushCall( name, value );
+    }
+  }
+
+
 public: // TEST FUNCTIONS
   inline void SetCompileStatus( GLuint value ) { mCompileStatus = value; }
   inline void SetLinkStatus( GLuint value ) { mLinkStatus = value; }
@@ -1859,6 +1940,11 @@ public: // TEST FUNCTIONS
   inline void ResetStencilFunctionCallStack() { mStencilFunctionTrace.Reset(); }
   inline TraceCallStack& GetStencilFunctionTrace() { return mStencilFunctionTrace; }
 
+  //Methods for Uniform function verification
+  inline void EnableSetUniformCallTrace(bool enable) { mSetUniformTrace.Enable(enable); }
+  inline void ResetSetUniformCallStack() { mSetUniformTrace.Reset(); }
+  inline TraceCallStack& GetSetUniformTrace() { return mSetUniformTrace; }
+
   template <typename T>
   inline bool GetUniformValue( const char* name, T& value ) const
   {
@@ -2091,6 +2177,7 @@ private:
   TraceCallStack mDrawTrace;
   TraceCallStack mDepthFunctionTrace;
   TraceCallStack mStencilFunctionTrace;
+  TraceCallStack mSetUniformTrace;
 
   // Shaders & Uniforms
   GLuint mLastShaderIdUsed;
@@ -2178,9 +2265,6 @@ private:
   ProgramUniformValue<Matrix> mProgramUniformsMat4;
   ProgramUniformValue<Matrix3> mProgramUniformsMat3;
 
-
-
-
   inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
   {
     return mProgramUniforms1i;
index 86b5430..b177e4a 100644 (file)
@@ -25,10 +25,6 @@ namespace Dali
 TestPlatformAbstraction::TestPlatformAbstraction()
 : mTrace(),
   mIsLoadingResult( false ),
-  mGetDefaultFontSizeResult( 0 ),
-  mLoadedResourcesQueue(),
-  mFailedLoadQueue(),
-  mResourceRequests(),
   mSize(),
   mClosestSize(),
   mLoadFileResult(),
@@ -40,17 +36,6 @@ TestPlatformAbstraction::TestPlatformAbstraction()
 
 TestPlatformAbstraction::~TestPlatformAbstraction()
 {
-  DiscardRequest();
-}
-
-void TestPlatformAbstraction::Suspend()
-{
-  mTrace.PushCall("Suspend", "");
-}
-
-void TestPlatformAbstraction::Resume()
-{
-  mTrace.PushCall("Resume", "");
 }
 
 ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
@@ -75,16 +60,6 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::Resou
   return closestSize;
 }
 
-void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
-{
-  std::ostringstream out;
-  out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl ;
-
-  mTrace.PushCall("LoadResource", out.str());
-
-  mResourceRequests.PushBack( new Integration::ResourceRequest(request) );
-}
-
 Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath )
 {
   mTrace.PushCall("LoadResourceSynchronously", "");
@@ -97,59 +72,6 @@ Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration:
   return mDecodedBitmap;
 }
 
-void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
-{
-  mTrace.PushCall("CancelLoad", "");
-}
-
-void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
-{
-  mTrace.PushCall("GetResources", "");
-
-  while( !mLoadedResourcesQueue.empty() )
-  {
-    LoadedResource loaded( *mLoadedResourcesQueue.begin() );
-    mLoadedResourcesQueue.erase( mLoadedResourcesQueue.begin() );
-    cache.LoadResponse( loaded.id, loaded.type, loaded.resource, Integration::RESOURCE_COMPLETELY_LOADED );
-  }
-
-  // iterate through the resources which failed to load
-  while( !mFailedLoadQueue.empty() )
-  {
-    FailedLoad failed( *mFailedLoadQueue.begin() );
-    mFailedLoadQueue.erase( mFailedLoadQueue.begin() );
-    cache.LoadFailed( failed.id, failed.failure );
-  }
-}
-
-bool TestPlatformAbstraction::IsLoading()
-{
-  mTrace.PushCall("IsLoading", "");
-  return mIsLoadingResult;
-}
-
-int TestPlatformAbstraction::GetDefaultFontSize() const
-{
-  mTrace.PushCall("GetDefaultFontSize", "");
-  return mGetDefaultFontSizeResult;
-}
-
-void TestPlatformAbstraction::SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical)
-{
-  mTrace.PushCall("SetDpi", "");
-}
-
-bool TestPlatformAbstraction::LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
-{
-  mTrace.PushCall("LoadFile", "");
-  if( mLoadFileResult.loadResult )
-  {
-    buffer = mLoadFileResult.buffer;
-  }
-
-  return mLoadFileResult.loadResult;
-}
-
 bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
 {
   mTrace.PushCall("LoadShaderBinaryFile", "");
@@ -161,25 +83,12 @@ bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename,
   return mLoadFileResult.loadResult;
 }
 
-bool TestPlatformAbstraction::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const
-{
-  mTrace.PushCall("SaveFile", "");
-  return false;
-}
-
-void TestPlatformAbstraction::JoinLoaderThreads()
-{
-  mTrace.PushCall("JoinLoaderThreads", "");
-}
 
 /** Call this every test */
 void TestPlatformAbstraction::Initialize()
 {
   mTrace.Reset();
   mTrace.Enable(true);
-  mLoadedResourcesQueue.clear();
-  mFailedLoadQueue.clear();
-  mResourceRequests.Clear();
   mIsLoadingResult=false;
   mSynchronouslyLoadedResource.Reset();
   mDecodedBitmap.Reset();
@@ -189,19 +98,9 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
 {
   switch(func)
   {
-    case SuspendFunc:                         return mTrace.FindMethod("Suspend");
-    case ResumeFunc:                          return mTrace.FindMethod("Resume");
-    case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
     case LoadResourceSynchronouslyFunc:       return mTrace.FindMethod("LoadResourceSynchronously");
-    case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
     case LoadShaderBinaryFileFunc:            return mTrace.FindMethod("LoadShaderBinaryFile");
     case SaveShaderBinaryFileFunc:            return mTrace.FindMethod("SaveShaderBinaryFile");
-    case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
-    case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
-    case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
-    case IsLoadingFunc:                       return mTrace.FindMethod("IsLoading");
-    case SetDpiFunc:                          return mTrace.FindMethod("SetDpi");
-    case JoinLoaderThreadsFunc:               return mTrace.FindMethod("JoinLoaderThreads");
   }
   return false;
 }
@@ -213,88 +112,10 @@ void TestPlatformAbstraction::SetIsLoadingResult(bool result)
 
 void TestPlatformAbstraction::ClearReadyResources()
 {
-  mLoadedResourcesQueue.clear();
-  mFailedLoadQueue.clear();
   mSynchronouslyLoadedResource.Reset();
   mDecodedBitmap.Reset();
 }
 
-void TestPlatformAbstraction::SetResourceLoaded(Integration::ResourceId  loadedId,
-                                                Integration::ResourceTypeId  loadedType,
-                                                Integration::ResourcePointer loadedResource)
-{
-  LoadedResource loadedInfo;
-  loadedInfo.id = loadedId;
-  loadedInfo.type = loadedType;
-  loadedInfo.resource = loadedResource;
-  mLoadedResourcesQueue.push_back( loadedInfo );
-}
-
-void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
-                                                    Integration::ResourceFailure failure)
-{
-  FailedLoad failedInfo;
-  failedInfo.id = id;
-  failedInfo.failure = failure;
-  mFailedLoadQueue.push_back( failedInfo );
-}
-
-Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
-{
-  Integration::ResourceRequest* request = NULL;
-
-  // Return last request
-  if( ! mResourceRequests.Empty() )
-  {
-    request = *( mResourceRequests.End() - 1 );
-  }
-
-  return request;
-}
-
-const TestPlatformAbstraction::ResourceRequestContainer& TestPlatformAbstraction::GetAllRequests() const
-{
-  return mResourceRequests;
-}
-
-void TestPlatformAbstraction::SetAllResourceRequestsAsLoaded()
-{
-  for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
-       iter != endIter; ++iter )
-  {
-    Integration::ResourceRequest* request = *iter;
-    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
-    Integration::ResourcePointer resource(bitmap);
-    bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
-    SetResourceLoaded( request->GetId(), request->GetType()->id, resource );
-    delete request;
-  }
-  mResourceRequests.Clear();
-}
-
-void TestPlatformAbstraction::SetAllResourceRequestsAsFailed( Integration::ResourceFailure failure )
-{
-  for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
-       iter != endIter; ++iter )
-  {
-    Integration::ResourceRequest* request = *iter;
-    SetResourceLoadFailed( (*iter)->GetId(), failure);
-    delete request;
-  }
-  mResourceRequests.Clear();
-}
-
-void TestPlatformAbstraction::DiscardRequest()
-{
-  for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
-       iter != endIter; ++iter )
-  {
-    Integration::ResourceRequest* request = *iter;
-    delete request;
-  }
-  mResourceRequests.Clear();
-}
-
 void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
 {
   mClosestSize = size;
index 42e2d98..230ed02 100644 (file)
@@ -40,8 +40,6 @@ class DALI_IMPORT_API TestPlatformAbstraction : public Dali::Integration::Platfo
 
 public:
 
-  typedef Vector< Integration::ResourceRequest* > ResourceRequestContainer;
-
   /**
    * Constructor
    */
@@ -53,16 +51,6 @@ public:
   virtual ~TestPlatformAbstraction();
 
   /**
-   * @copydoc PlatformAbstraction::Suspend()
-   */
-  virtual void Suspend();
-
-  /**
-   * @copydoc PlatformAbstraction::Resume()
-   */
-  virtual void Resume();
-
-  /**
    * @copydoc PlatformAbstraction::GetClosestImageSize()
    */
   virtual ImageDimensions GetClosestImageSize( const std::string& filename,
@@ -81,11 +69,6 @@ public:
                                                bool orientationCorrection );
 
   /**
-   * @copydoc PlatformAbstraction::LoadResource()
-   */
-  virtual void LoadResource(const Integration::ResourceRequest& request);
-
-  /**
    * @copydoc PlatformAbstraction::LoadResourceSynchronously()
    */
   virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
@@ -96,70 +79,24 @@ public:
   virtual Integration::BitmapPtr DecodeBuffer( const Dali::Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
 
   /**
-   * @copydoc PlatformAbstraction::CancelLoad()
-   */
-  virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
-
-  /**
-   * @copydoc PlatformAbstraction::GetResources()
-   */
-  virtual void GetResources(Integration::ResourceCache& cache);
-
-  /**
-   * @copydoc PlatformAbstraction::IsLoading()
-   */
-  virtual bool IsLoading();
-
-  /**
-   * @copydoc PlatformAbstraction::GetDefaultFontSize()
-   */
-  virtual int GetDefaultFontSize() const;
-
-  /**
-   * @copydoc PlatformAbstraction::SetDpi()
-   */
-  virtual void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical);
-
-  /**
-   * @copydoc PlatformAbstraction::LoadFile()
-   */
-  virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
-
-  /**
    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
    */
   virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
 
   /**
-   * @copydoc PlatformAbstraction::SaveFile()
+   * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
    */
-  virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
-
- /**
-  * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
-  */
   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
 
-  virtual void JoinLoaderThreads();
 
 public: // TEST FUNCTIONS
 
   // Enumeration of Platform Abstraction methods
   typedef enum
   {
-    SuspendFunc,
-    ResumeFunc,
-    LoadResourceFunc,
     LoadResourceSynchronouslyFunc,
-    SaveFileFunc,
-    LoadFileFunc,
     LoadShaderBinaryFileFunc,
-    SaveShaderBinaryFileFunc,
-    CancelLoadFunc,
-    GetResourcesFunc,
-    IsLoadingFunc,
-    SetDpiFunc,
-    JoinLoaderThreadsFunc,
+    SaveShaderBinaryFileFunc
   } TestFuncEnum;
 
   /** Call this every test */
@@ -183,63 +120,11 @@ public: // TEST FUNCTIONS
   void SetIsLoadingResult(bool result);
 
   /**
-   * @brief Sets the value returned by GetDefaultFontSize
-   * @param[in] result The value to return
-   */
-  void SetGetDefaultFontSizeResult(float result);
-
-  /**
    * @brief Clears all resource queues
    */
   void ClearReadyResources();
 
   /**
-   * @brief Sets a particular resource request as loaded.
-   * @param[in] loadedId The ResourceID of the resource that has been loaded.
-   * @param[in] loadedType The type of resource that has been loaded.
-   * @param[in] loadedResource A pointer to the resource that has been loaded.
-   */
-  void SetResourceLoaded(Integration::ResourceId  loadedId,
-                         Integration::ResourceTypeId  loadedType,
-                         Integration::ResourcePointer loadedResource);
-
-  /**
-   * @brief Sets a particular resource request as load failure.
-   * @param[in] id The ID of the failed resource request.
-   * @param[in] failure The type of failure.
-   */
-  void SetResourceLoadFailed(Integration::ResourceId  id,
-                             Integration::ResourceFailure failure);
-
-  /**
-   * @brief Retrieves the latest resource request
-   * @return A pointer to the latest resource request.
-   */
-  Integration::ResourceRequest* GetRequest();
-
-  /**
-   * @brief Retrieves a reference to a container of all the resource requests.
-   * @return A reference to a container of all the resource requests.
-   */
-  const ResourceRequestContainer& GetAllRequests() const;
-
-  /**
-   * @brief Sets all resource requests as loaded.
-   */
-  void SetAllResourceRequestsAsLoaded();
-
-  /**
-   * @brief Sets all resource requests as loaded.
-   * @param[in] failure The failure type
-   */
-  void SetAllResourceRequestsAsFailed( Integration::ResourceFailure failure );
-
-  /**
-   * @brief Discards all current resource requests.
-   */
-  void DiscardRequest();
-
-  /**
    * @brief Sets the value returned by GetClosestImageSize.
    * @param[in] size The size that should be returned.
    */
@@ -277,19 +162,6 @@ private:
 
 private:
 
-  struct LoadedResource
-  {
-    Integration::ResourceId      id;
-    Integration::ResourceTypeId  type;
-    Integration::ResourcePointer resource;
-  };
-
-  struct FailedLoad
-  {
-    Integration::ResourceId      id;
-    Integration::ResourceFailure failure;
-  };
-
   struct LoadFileResult
   {
     inline LoadFileResult()
@@ -302,15 +174,8 @@ private:
     Dali::Vector< unsigned char> buffer;
   };
 
-  typedef std::vector< LoadedResource > LoadedResourceContainer;
-  typedef std::vector< FailedLoad > FailedLoadContainer;
-
   mutable TraceCallStack        mTrace;
   bool                          mIsLoadingResult;
-  int                           mGetDefaultFontSizeResult;
-  LoadedResourceContainer       mLoadedResourcesQueue;
-  FailedLoadContainer           mFailedLoadQueue;
-  ResourceRequestContainer      mResourceRequests;
   Vector2                       mSize;
   Vector2                       mClosestSize;
 
index c3f3358..d32f619 100644 (file)
 
 namespace Dali
 {
+
+template<typename T>
+std::string ToString(const T& x)
+{
+  return "undefined";
+}
+
 std::string ToString(int x);
 std::string ToString(unsigned int x);
 std::string ToString(float x);
index ded233f..95b784d 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -1388,6 +1389,307 @@ int UtcDaliToolkitScrollBarHideIndicatorN(void)
   END_TEST;
 }
 
+int UtcDaliToolkitScrollBarActionShowIndicator(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Do the "ShowIndicator" action
+  Property::Map emptyMap;
+  scrollBar.DoAction( "ShowIndicator", emptyMap );
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionHideIndicator(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Do the "HideIndicator" action
+  Property::Map emptyMap;
+  scrollBar.DoAction( "HideIndicator", emptyMap );
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionShowTransientIndicator(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Do the "ShowIndicator" action
+  Property::Map emptyMap;
+  scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Get the default duration to hide the indicator
+  float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+  float transientDuration = scrollBar.GetProperty<float>( DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+  float totalVisibleDuration = hideDuration + transientDuration;
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+
+  // Wait for the specified duration
+  Wait(application, totalVisibleDuration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionShowTransientIndicatorImmediate(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Don't use a show animation; the indicator should appear immediately
+  scrollBar.SetProperty( ScrollBar::Property::INDICATOR_SHOW_DURATION, 0.0f );
+  float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+  DALI_TEST_EQUALS( duration, 0.0f, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Do the "ShowIndicator" action
+  Property::Map emptyMap;
+  scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+
+  // Wait for the specified duration
+  Wait(application);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Get the default duration to hide the indicator
+  float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+  float transientDuration = scrollBar.GetProperty<float>( DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+  float totalVisibleDuration = hideDuration + transientDuration;
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+
+  // Wait for the specified duration
+  Wait(application, totalVisibleDuration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionShowTransientIndicatorDuringHide(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetIndicatorHideDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Wait for half the specified duration
+  Wait(application, duration * 0.5f * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now partially hidden
+  DALI_TEST_CHECK( indicator.GetCurrentOpacity() < 1.0f );
+
+  // Now interrupt the Hide with a DoAction( "ShowTransientIndicator" )
+
+  // Get the default duration to hide the indicator
+  duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Do the "ShowIndicator" action
+  Property::Map emptyMap;
+  scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Get the default duration to hide the indicator
+  float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+  float transientDuration = scrollBar.GetProperty<float>( DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+  float totalVisibleDuration = hideDuration + transientDuration;
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+
+  // Wait for the specified duration
+  Wait(application, totalVisibleDuration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
 {
   ToolkitTestApplication application;
index 20d5f44..2967639 100644 (file)
@@ -102,15 +102,9 @@ Image CreateSolidColorImage( ToolkitTestApplication& application, const Vector4&
 
 void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
 {
-  Integration::ResourceRequest* request = platform.GetRequest();
   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
   Integration::ResourcePointer resource(bitmap);
   bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
-
-  if(request)
-  {
-    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
-  }
 }
 
 class SignalHandler : public Dali::ConnectionTracker
index cd9d6bf..4635def 100644 (file)
@@ -1603,5 +1603,12 @@ int utcDaliTextEditorEvent05(void)
   DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION ), 0.1f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::SMOOTH_SCROLL ), true, TEST_LOCATION );
 
+  // Press Escape to increase coverage
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up ) );
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK( !editor.HasKeyInputFocus() );
+
   END_TEST;
 }
index c1fc637..a4b3c70 100644 (file)
@@ -118,15 +118,9 @@ static Dali::Toolkit::TextField::InputStyle::Mask gInputStyleMask;
 
 static void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
 {
-  Integration::ResourceRequest* request = platform.GetRequest();
   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
   Integration::ResourcePointer resource(bitmap);
   bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
-
-  if(request)
-  {
-    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
-  }
 }
 
 static void LoadMarkerImages(ToolkitTestApplication& app, TextField textField)
@@ -2055,5 +2049,12 @@ int utcDaliTextFieldStyleWhilstSelected(void)
   DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
+  // Press Escape to increase coverage
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up ) );
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK( !field.HasKeyInputFocus() );
+
   END_TEST;
 }
index aa2ca31..9e00636 100644 (file)
@@ -66,7 +66,7 @@ const char* const PROPERTY_NAME_OUTLINE = "outline";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-const unsigned int EMOJI_FONT_SIZE = 3968u;
+const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
 
 bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
 {
@@ -486,15 +486,34 @@ int UtcDaliToolkitTextLabelLanguagesP(void)
   application.SendNotification();
   application.Render();
 
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelEmojisP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelLanguagesP");
+  TextLabel label = TextLabel::New();
+  DALI_TEST_CHECK( label );
+
+  Stage::GetCurrent().Add( label );
+
   TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
 
   char* pathNamePtr = get_current_dir_name();
   const std::string pathName( pathNamePtr );
   free( pathNamePtr );
 
-  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+  TextAbstraction::FontDescription fontDescription;
+  fontDescription.path = pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf";
+  fontDescription.family = "BreezeColorEmoji";
+  fontDescription.width = TextAbstraction::FontWidth::NONE;
+  fontDescription.weight = TextAbstraction::FontWeight::NORMAL;
+  fontDescription.slant = TextAbstraction::FontSlant::NONE;
+
+  fontClient.GetFontId( fontDescription, EMOJI_FONT_SIZE );
 
-  const std::string emojis = "<font family='TizenColorEmoji'>\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84</font>";
+  const std::string emojis = "<font family='BreezeColorEmoji' size='60'>\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84</font>";
   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
   label.SetProperty( TextLabel::Property::TEXT, emojis );
 
index ab0f0cd..4ad689f 100644 (file)
@@ -223,22 +223,12 @@ void TestVisualRender( ToolkitTestApplication& application,
   application.SendNotification();
   application.Render();
 
-  if( resourcePtr )
-  {
-    Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
-    if(request)
-    {
-      application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resourcePtr );
-    }
-  }
-
   application.Render();
   application.SendNotification();
 
   if( resourcePtr )
   {
-    DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) ||
-                      application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION);
+    DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION);
   }
 
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
@@ -1234,10 +1224,6 @@ void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplic
   application.SendNotification();
   application.Render( 0 );
 
-  //Tell the platform abstraction that the required resources have been loaded.
-  TestPlatformAbstraction& platform = application.GetPlatform();
-  platform.SetAllResourceRequestsAsLoaded();
-
   //Render again to upload the now-loaded textures.
   application.SendNotification();
   application.Render( 0 );
@@ -1281,10 +1267,6 @@ void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTest
   application.SendNotification();
   application.Render( 0 );
 
-  //Tell the platform abstraction that the required resources have been loaded.
-  TestPlatformAbstraction& platform = application.GetPlatform();
-  platform.SetAllResourceRequestsAsLoaded();
-
   //Render again to upload the now-loaded textures.
   application.SendNotification();
   application.Render( 0 );
index 67b723c..7127db2 100644 (file)
@@ -106,6 +106,7 @@ develapieffectsviewdir =        $(develapicontrolsdir)/effects-view
 develapigaussianblurviewdir =   $(develapicontrolsdir)/gaussian-blur-view
 develapimagnifierdir =          $(develapicontrolsdir)/magnifier
 develapiitemviewdir =           $(develapicontrolsdir)/scrollable/item-view
+develapiscrollbardir =          $(develapicontrolsdir)/scroll-bar
 develapinavigationviewdir =     $(develapicontrolsdir)/navigation-view
 develapipageturnviewdir =       $(develapicontrolsdir)/page-turn-view
 develapipopupdir =              $(develapicontrolsdir)/popup
@@ -135,6 +136,7 @@ develapifocusmanager_HEADERS =      $(devel_api_focus_manager_header_files)
 develapigaussianblurview_HEADERS =  $(devel_api_gaussian_blur_view_header_files)
 develapiimageloader_HEADERS =       $(devel_api_image_loader_header_files)
 develapiitemview_HEADERS =          $(devel_api_item_view_header_files)
+develapiscrollbar_HEADERS =         $(devel_api_scroll_bar_header_files)
 develapimagnifier_HEADERS =         $(devel_api_magnifier_header_files)
 develapinavigationview_HEADERS =    $(devel_api_navigation_view_header_files)
 develapipageturnview_HEADERS =      $(devel_api_page_turn_view_header_files)
diff --git a/dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h b/dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h
new file mode 100644 (file)
index 0000000..7d16c75
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef DALI_TOOLKIT_SCROLL_BAR_DEVEL_H
+#define DALI_TOOLKIT_SCROLL_BAR_DEVEL_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelScrollBar
+{
+
+namespace Property
+{
+
+/**
+ * @brief ScrollBar is a UI component that can be linked to the scrollable objects
+ * indicating the current scroll position of the scrollable object.
+ *
+ * Actions
+ * | %Action Name           | Attributes              | Description                               |
+ * |------------------------|-------------------------|-------------------------------------------|
+ * | ShowIndicator          | Doesn't have attributes | Shows the scroll-indicator                |
+ * | HideIndicator          | Doesn't have attributes | Hides the scroll-indicator                |
+ * | ShowTransientIndicator | Doesn't have attributes | Shows the scroll-indicator for short time |
+ */
+
+/**
+ * @brief Enumeration for the instance of properties belonging to the ScrollBar class.
+ */
+enum
+{
+  SCROLL_DIRECTION          = Dali::Toolkit::ScrollBar::Property::SCROLL_DIRECTION,
+  INDICATOR_HEIGHT_POLICY   = Dali::Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY,
+  INDICATOR_FIXED_HEIGHT    = Dali::Toolkit::ScrollBar::Property::INDICATOR_FIXED_HEIGHT,
+  INDICATOR_SHOW_DURATION   = Dali::Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION,
+  INDICATOR_HIDE_DURATION   = Dali::Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION,
+  SCROLL_POSITION_INTERVALS = Dali::Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS,
+  INDICATOR_MINIMUM_HEIGHT  = Dali::Toolkit::ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT,
+  INDICATOR_START_PADDING   = Dali::Toolkit::ScrollBar::Property::INDICATOR_START_PADDING,
+  INDICATOR_END_PADDING     = Dali::Toolkit::ScrollBar::Property::INDICATOR_END_PADDING,
+
+  /**
+   * @brief The duration that transient indicators will remain fully visible.
+   * @details name "indicatorTransientDuration", type float.
+   */
+  INDICATOR_TRANSIENT_DURATION = INDICATOR_END_PADDING + 1
+};
+
+} // namespace Property
+
+} // namespace DevelScrollBar
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_SCROLL_BAR_DEVEL_H
index 3108cc3..7702ef4 100755 (executable)
@@ -69,6 +69,9 @@ devel_api_item_view_header_files = \
   $(devel_api_src_dir)/controls/scrollable/item-view/default-item-layout-property.h \
   $(devel_api_src_dir)/controls/scrollable/item-view/item-view-devel.h
 
+devel_api_scroll_bar_header_files = \
+  $(devel_api_src_dir)/controls/scroll-bar/scroll-bar-devel.h
+
 devel_api_magnifier_header_files = \
   $(devel_api_src_dir)/controls/magnifier/magnifier.h
 
index 48d2e2b..e4ef639 100644 (file)
@@ -1139,7 +1139,8 @@ void Builder::ApplyAllStyleProperties( const TreeNode& root, const TreeNode& nod
   if( matchedStyle )
   {
     StylePtr style( *matchedStyle );
-    style->ApplyVisualsAndPropertiesRecursively( handle ); // (recurses through states)
+    Dictionary<Property::Map> instancedProperties;
+    style->ApplyVisualsAndPropertiesRecursively( handle, instancedProperties );
   }
   else // If there were no styles, instead set properties
   {
index ccccf2c..88095eb 100644 (file)
@@ -36,6 +36,23 @@ namespace Internal
  *
  * It enables lookup of keys via case-insensitive match.
  */
+
+
+typedef std::vector<std::string> DictionaryKeys;
+inline void Merge( DictionaryKeys& toDict, const DictionaryKeys& fromDict )
+{
+  for( DictionaryKeys::const_iterator fromIter = fromDict.begin(); fromIter != fromDict.end(); ++fromIter )
+  {
+    const std::string& fromKey = (*fromIter);
+    DictionaryKeys::iterator toIter = std::find( toDict.begin(), toDict.end(), fromKey );
+    if( toIter == toDict.end() )
+    {
+      toDict.push_back( fromKey );
+    }
+  }
+}
+
+
 template<typename EntryType>
 class Dictionary
 {
@@ -62,7 +79,6 @@ public:
    */
   typedef typename Elements::const_iterator iterator;
 
-
   /**
    * Constructor
    */
@@ -105,6 +121,53 @@ public:
   }
 
   /**
+   * Remove a key value pair from the dictionary.
+   */
+  void Remove( const std::string& name )
+  {
+    for( typename Elements::iterator iter = container.begin(); iter != container.end(); ++iter )
+    {
+      if( iter->key == name )
+      {
+        container.erase( iter );
+        break;
+      }
+    }
+  }
+
+  /**
+   * Remove a key value pair from the dictionary.
+   */
+  void Remove( const char* name )
+  {
+    if( name != NULL )
+    {
+      std::string theName(name);
+      Remove(theName);
+    }
+  }
+
+  void Merge( const Dictionary<EntryType>& dictionary )
+  {
+    for( typename Elements::const_iterator fromIter = dictionary.container.begin(); fromIter != dictionary.container.end(); ++fromIter )
+    {
+      bool found=false;
+      for( typename Elements::iterator toIter = container.begin(); toIter != container.end(); ++toIter )
+      {
+        if( fromIter->key == toIter->key )
+        {
+          found=true;
+          toIter->entry = fromIter->entry;
+        }
+      }
+      if( !found )
+      {
+        container.push_back( Element(fromIter->key, fromIter->entry) );
+      }
+    }
+  }
+
+  /**
    * Find the element in the dictionary pointed at by key, and
    * insensitive search, and return a const pointer to it, or NULL
    */
@@ -187,6 +250,20 @@ public:
   {
     return container.end();
   }
+
+  void GetKeys( DictionaryKeys& keys ) const
+  {
+    keys.clear();
+    for( typename Elements::const_iterator iter = container.begin(); iter != container.end(); ++iter )
+    {
+      keys.push_back( (*iter).key );
+    }
+  }
+
+  void Clear()
+  {
+    container.clear();
+  }
 };
 
 
index 515ddd9..988bd61 100644 (file)
@@ -18,7 +18,9 @@
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/builder/style.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
 
 namespace Dali
 {
@@ -37,9 +39,11 @@ StylePtr Style::New()
   return stylePtr;
 }
 
-void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
+void Style::ApplyVisualsAndPropertiesRecursively(
+  Handle handle,
+  const Dictionary<Property::Map>& instancedProperties ) const
 {
-  ApplyVisuals( handle );
+  ApplyVisuals( handle, instancedProperties );
   ApplyProperties( handle );
 
   Toolkit::Control control = Toolkit::Control::DownCast(handle);
@@ -59,7 +63,7 @@ void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
         const StylePtr statePtr(*stylePtr);
 
         // We have a state match.
-        statePtr->ApplyVisuals( handle );
+        statePtr->ApplyVisuals( handle, instancedProperties );
         statePtr->ApplyProperties( handle );
 
         // Apply substate visuals
@@ -72,7 +76,7 @@ void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
           {
             const StylePtr subStatePtr(*stylePtr);
             // We have a sub-state match.
-            subStatePtr->ApplyVisuals( handle );
+            subStatePtr->ApplyVisuals( handle, instancedProperties );
             subStatePtr->ApplyProperties( handle );
           }
         }
@@ -81,18 +85,66 @@ void Style::ApplyVisualsAndPropertiesRecursively( Handle handle ) const
   }
 }
 
-void Style::ApplyVisuals( Handle handle ) const
+void Style::ApplyVisuals(
+  Handle handle,
+  const Dictionary<Property::Map>& instancedProperties ) const
 {
-  for( Dictionary<Property::Map>::iterator iter = visuals.Begin(); iter != visuals.End() ; ++iter )
+  ApplyVisuals( handle, visuals, instancedProperties );
+}
+
+void Style::ApplyVisuals(
+  Handle handle,
+  const Dictionary<Property::Map>& visualMaps,
+  const Dictionary<Property::Map>& instancedProperties )
+{
+  for( Dictionary<Property::Map>::iterator iter = visualMaps.Begin(); iter != visualMaps.End() ; ++iter )
   {
     const std::string& visualName = (*iter).key;
-    const Property::Map& map = (*iter).entry;
-    Dali::Property::Index index = handle.GetPropertyIndex( visualName );
-    if( index != Property::INVALID_INDEX )
+    Property::Map map = (*iter).entry;
+    Property::Map* instancedMap = instancedProperties.Find( visualName );
+    ApplyVisual( handle, visualName, map, instancedMap );
+  }
+}
+
+void Style::ApplyVisual(
+  Handle handle,
+  const std::string& visualName,
+  const Property::Map& visualMap,
+  const Property::Map* instancedProperties )
+{
+  // Check if this visual name is a valid property of handle
+  Dali::Property::Index index = handle.GetPropertyIndex( visualName );
+  if( index != Property::INVALID_INDEX )
+  {
+    const Property::Map* applyMap = &visualMap;
+    Property::Map mergedMap;
+
+    // If there are instanced properties, and the visual types match,
+    // merge them into the visual map
+    if( instancedProperties )
     {
-      const Property::Value value(const_cast<Property::Map&>(map));
-      handle.SetProperty( index, value );
+      Property::Value* instanceTypeValue = instancedProperties->Find( Toolkit::DevelVisual::Property::TYPE);
+      Property::Value* newTypeValue = visualMap.Find( Toolkit::DevelVisual::Property::TYPE, VISUAL_TYPE );
+      if( instanceTypeValue && newTypeValue )
+      {
+        int instanceVisualType=-1;
+        int newVisualType=-1;
+        Scripting::GetEnumerationProperty( *instanceTypeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, instanceVisualType );
+        Scripting::GetEnumerationProperty( *newTypeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, newVisualType );
+
+        if( instanceVisualType == newVisualType )
+        {
+          // Same type - merge remaining instance data
+          mergedMap.Merge( visualMap );
+          mergedMap.Merge( *instancedProperties );
+          applyMap = &mergedMap;
+        }
+      }
     }
+
+    // Apply the visual property map to the handle
+    const Property::Value value(const_cast<Property::Map&>(*applyMap));
+    handle.SetProperty( index, value );
   }
 }
 
index bd26a6d..441f568 100644 (file)
@@ -55,16 +55,41 @@ public:
    * through sub-states.
    *
    * @param[in] handle The handle to apply the visuals to
+   * @param[in] instancedProperties The maps from which to get instanced properties
    */
-  void ApplyVisualsAndPropertiesRecursively( Handle handle ) const;
+  void ApplyVisualsAndPropertiesRecursively( Handle handle,
+                                             const Dictionary<Property::Map>& instancedProperties ) const;
 
   /**
    * Apply the visuals of the style to the control pointed at by
    * handle.
    *
    * @param[in] handle The handle to apply the visuals to
+   * @param[in] instancedProperties The maps from which to get instanced properties
    */
-  void ApplyVisuals( Handle handle ) const;
+  void ApplyVisuals( Handle handle,
+                     const Dictionary<Property::Map>& instancedProperties ) const;
+
+  /**
+   * Apply the properties from the visualMaps and the instancedProperties
+   * to the control pointed at by handle.
+   *
+   * @param[in] handle The handle to apply the properties to
+   * @param[in] visualMaps The visual maps from which to get the styled properties
+   * @param[in] instancedProperties The maps from which to get instanced properties
+   */
+  static void ApplyVisuals( Handle handle,
+                            const Dictionary<Property::Map>& visualMaps,
+                            const Dictionary<Property::Map>& instancedProperties );
+
+  /**
+   * Apply the properties from the visualMap and optional instancedProperties
+   * to the control pointed at by handle.
+   */
+  static void ApplyVisual( Handle handle,
+                           const std::string& visualName,
+                           const Property::Map& visualMap,
+                           const Property::Map* instancedProperties );
 
   /**
    * Apply the properties of the style to the control pointed at by
index 7612185..5adc065 100755 (executable)
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
+#include <dali/devel-api/object/property-helper-devel.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h>
 
 using namespace Dali;
 
@@ -46,6 +48,7 @@ const float DEFAULT_INDICATOR_FIXED_HEIGHT(80.0f);
 const float DEFAULT_INDICATOR_MINIMUM_HEIGHT(0.0f);
 const float DEFAULT_INDICATOR_START_PADDING(0.0f);
 const float DEFAULT_INDICATOR_END_PADDING(0.0f);
+const float DEFAULT_INDICATOR_TRANSIENT_DURATION(1.0f);
 
 /**
  * Indicator size constraint
@@ -154,19 +157,25 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBar, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollDirection",                   STRING, SCROLL_DIRECTION          )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHeightPolicy",             STRING, INDICATOR_HEIGHT_POLICY   )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorFixedHeight",              FLOAT,  INDICATOR_FIXED_HEIGHT    )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorShowDuration",             FLOAT,  INDICATOR_SHOW_DURATION   )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHideDuration",             FLOAT,  INDICATOR_HIDE_DURATION   )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervals",           ARRAY,  SCROLL_POSITION_INTERVALS )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorMinimumHeight",            FLOAT,  INDICATOR_MINIMUM_HEIGHT  )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorStartPadding",             FLOAT,  INDICATOR_START_PADDING   )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorEndPadding",               FLOAT,  INDICATOR_END_PADDING     )
-
-DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "panFinished",                       PAN_FINISHED_SIGNAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollDirection",                   STRING, SCROLL_DIRECTION             )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHeightPolicy",             STRING, INDICATOR_HEIGHT_POLICY      )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorFixedHeight",              FLOAT,  INDICATOR_FIXED_HEIGHT       )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorShowDuration",             FLOAT,  INDICATOR_SHOW_DURATION      )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHideDuration",             FLOAT,  INDICATOR_HIDE_DURATION      )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervals",           ARRAY,  SCROLL_POSITION_INTERVALS    )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorMinimumHeight",            FLOAT,  INDICATOR_MINIMUM_HEIGHT     )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorStartPadding",             FLOAT,  INDICATOR_START_PADDING      )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorEndPadding",               FLOAT,  INDICATOR_END_PADDING        )
+
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorTransientDuration", FLOAT,  INDICATOR_TRANSIENT_DURATION )
+
+DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "panFinished",                       PAN_FINISHED_SIGNAL                     )
 DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "scrollPositionIntervalReached",     SCROLL_POSITION_INTERVAL_REACHED_SIGNAL )
 
+DALI_ACTION_REGISTRATION(   Toolkit, ScrollBar, "ShowIndicator",                     ACTION_SHOW_INDICATOR                   )
+DALI_ACTION_REGISTRATION(   Toolkit, ScrollBar, "HideIndicator",                     ACTION_HIDE_INDICATOR                   )
+DALI_ACTION_REGISTRATION(   Toolkit, ScrollBar, "ShowTransientIndicator",            ACTION_SHOW_TRANSIENT_INDICATOR         )
+
 DALI_TYPE_REGISTRATION_END()
 
 const char* SCROLL_DIRECTION_NAME[] = {"Vertical", "Horizontal"};
@@ -185,6 +194,7 @@ ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction)
   mPropertyScrollContentSize(Property::INVALID_INDEX),
   mIndicatorShowDuration(DEFAULT_INDICATOR_SHOW_DURATION),
   mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
+  mTransientIndicatorDuration(DEFAULT_INDICATOR_TRANSIENT_DURATION),
   mScrollStart(0.0f),
   mCurrentScrollPosition(0.0f),
   mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
@@ -404,6 +414,30 @@ void ScrollBar::HideIndicator()
   }
 }
 
+void ScrollBar::ShowTransientIndicator()
+{
+  // Cancel any animation
+  if(mAnimation)
+  {
+    mAnimation.Clear();
+    mAnimation.Reset();
+  }
+
+  mAnimation = Animation::New( mIndicatorShowDuration + mTransientIndicatorDuration + mIndicatorHideDuration );
+  if(mIndicatorShowDuration > 0.0f)
+  {
+    mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ),
+                          mIndicatorShowAlpha, AlphaFunction::EASE_IN, TimePeriod(0, mIndicatorShowDuration) );
+  }
+  else
+  {
+    mIndicator.SetOpacity(mIndicatorShowAlpha);
+  }
+  mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ),
+                        0.0f, AlphaFunction::EASE_IN, TimePeriod((mIndicatorShowDuration + mTransientIndicatorDuration), mIndicatorHideDuration) );
+  mAnimation.Play();
+}
+
 bool ScrollBar::OnPanGestureProcessTick()
 {
   // Update the scroll position property.
@@ -688,6 +722,11 @@ void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Pr
         scrollBarImpl.ApplyConstraints();
         break;
       }
+      case Toolkit::DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION:
+      {
+        scrollBarImpl.mTransientIndicatorDuration = value.Get<float>();
+        break;
+      }
     }
   }
 }
@@ -759,11 +798,48 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde
         value = scrollBarImpl.mIndicatorEndPadding;
         break;
       }
+      case Toolkit::DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION:
+      {
+        value = scrollBarImpl.mTransientIndicatorDuration;
+        break;
+      }
     }
   }
   return value;
 }
 
+bool ScrollBar::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
+{
+  bool ret = false;
+
+  Dali::BaseHandle handle( object );
+
+  Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( handle );
+
+  DALI_ASSERT_DEBUG( scrollBar );
+
+  if( scrollBar )
+  {
+    if( 0 == strcmp( actionName.c_str(), ACTION_SHOW_INDICATOR ) )
+    {
+      GetImpl( scrollBar ).ShowIndicator();
+      ret = true;
+    }
+    else if( 0 == strcmp( actionName.c_str(), ACTION_HIDE_INDICATOR ) )
+    {
+      GetImpl( scrollBar ).HideIndicator();
+      ret = true;
+    }
+    else if( 0 == strcmp( actionName.c_str(), ACTION_SHOW_TRANSIENT_INDICATOR ) )
+    {
+      GetImpl( scrollBar ).ShowTransientIndicator();
+      ret = true;
+    }
+  }
+
+  return ret;
+}
+
 Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction)
 {
   // Create the implementation, temporarily owned by this handle on stack
index 0826ef3..95b0901 100755 (executable)
@@ -146,7 +146,12 @@ public:
   /**
    * @copydoc Toolkit::ScrollBar::HideIndicator()
    */
- void HideIndicator();
+  void HideIndicator();
+
+  /**
+   * @brief Shows indicator until the transient duration has expired
+   */
+  void ShowTransientIndicator();
 
  /**
   * @copydoc Toolkit::ScrollBar::PanFinishedSignal()
@@ -193,6 +198,15 @@ public:
   */
  static Property::Value GetProperty( BaseObject* object, Property::Index index );
 
+ /**
+  * Performs actions as requested using the action name.
+  * @param[in] object The object on which to perform the action.
+  * @param[in] actionName The action to perform.
+  * @param[in] attributes The attributes with which to perfrom this action.
+  * @return true if action has been accepted by this control
+  */
+ static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
+
 private: // from Control
 
   /**
@@ -278,6 +292,7 @@ private:
 
   float mIndicatorShowDuration;                                      ///< The duration of scroll indicator show animation
   float mIndicatorHideDuration;                                      ///< The duration of scroll indicator hide animation
+  float mTransientIndicatorDuration;                                 ///< The duration before hiding transient indicator
 
   float mScrollStart;                                                ///< Scroll Start position (start of drag)
   Vector3 mGestureDisplacement;                                      ///< Gesture Displacement.
index 069d5b6..3063cbc 100644 (file)
@@ -26,6 +26,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/object/property-map.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -1986,8 +1987,9 @@ void ScrollView::OnChildAdd(Actor& child)
 
     if( mTransientScrollBar )
     {
-      scrollBar.SetVisible( false );
-      scrollBar.HideIndicator();
+      // Show the scroll-indicator for a brief period
+      Property::Map emptyMap;
+      scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
     }
   }
   else if(mAlterChild)
@@ -2495,7 +2497,6 @@ void ScrollView::OnPan( const PanGesture& gesture )
 
         if( ( rulerDomainX.max > size.width ) || ( rulerDomainY.max > size.height ) )
         {
-          scrollBar.SetVisible( true );
           scrollBar.ShowIndicator();
         }
       }
index e7dcd62..a5aa7ff 100644 (file)
@@ -1243,7 +1243,12 @@ bool TextEditor::OnKeyEvent( const KeyEvent& event )
 
   if( Dali::DALI_KEY_ESCAPE == event.keyCode ) // Make a Dali key code for this
   {
-    ClearKeyInputFocus();
+    // Make sure ClearKeyInputFocus when only key is up
+    if( event.state == KeyEvent::Up )
+    {
+      ClearKeyInputFocus();
+    }
+
     return true;
   }
 
index 2aff8e4..3e2c606 100644 (file)
@@ -1402,10 +1402,14 @@ bool TextField::OnKeyEvent( const KeyEvent& event )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
 
-  if( Dali::DALI_KEY_ESCAPE == event.keyCode ||
-      "Return" == event.keyPressedName ) // Make a Dali key code for this
+  if( Dali::DALI_KEY_ESCAPE == event.keyCode || "Return" == event.keyPressedName ) // Make a Dali key code for this
   {
-    ClearKeyInputFocus();
+    // Make sure ClearKeyInputFocus when only key is up
+    if( event.state == KeyEvent::Up )
+    {
+      ClearKeyInputFocus();
+    }
+
     return true;
   }
 
index 12d39a5..7e672bd 100644 (file)
@@ -27,50 +27,6 @@ namespace
   Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
 #endif
 
-#define MAKE_SHADER(A)#A
-
-const char* VERTEX_SHADER = MAKE_SHADER(
-attribute mediump vec2    aPosition;
-attribute mediump vec2    aTexCoord;
-attribute mediump vec4    aColor;
-uniform   mediump vec2    uOffset;
-uniform   mediump mat4    uMvpMatrix;
-varying   mediump vec2    vTexCoord;
-varying   mediump vec4    vColor;
-
-void main()
-{
-  mediump vec4 position = vec4( aPosition.xy + uOffset, 0.0, 1.0 );
-  gl_Position = uMvpMatrix * position;
-  vTexCoord = aTexCoord;
-  vColor = aColor;
-}
-);
-
-const char* FRAGMENT_SHADER_L8 = MAKE_SHADER(
-uniform lowp    vec4      uColor;
-uniform         sampler2D sTexture;
-varying mediump vec2      vTexCoord;
-varying mediump vec4      vColor;
-
-void main()
-{
-  mediump vec4 color = texture2D( sTexture, vTexCoord );
-  gl_FragColor = vec4( vColor.rgb * uColor.rgb, vColor.a * uColor.a * color.r );
-}
-);
-
-const char* FRAGMENT_SHADER_RGBA = MAKE_SHADER(
-uniform lowp    vec4      uColor;
-uniform         sampler2D sTexture;
-varying mediump vec2      vTexCoord;
-
-void main()
-{
-  gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;
-}
-);
-
 } // unnamed namespace
 
 namespace Dali
@@ -84,8 +40,6 @@ namespace Internal
 
 AtlasGlyphManager::AtlasGlyphManager()
 {
-  mShaderL8 = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_L8 );
-  mShaderRgba = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_RGBA );
   mAtlasManager = Dali::Toolkit::AtlasManager::New();
 }
 
@@ -257,12 +211,6 @@ TextureSet AtlasGlyphManager::GetTextures( uint32_t atlasId ) const
   return mAtlasManager.GetTextures( atlasId );
 }
 
-Shader AtlasGlyphManager::GetShader( uint32_t atlasId ) const
-{
-  Pixel::Format pixelFormat = mAtlasManager.GetPixelFormat( atlasId );
-  return pixelFormat == Pixel::L8 ? mShaderL8 : mShaderRgba;
-}
-
 AtlasGlyphManager::~AtlasGlyphManager()
 {
   // mAtlasManager handle is automatically released here
index b72b649..a2232f9 100644 (file)
@@ -113,11 +113,6 @@ public:
   TextureSet GetTextures( uint32_t atlasId ) const;
 
   /**
-   * @copydoc Toolkit::AtlasGlyphManager::GetShader
-   */
-  Shader GetShader( uint32_t atlasId ) const;
-
-  /**
    * @copydoc Toolkit::AtlasGlyphManager::GetMetrics
    */
   const Toolkit::AtlasGlyphManager::Metrics& GetMetrics();
@@ -134,9 +129,6 @@ private:
   Dali::Toolkit::AtlasManager mAtlasManager;          ///> Atlas Manager created by GlyphManager
   std::vector< FontGlyphRecord > mFontGlyphRecords;
   Toolkit::AtlasGlyphManager::Metrics mMetrics;       ///> Metrics to pass back on GlyphManager status
-
-  Shader mShaderL8;
-  Shader mShaderRgba;
 };
 
 } // namespace Internal
index 6858f26..743bc6c 100644 (file)
@@ -111,11 +111,6 @@ TextureSet AtlasGlyphManager::GetTextures( uint32_t atlasId ) const
   return GetImplementation(*this).GetTextures( atlasId );
 }
 
-Shader AtlasGlyphManager::GetShader( uint32_t atlasId ) const
-{
-  return GetImplementation(*this).GetShader( atlasId );
-}
-
 const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
 {
   return GetImplementation(*this).GetMetrics();
index 3ba54de..1bc058b 100644 (file)
@@ -149,15 +149,6 @@ public:
   TextureSet GetTextures( uint32_t atlasId ) const;
 
   /**
-   * @brief Get the shader used by an atlas
-   *
-   * @param[in] atlasId Id of an atlas
-   *
-   * @return The shader used by the atlas
-   */
-  Shader GetShader( uint32_t atlasId ) const;
-
-  /**
    * @brief Get Glyph Manager metrics
    *
    * @return const reference to glyph manager metrics
index bc3a70a..958749e 100644 (file)
@@ -79,6 +79,14 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa
   }
 
   Dali::Texture atlas = Dali::Texture::New( TextureType::TEXTURE_2D, pixelformat, width, height );
+
+  // Clear the background
+  unsigned int bufferSize(  width * height * Dali::Pixel::GetBytesPerPixel( pixelformat ) );
+  unsigned char* background = new unsigned char[bufferSize];
+  memset( background, 0, bufferSize );
+  PixelData backgroundPixels = PixelData::New( background, bufferSize, width, height, pixelformat, PixelData::DELETE_ARRAY );
+  atlas.Upload( backgroundPixels, 0u, 0u, 0u, 0u, width, height );
+
   AtlasDescriptor atlasDescriptor;
   atlasDescriptor.mAtlas = atlas;
   atlasDescriptor.mSize = size;
@@ -86,7 +94,7 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa
   atlasDescriptor.mTotalBlocks = ( ( width - 1u ) / blockWidth ) * ( ( height - 1u ) / blockHeight );
   atlasDescriptor.mAvailableBlocks = atlasDescriptor.mTotalBlocks;
 
-  unsigned int bufferSize(  blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat) );
+  bufferSize = blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat);
   unsigned char* bufferHorizontalStrip = new unsigned char[bufferSize];
   memset( bufferHorizontalStrip, 0, bufferSize );
   atlasDescriptor.mHorizontalStrip = PixelData::New( bufferHorizontalStrip, bufferSize, blockWidth, SINGLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
index 2332c7a..69416c1 100644 (file)
@@ -42,6 +42,50 @@ namespace
   Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_RENDERING");
 #endif
 
+#define MAKE_SHADER(A)#A
+
+const char* VERTEX_SHADER = MAKE_SHADER(
+attribute mediump vec2    aPosition;
+attribute mediump vec2    aTexCoord;
+attribute mediump vec4    aColor;
+uniform   mediump vec2    uOffset;
+uniform   mediump mat4    uMvpMatrix;
+varying   mediump vec2    vTexCoord;
+varying   mediump vec4    vColor;
+
+void main()
+{
+  mediump vec4 position = vec4( aPosition.xy + uOffset, 0.0, 1.0 );
+  gl_Position = uMvpMatrix * position;
+  vTexCoord = aTexCoord;
+  vColor = aColor;
+}
+);
+
+const char* FRAGMENT_SHADER_L8 = MAKE_SHADER(
+uniform lowp    vec4      uColor;
+uniform         sampler2D sTexture;
+varying mediump vec2      vTexCoord;
+varying mediump vec4      vColor;
+
+void main()
+{
+  mediump vec4 color = texture2D( sTexture, vTexCoord );
+  gl_FragColor = vec4( vColor.rgb * uColor.rgb, vColor.a * uColor.a * color.r );
+}
+);
+
+const char* FRAGMENT_SHADER_RGBA = MAKE_SHADER(
+uniform lowp    vec4      uColor;
+uniform         sampler2D sTexture;
+varying mediump vec2      vTexCoord;
+
+void main()
+{
+  gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;
+}
+);
+
 const float ZERO( 0.0f );
 const float HALF( 0.5f );
 const float ONE( 1.0f );
@@ -290,7 +334,28 @@ struct AtlasRenderer::Impl
           }
 
           // Create a new image for the glyph
-          PixelData bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
+          PixelData bitmap;
+
+          // Whether the current glyph is a color one.
+          const bool isColorGlyph = mFontClient.IsColorGlyph( glyph.fontId, glyph.index );
+
+          // Retrieve the emoji's bitmap.
+          TextAbstraction::FontClient::GlyphBufferData glyphBufferData;
+          glyphBufferData.width = isColorGlyph ? glyph.width : 0;   // Desired width and height.
+          glyphBufferData.height = isColorGlyph ? glyph.height : 0;
+
+          mFontClient.CreateBitmap( glyph.fontId,
+                                    glyph.index,
+                                    glyphBufferData );
+
+          // Create the pixel data.
+          bitmap = PixelData::New( glyphBufferData.buffer,
+                                   glyph.width * glyph.height * GetBytesPerPixel( glyphBufferData.format ),
+                                   glyph.width,
+                                   glyph.height,
+                                   glyphBufferData.format,
+                                   PixelData::DELETE_ARRAY );
+
           if( bitmap )
           {
             MaxBlockSize& blockSize = mBlockSizes[currentBlockSize];
@@ -339,21 +404,6 @@ struct AtlasRenderer::Impl
 
         AtlasManager::Vertex2D* verticesBuffer = newMesh.mVertices.Begin();
 
-        // Adjust the vertices if the fixed-size font should be down-scaled
-        if( glyph.scaleFactor > 0 )
-        {
-          for( unsigned int index = 0u, size = newMesh.mVertices.Count();
-               index < size;
-               ++index )
-          {
-            AtlasManager::Vertex2D& vertex = *( verticesBuffer + index );
-
-            // Set the position of the vertex.
-            vertex.mPosition.x = position.x + ( ( vertex.mPosition.x - position.x ) * glyph.scaleFactor );
-            vertex.mPosition.y = position.y + ( ( vertex.mPosition.y - position.y ) * glyph.scaleFactor );
-          }
-        }
-
         // Get the color of the character.
         const ColorIndex colorIndex = useDefaultColor ? 0u : *( colorIndicesBuffer + i );
         const Vector4& color = ( useDefaultColor || ( 0u == colorIndex ) ) ? defaultColor : *( colorsBuffer + colorIndex - 1u );
@@ -409,7 +459,7 @@ struct AtlasRenderer::Impl
       {
         MeshRecord& meshRecord = *it;
 
-        Actor actor = CreateMeshActor( meshRecord, textSize );
+        Actor actor = CreateMeshActor( meshRecord, textSize, STYLE_NORMAL );
 
         // Whether the actor has renderers.
         const bool hasRenderer = actor.GetRendererCount() > 0u;
@@ -429,7 +479,7 @@ struct AtlasRenderer::Impl
             vertex.mColor = shadowColor;
           }
 
-          Actor shadowActor = CreateMeshActor( meshRecord, textSize );
+          Actor shadowActor = CreateMeshActor( meshRecord, textSize, STYLE_DROP_SHADOW );
 #if defined(DEBUG_ENABLED)
           shadowActor.SetName( "Text Shadow renderable actor" );
 #endif
@@ -480,7 +530,7 @@ struct AtlasRenderer::Impl
     mTextCache.Resize( 0 );
   }
 
-  Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize )
+  Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize, Style style )
   {
     PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat );
     quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ), meshRecord.mMesh.mVertices.Size() );
@@ -490,7 +540,29 @@ struct AtlasRenderer::Impl
     quadGeometry.SetIndexBuffer( &meshRecord.mMesh.mIndices[0],  meshRecord.mMesh.mIndices.Size() );
 
     TextureSet textureSet( mGlyphManager.GetTextures( meshRecord.mAtlasId ) );
-    Shader shader( mGlyphManager.GetShader( meshRecord.mAtlasId ) );
+
+    // Choose the shader to use.
+    const bool isColorShader = ( STYLE_DROP_SHADOW != style ) && ( Pixel::BGRA8888 == mGlyphManager.GetPixelFormat( meshRecord.mAtlasId ) );
+    Shader shader;
+    if( isColorShader )
+    {
+      // The glyph is an emoji and is not a shadow.
+      if( !mShaderRgba )
+      {
+        mShaderRgba = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_RGBA );
+      }
+      shader = mShaderRgba;
+    }
+    else
+    {
+      // The glyph is text or a shadow.
+      if( !mShaderL8 )
+      {
+        mShaderL8 = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_L8 );
+      }
+      shader = mShaderL8;
+    }
+
     Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, shader );
     renderer.SetTextures( textureSet );
     renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
@@ -723,11 +795,13 @@ struct AtlasRenderer::Impl
 
   Actor mActor;                                       ///< The actor parent which renders the text
   AtlasGlyphManager mGlyphManager;                    ///< Glyph Manager to handle upload and caching
-  TextAbstraction::FontClient mFontClient;            ///> The font client used to supply glyph information
-  std::vector< MaxBlockSize > mBlockSizes;            ///> Maximum size needed to contain a glyph in a block within a new atlas
-  Vector< TextCacheEntry > mTextCache;                ///> Caches data from previous render
-  Property::Map mQuadVertexFormat;                    ///> Describes the vertex format for text
-  int mDepth;                                         ///> DepthIndex passed by control when connect to stage
+  TextAbstraction::FontClient mFontClient;            ///< The font client used to supply glyph information
+  Shader mShaderL8;                                   ///< The shader for glyphs and emoji's shadows.
+  Shader mShaderRgba;                                 ///< The shader for emojis.
+  std::vector< MaxBlockSize > mBlockSizes;            ///< Maximum size needed to contain a glyph in a block within a new atlas
+  Vector< TextCacheEntry > mTextCache;                ///< Caches data from previous render
+  Property::Map mQuadVertexFormat;                    ///< Describes the vertex format for text
+  int mDepth;                                         ///< DepthIndex passed by control when connect to stage
 };
 
 Text::RendererPtr AtlasRenderer::New()
index 62e3b14..3df8bbe 100644 (file)
@@ -248,6 +248,8 @@ PixelData Typesetter::Render( const Vector2& size )
 
       // Retrieves the glyph's bitmap.
       glyphData.glyphBitmap.buffer = NULL;
+      glyphData.glyphBitmap.width = glyphInfo->width;   // Desired width and height.
+      glyphData.glyphBitmap.height = glyphInfo->height;
       fontClient.CreateBitmap( glyphInfo->fontId,
                                glyphInfo->index,
                                glyphData.glyphBitmap );
index c7adc7b..2c1b772 100644 (file)
@@ -2216,6 +2216,12 @@ void Controller::Impl::RepositionSelectionHandles( float visualX, float visualY
     mEventData->mUpdateRightSelectionPosition = true;
     mEventData->mUpdateHighlightBox = true;
 
+    // It may happen an IMF commit event arrives before the selection event
+    // if the IMF manager is in pre-edit state. The commit event will set the
+    // mEventData->mUpdateCursorPosition flag to true. If it's not set back
+    // to false, the highlight box won't be updated.
+    mEventData->mUpdateCursorPosition = false;
+
     mEventData->mScrollAfterUpdatePosition = ( mEventData->mLeftSelectionPosition != mEventData->mRightSelectionPosition );
   }
   else
index 2b58ce9..0031bc3 100644 (file)
@@ -113,6 +113,11 @@ void AnimatedImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV );
 }
 
+void AnimatedImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void AnimatedImageVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   // url already passed in from constructor
index d19fd09..e89fec6 100644 (file)
@@ -99,6 +99,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 13b8633..2329167 100644 (file)
@@ -226,6 +226,11 @@ void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::BorderVisual::Property::ANTI_ALIASING, mAntiAliasing );
 }
 
+void BorderVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void BorderVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index 7efb142..473080b 100644 (file)
@@ -91,6 +91,11 @@ protected:
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
   /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
    * @copydoc Visual::Base::OnSetTransform
    */
   virtual void OnSetTransform();
index 0ac80d6..1691888 100644 (file)
@@ -138,6 +138,12 @@ void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mImpl->mMixColor );
 }
 
+void ColorVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
+
 void ColorVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index e5f6df1..939d40e 100644 (file)
@@ -65,6 +65,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 4ea6a28..fbce369 100644 (file)
@@ -323,6 +323,11 @@ void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void GradientVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void GradientVisual::InitializeRenderer()
 {
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
index c64b588..9c84cf2 100644 (file)
@@ -100,6 +100,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index f6e2a9f..aa3c118 100644 (file)
@@ -789,6 +789,22 @@ void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV );
 }
 
+void ImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  map.Clear();
+  map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::IMAGE );
+  if( !mImageUrl.empty() )
+  {
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, mDesiredSize.GetWidth() );
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, mDesiredSize.GetHeight() );
+  }
+  else if( mImage )
+  {
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, static_cast<int>(mImage.GetWidth()) );
+    map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, static_cast<int>(mImage.GetHeight()) );
+  }
+}
+
 void ImageVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index 52312ea..b0cc262 100644 (file)
@@ -152,6 +152,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 051dfa3..190c457 100644 (file)
@@ -533,6 +533,11 @@ void MeshVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::MeshVisual::Property::LIGHT_POSITION, mLightPosition );
 }
 
+void MeshVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void MeshVisual::InitializeRenderer()
 {
   //Try to load the geometry from the file.
index 2c227a3..511ce49 100644 (file)
@@ -75,6 +75,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 6ecb818..31e6344 100644 (file)
@@ -324,6 +324,11 @@ void NPatchVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::BORDER_ONLY, mBorderOnly );
 }
 
+void NPatchVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
   mLoader( factoryCache.GetNPatchLoader() ),
index 0a0465f..22b60d5 100644 (file)
@@ -100,6 +100,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 748564e..9d306be 100644 (file)
@@ -438,6 +438,11 @@ void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::PrimitiveVisual::Property::LIGHT_POSITION, mLightPosition );
 }
 
+void PrimitiveVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void PrimitiveVisual::OnSetTransform()
 {
   if( mImpl->mRenderer )
index 6b210bd..677df9d 100644 (file)
@@ -122,6 +122,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index ad352af..73d29e0 100644 (file)
@@ -144,6 +144,11 @@ void SvgVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void SvgVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void SvgVisual::ParseFromUrl( const std::string& imageUrl )
 {
   mImageUrl = imageUrl;
index 26e7208..3369901 100644 (file)
@@ -90,6 +90,11 @@ public:  // from Visual
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 55b1478..77a680f 100644 (file)
@@ -261,6 +261,16 @@ void TextVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::TextVisual::Property::ENABLE_MARKUP, mController->IsMarkupProcessorEnabled() );
 }
 
+void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  map.Clear();
+  map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::DevelVisual::TEXT );
+  std::string text;
+  mController->GetText( text );
+  map.Insert( Toolkit::TextVisual::Property::TEXT, text );
+}
+
+
 TextVisual::TextVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
   mController( Text::Controller::New() ),
index b0bf8c3..b11f548 100644 (file)
@@ -98,6 +98,11 @@ public: // from Visual::Base
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
 protected:
 
   /**
index 0d2b050..bfd5293 100644 (file)
@@ -287,6 +287,20 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const
   map.Insert( DevelVisual::Property::OPACITY, mImpl->mMixColor.a );
 }
 
+void Visual::Base::CreateInstancePropertyMap( Property::Map& map ) const
+{
+  DoCreateInstancePropertyMap( map );
+
+  if( mImpl->mCustomShader )
+  {
+    mImpl->mCustomShader->CreatePropertyMap( map );
+  }
+
+  //map.Insert( DevelVisual::Property::DEPTH_INDEX, mImpl->mDepthIndex );
+  //map.Insert( DevelVisual::Property::ENABLED, (bool) mImpl->mRenderer );
+}
+
+
 void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
 {
   if( preMultipled )
index e7d8ddd..15b2539 100644 (file)
@@ -131,6 +131,16 @@ public:
   void CreatePropertyMap( Property::Map& map ) const;
 
   /**
+   * @brief Create a property map containing per-instance visual properties.
+   *
+   * This will enable creation of new visuals on control state change with
+   * any alternative style properties and the relevant instance properties
+   * (e.g. for image visual, the desired size, and for text visual, the actual text).
+   * @param[in] map The property map into which to write
+   */
+  void CreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
    * @brief Set whether the Pre-multiplied Alpha Blending is required
    *
    * @param[in] preMultipled whether alpha is pre-multiplied.
@@ -222,6 +232,15 @@ protected:
   virtual void DoCreatePropertyMap( Property::Map& map ) const = 0;
 
   /**
+   * @brief Called by CreateInstancePropertyMap() allowing derived
+   * classes to store instanced data (separate to styled data) that
+   * needs copying between visuals on state change.
+   *
+   * @param[out] map The visual property map
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const = 0;
+
+  /**
    * @brief Called by SetProperties() allowing sub classes to set their properties
    *
    * @param[in] propertyMap The properties for the requested Visual object.
index 764ba27..990b25f 100644 (file)
@@ -153,6 +153,11 @@ void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void WireframeVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
 void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   Property::Value* mixValue = propertyMap.Find( Toolkit::DevelVisual::Property::MIX_COLOR, MIX_COLOR );
index f446806..9edeca8 100644 (file)
@@ -109,6 +109,11 @@ protected: // from Visual::Base
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
   /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
    * @copydoc Visual::Base::DoSetProperties()
    */
   virtual void DoSetProperties( const Property::Map& propertyMap );
index e77c28b..c89ae0c 100644 (file)
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/styling/style-manager.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
@@ -535,13 +537,233 @@ public:
     return value;
   }
 
-  void SetState( DevelControl::State state, bool withTransitions=true )
+
+  void CopyInstancedProperties( RegisteredVisualContainer& visuals, Dictionary<Property::Map>& instancedProperties )
+  {
+    for(RegisteredVisualContainer::Iterator iter = visuals.Begin(); iter!= visuals.End(); iter++)
+    {
+      if( (*iter)->visual )
+      {
+        Property::Map instanceMap;
+        Toolkit::GetImplementation((*iter)->visual).CreateInstancePropertyMap(instanceMap);
+        instancedProperties.Add( (*iter)->visual.GetName(), instanceMap );
+      }
+    }
+  }
+
+  template<typename T>
+  void Remove( Dictionary<T>& keyValues, const std::string& name )
+  {
+    keyValues.Remove(name);
+  }
+
+  void Remove( DictionaryKeys& keys, const std::string& name )
+  {
+    DictionaryKeys::iterator iter = std::find( keys.begin(), keys.end(), name );
+    if( iter != keys.end())
+    {
+      keys.erase(iter);
+    }
+  }
+
+  void FindChangableVisuals( Dictionary<Property::Map>& stateVisualsToAdd,
+                             Dictionary<Property::Map>& stateVisualsToChange,
+                             DictionaryKeys& stateVisualsToRemove)
+  {
+    DictionaryKeys copyOfStateVisualsToRemove = stateVisualsToRemove;
+
+    for( DictionaryKeys::iterator iter = copyOfStateVisualsToRemove.begin();
+         iter != copyOfStateVisualsToRemove.end(); ++iter )
+    {
+      const std::string& visualName = (*iter);
+      Property::Map* toMap = stateVisualsToAdd.Find( visualName );
+      if( toMap )
+      {
+        stateVisualsToChange.Add( visualName, *toMap );
+        stateVisualsToAdd.Remove( visualName );
+        Remove( stateVisualsToRemove, visualName );
+      }
+    }
+  }
+
+  void RemoveVisual( RegisteredVisualContainer& visuals, const std::string& visualName )
+  {
+    Actor self( mControlImpl.Self() );
+
+    for ( RegisteredVisualContainer::Iterator visualIter = visuals.Begin();
+          visualIter != visuals.End(); ++visualIter )
+    {
+      Toolkit::Visual::Base visual = (*visualIter)->visual;
+      if( visual && visual.GetName() == visualName )
+      {
+        Toolkit::GetImplementation(visual).SetOffStage( self );
+        (*visualIter)->visual.Reset();
+        visuals.Erase( visualIter );
+        break;
+      }
+    }
+  }
+
+  void RemoveVisuals( RegisteredVisualContainer& visuals, DictionaryKeys& removeVisuals )
+  {
+    Actor self( mControlImpl.Self() );
+    for( DictionaryKeys::iterator iter = removeVisuals.begin(); iter != removeVisuals.end(); ++iter )
+    {
+      const std::string visualName = *iter;
+      RemoveVisual( visuals, visualName );
+    }
+  }
+
+  Toolkit::Visual::Type GetVisualTypeFromMap( const Property::Map& map )
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::Property::TYPE, VISUAL_TYPE  );
+    Toolkit::Visual::Type type = Toolkit::Visual::IMAGE;
+    if( typeValue )
+    {
+      Scripting::GetEnumerationProperty( *typeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, type );
+    }
+    return type;
+  }
+
+  /**
+   * Go through the list of visuals that are common to both states.
+   * If they are different types, or are both image types with different
+   * URLs, then the existing visual needs moving and the new visual creating
+   */
+  void RecreateChangedVisuals( Dictionary<Property::Map>& stateVisualsToChange,
+                               Dictionary<Property::Map>& instancedProperties )
+  {
+    Dali::CustomActor handle( mControlImpl.GetOwner() );
+    for( Dictionary<Property::Map>::iterator iter = stateVisualsToChange.Begin();
+         iter != stateVisualsToChange.End(); ++iter )
+    {
+      const std::string& visualName = (*iter).key;
+      const Property::Map& toMap = (*iter).entry;
+
+      // is it a candidate for re-creation?
+      bool recreate = false;
+
+      Toolkit::Visual::Base visual = GetVisualByName( mVisuals, visualName );
+      if( visual )
+      {
+        Property::Map fromMap;
+        visual.CreatePropertyMap( fromMap );
+
+        Toolkit::Visual::Type fromType = GetVisualTypeFromMap( fromMap );
+        Toolkit::Visual::Type toType = GetVisualTypeFromMap( toMap );
+
+        if( fromType != toType )
+        {
+          recreate = true;
+        }
+        else
+        {
+          if( fromType == Toolkit::Visual::IMAGE )
+          {
+            Property::Value* fromUrl = fromMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+            Property::Value* toUrl = toMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+
+            if( fromUrl && toUrl )
+            {
+              std::string fromUrlString;
+              std::string toUrlString;
+              fromUrl->Get(fromUrlString);
+              toUrl->Get(toUrlString);
+
+              if( fromUrlString != toUrlString )
+              {
+                recreate = true;
+              }
+            }
+          }
+        }
+
+        const Property::Map* instancedMap = instancedProperties.FindConst( visualName );
+        if( recreate || instancedMap )
+        {
+          RemoveVisual( mVisuals, visualName );
+          Style::ApplyVisual( handle, visualName, toMap, instancedMap );
+        }
+        else
+        {
+          // @todo check to see if we can apply toMap without recreating the visual
+          // e.g. by setting only animatable properties
+          // For now, recreate all visuals, but merge in instance data.
+          RemoveVisual( mVisuals, visualName );
+          Style::ApplyVisual( handle, visualName, toMap, instancedMap );
+        }
+      }
+    }
+  }
+
+  void ReplaceStateVisualsAndProperties( const StylePtr oldState, const StylePtr newState, const std::string& subState )
+  {
+    // Collect all old visual names
+    DictionaryKeys stateVisualsToRemove;
+    if( oldState )
+    {
+      oldState->visuals.GetKeys( stateVisualsToRemove );
+      if( ! subState.empty() )
+      {
+        const StylePtr* oldSubState = oldState->subStates.FindConst(subState);
+        if( oldSubState )
+        {
+          DictionaryKeys subStateVisualsToRemove;
+          (*oldSubState)->visuals.GetKeys( subStateVisualsToRemove );
+          Merge( stateVisualsToRemove, subStateVisualsToRemove );
+        }
+      }
+    }
+
+    // Collect all new visual properties
+    Dictionary<Property::Map> stateVisualsToAdd;
+    if( newState )
+    {
+      stateVisualsToAdd = newState->visuals;
+      if( ! subState.empty() )
+      {
+        const StylePtr* newSubState = newState->subStates.FindConst(subState);
+        if( newSubState )
+        {
+          stateVisualsToAdd.Merge( (*newSubState)->visuals );
+        }
+      }
+    }
+
+    // If a name is in both add/remove, move it to change list.
+    Dictionary<Property::Map> stateVisualsToChange;
+    FindChangableVisuals( stateVisualsToAdd, stateVisualsToChange, stateVisualsToRemove);
+
+    // Copy instanced properties (e.g. text label) of current visuals
+    Dictionary<Property::Map> instancedProperties;
+    CopyInstancedProperties( mVisuals, instancedProperties );
+
+    // For each visual in remove list, remove from mVisuals
+    RemoveVisuals( mVisuals, stateVisualsToRemove );
+
+    // For each visual in add list, create and add to mVisuals
+    Dali::CustomActor handle( mControlImpl.GetOwner() );
+    Style::ApplyVisuals( handle, stateVisualsToAdd, instancedProperties );
+
+    // For each visual in change list, if it requires a new visual,
+    // remove old visual, create and add to mVisuals
+    RecreateChangedVisuals( stateVisualsToChange, instancedProperties );
+  }
+
+  void SetState( DevelControl::State newState, bool withTransitions=true )
   {
-    if( mState != state )
+    DevelControl::State oldState = mState;
+    Dali::CustomActor handle( mControlImpl.GetOwner() );
+    DALI_LOG_INFO(gLogFilter, Debug::Concise, "Control::Impl::SetState: %s\n",
+                  (mState == DevelControl::NORMAL ? "NORMAL" :(
+                    mState == DevelControl::FOCUSED ?"FOCUSED" : (
+                      mState == DevelControl::DISABLED?"DISABLED":"NONE" ))));
+
+    if( mState != newState )
     {
       // If mState was Disabled, and new state is Focused, should probably
       // store that fact, e.g. in another property that FocusManager can access.
-      mState = state;
+      mState = newState;
 
       // Trigger state change and transitions
       // Apply new style, if stylemanager is available
@@ -549,15 +771,19 @@ public:
       if( styleManager )
       {
         const StylePtr stylePtr = GetImpl( styleManager ).GetRecordedStyle( Toolkit::Control( mControlImpl.GetOwner() ) );
+
         if( stylePtr )
         {
-          for( int i=mVisuals.Count()-1; i >= 0; i-- )
+          std::string oldStateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( oldState, ControlStateTable, ControlStateTableCount );
+          std::string newStateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( newState, ControlStateTable, ControlStateTableCount );
+
+          const StylePtr* newStateStyle = stylePtr->subStates.Find( newStateName );
+          const StylePtr* oldStateStyle = stylePtr->subStates.Find( oldStateName );
+          if( oldStateStyle && newStateStyle )
           {
-            mControlImpl.UnregisterVisual( mVisuals[i]->index );
+            // Only change if both state styles exist
+            ReplaceStateVisualsAndProperties( *oldStateStyle, *newStateStyle, mSubStateName );
           }
-
-          Dali::CustomActor handle( mControlImpl.GetOwner() );
-          stylePtr->ApplyVisualsAndPropertiesRecursively( handle );
         }
       }
     }
@@ -584,30 +810,12 @@ public:
           {
             StylePtr stateStyle(*state);
 
-            // Unregister existing visuals of this substate
-            const StylePtr* subState = stateStyle->subStates.Find( mSubStateName );
-            if( subState )
-            {
-              StylePtr subStateStyle(*subState);
-
-              for( Dictionary<Property::Map>::iterator iter = subStateStyle->visuals.Begin(); iter != subStateStyle->visuals.End(); ++iter )
-              {
-                const std::string& visualName = (*iter).key;
-                Dali::Property::Index index = handle.GetPropertyIndex( visualName );
-                if( index != Property::INVALID_INDEX )
-                {
-                  mControlImpl.UnregisterVisual( index );
-                }
-              }
-            }
-
-            // Register visuals of the new substate
-            const StylePtr* newSubState = stateStyle->subStates.Find( subStateName );
-            if( newSubState )
+            const StylePtr* newStateStyle = stateStyle->subStates.Find( subStateName );
+            const StylePtr* oldStateStyle = stateStyle->subStates.Find( mSubStateName );
+            if( oldStateStyle && newStateStyle )
             {
-              StylePtr newSubStateStyle(*newSubState);
-              newSubStateStyle->ApplyVisuals( handle );
-              newSubStateStyle->ApplyProperties( handle );
+              std::string empty;
+              ReplaceStateVisualsAndProperties( *oldStateStyle, *newStateStyle, empty );
             }
           }
         }
index 6ebc98e..f193e71 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 = 27;
+const unsigned int TOOLKIT_MICRO_VERSION = 29;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index ff865b0..bd48ca7 100644 (file)
     "TextSelectionScrollBar":
     {
       "indicatorShowDuration":0.25,
-      "indicatorHideDuration":0.25
+      "indicatorHideDuration":0.25,
+      "indicatorTransientDuration":1.0
     },
     "TextSelectionScrollIndicator":
     {
index 105b87b..43b99ea 100644 (file)
     "TextSelectionScrollBar":
     {
       "indicatorShowDuration":0.25,
-      "indicatorHideDuration":0.25
+      "indicatorHideDuration":0.25,
+      "indicatorTransientDuration":1.0
     },
     "TextSelectionScrollIndicator":
     {
index db96431..aa735b3 100644 (file)
     "TextSelectionScrollBar":
     {
       "indicatorShowDuration":0.25,
-      "indicatorHideDuration":0.25
+      "indicatorHideDuration":0.25,
+      "indicatorTransientDuration":1.0
     },
     "TextSelectionScrollIndicator":
     {
index 6f95ef9..d56fdbe 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-addon
 Summary:    DALi module for Node.JS
-Version:    1.2.27
+Version:    1.2.29
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 9f0cb7a..ae143f7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.27
+Version:    1.2.29
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
index b59ff97..98a45f5 100755 (executable)
@@ -23,8 +23,6 @@
 %apply float& OUTPUT { float& viewportX };
 %apply float& OUTPUT { float& viewportY };
 
-#if defined(SWIGCSHARP)
-
 %include arrays_csharp.i
 %apply unsigned char INPUT[] { unsigned char* pixelBuffer}
 %apply unsigned char INPUT[] { unsigned char* buffer}
@@ -38,8 +36,6 @@
 %apply unsigned short INPUT[] { unsigned short* indices}
 %apply float INPUT[] { float* array }
 
-#endif
-
 %ignore *::Animation(Internal::Animation*);
 %ignore *::Actor(Internal::Actor*);
 %ignore *::BufferImage(Internal::BufferImage*);
@@ -86,6 +82,7 @@
 %ignore *::GetKeyValue(SizeType) const;
 %ignore *::TypeInfo::GetCreator() const;
 %ignore Dali::Stage::TouchedSignal;
+%ignore Dali::DevelActor::Property::Type;
 
 %rename(ParentOriginTop) Dali::ParentOrigin::TOP;
 %rename(ParentOriginBottom) Dali::ParentOrigin::BOTTOM;
 %rename(Z) Dali::Vector4::z;
 %rename(W) Dali::Vector4::w;
 
-
 typedef std::pair<std::string, Dali::Property::Value> StringValuePair;
 typedef std::vector<Dali::TouchPoint> TouchPointContainer;
 typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair;
@@ -250,6 +246,7 @@ typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair;
 %include <dali/public-api/events/wheel-event.h>
 
 %include <dali/public-api/actors/actor.h>
+%include <dali/devel-api/actors/actor-devel.h>
 %include <dali/public-api/actors/layer.h>
 %include <dali/public-api/common/stage.h>
 %include <dali/public-api/size-negotiation/relayout-container.h>
@@ -292,7 +289,6 @@ typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair;
 %template(VectorUnsignedChar) Dali::Vector<unsigned char>;
 %template(VectorUint16Pair) Dali::Vector<Dali::Uint16Pair>;
 %template(VoidSignal) Dali::Signal<void()>;
-%template(BoolSignal) Dali::Signal<bool()>;
 %template(FloatSignal) Dali::Signal<void(float)>;
 %template(ObjectCreatedSignal) Dali::Signal<void(Dali::BaseHandle)>;
 %template(ObjectDestroyedSignal) Dali::Signal<void(const Dali::RefObject*)>;
index 8017ecc..3ef430c 100644 (file)
@@ -615,6 +615,9 @@ DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void (const Dali::Touch
 //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_RENAME( Dali, Signal<void(Dali::Toolkit::ProgressBar, float, float)>, ProgressBarValueChangedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::ProgressBar, float, float)>, ProgressBarValueChangedSignal);
+
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, ApplicationExtensions );
 DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, ApplicationExtensions );
 
index d70cc93..7d83bf8 100755 (executable)
@@ -311,6 +311,7 @@ typedef Dali::IntrusivePtr<Dali::Toolkit::Ruler> RulerPtr;
 %template(GaussianBlurViewSignal) Dali::Signal<void (Dali::Toolkit::GaussianBlurView)>;
 %template(PageTurnSignal) Dali::Signal<void(Dali::Toolkit::PageTurnView, unsigned int, bool)>;
 %template(PagePanSignal) Dali::Signal<void(Dali::Toolkit::PageTurnView)>;
+%template(ProgressBarValueChangedSignal) Dali::Signal<void(Dali::Toolkit::ProgressBar, float, float)>;
 %template(ScrollViewSnapStartedSignal) Dali::Signal< void(const Dali::Toolkit::ScrollView::SnapEvent&)>;
 %template(ScrollableSignal) Dali::Signal< void(const Dali::Vector2&)>;
 %template(TextEditorSignal) Dali::Signal<void(Dali::Toolkit::TextEditor)>;
index 4473091..1cd7ef8 100755 (executable)
@@ -49,6 +49,8 @@
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
 
+#include <dali/devel-api/actors/actor-devel.h>
+
 #include <dali/public-api/math/matrix.h>
 #include <dali/public-api/math/matrix3.h>
 #include <dali/public-api/math/viewport.h>
@@ -265,6 +267,7 @@ using namespace Dali::Toolkit;
 %include events/pinchgesture-event.i
 %include events/pageturnview-event.i
 %include events/pangesture-event.i
+%include events/progress-bar-event.i
 %include events/propertynotification-event.i
 %include events/longpressgesture-event.i
 %include events/rectangle.i
index f4d6d1c..a2fa54e 100755 (executable)
     {
       SetVisible(false);
     }
+
+    public void Raise()
+    {
+      NDalicPINVOKE.Raise(swigCPtr);
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public void Lower()
+    {
+      NDalicPINVOKE.Lower(swigCPtr);
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public void RaiseToTop()
+    {
+      NDalicPINVOKE.RaiseToTop(swigCPtr);
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public void LowerToBottom()
+    {
+      NDalicPINVOKE.LowerToBottom(swigCPtr);
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public void RaiseAbove(Actor target)
+    {
+      NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target));
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
+    public void LowerBelow(Actor target)
+    {
+      NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target));
+      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    }
+
 %}
 
 %enddef
diff --git a/plugins/dali-swig/SWIG/events/progress-bar-event.i b/plugins/dali-swig/SWIG/events/progress-bar-event.i
new file mode 100644 (file)
index 0000000..4e1aaf0
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * 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 PROGRESS_BAR_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
+%typemap(csimports) NameSpace::ClassName %{
+using System;
+using System.Runtime.InteropServices;
+
+%}
+%enddef
+
+%define PROGRESS_BAR_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
+%typemap(cscode) NameSpace::ClassName %{
+
+public class ValueChangedEventArgs : EventArgs
+{
+   private ProgressBar _progressBar;
+   private float _progressValue;
+   private float _secondaryProgressValue;
+
+   public ProgressBar ProgressBar
+   {
+      get
+      {
+         return _progressBar;
+      }
+      set
+      {
+         _progressBar = value;
+      }
+   }
+
+   public float ProgressValue
+   {
+      get
+      {
+         return _progressValue;
+      }
+      set
+      {
+         _progressValue = value;
+      }
+   }
+
+   public float SecondaryProgressValue
+   {
+      get
+      {
+         return _secondaryProgressValue;
+      }
+      set
+      {
+         _secondaryProgressValue = value;
+      }
+   }
+
+}
+
+  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+  private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
+  private DaliEventHandler<object,ValueChangedEventArgs> _progressBarValueChangedEventHandler;
+  private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
+
+  public event DaliEventHandler<object,ValueChangedEventArgs> ValueChanged
+  {
+     add
+     {
+        lock(this)
+        {
+           // Restricted to only one listener
+           if (_progressBarValueChangedEventHandler == null)
+           {
+              _progressBarValueChangedEventHandler += value;
+
+              _progressBarValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
+              this.ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
+           }
+        }
+     }
+
+     remove
+     {
+        lock(this)
+        {
+           if (_progressBarValueChangedEventHandler != null)
+           {
+              this.ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
+           }
+
+           _progressBarValueChangedEventHandler -= value;
+        }
+     }
+  }
+
+  // Callback for ProgressBar ValueChanged signal
+  private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
+  {
+     ValueChangedEventArgs e = new ValueChangedEventArgs();
+
+     // Populate all members of "e" (ValueChangedEventArgs) with real page
+     e.ProgressBar = ProgressBar.GetProgressBarFromPtr( progressBar );
+     e.ProgressValue = progressValue;
+     e.SecondaryProgressValue = secondaryProgressValue;
+
+     if (_progressBarValueChangedEventHandler != null)
+     {
+       _progressBarValueChangedEventHandler(this, e);
+     }
+  }
+
+  public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
+    ClassName ret = new ClassName(cPtr, false);
+   if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+%}
+
+%enddef
+
+
+%define DALI_PROGRESS_BAR_EVENTHANDLER_PARAM( NameSpace, ClassName)
+
+  PROGRESS_BAR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
+  PROGRESS_BAR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
+
+%enddef
+
+namespace Dali
+{
+  DALI_PROGRESS_BAR_EVENTHANDLER_PARAM( Dali::Toolkit, ProgressBar);
+}
index 1604a08..00dae5b 100644 (file)
@@ -44,7 +44,7 @@ using System.Runtime.InteropServices;
     * (in the type of TickEventHandler-DaliEventHandlerWithReturnType<object,TickEventArgs,bool>) 
     * provided by the user. Ticked signal is emitted after specified time interval.
     */
-  public event DaliEventHandlerWithReturnType<object,TickEventArgs,bool> Ticked
+  public event DaliEventHandlerWithReturnType<object,TickEventArgs,bool> Tick
   {
      add
      {
@@ -102,5 +102,5 @@ using System.Runtime.InteropServices;
 
 namespace Dali
 {
-  DALI_TIMER_EVENTHANDLER_PARAM( Dali::Adaptor, Timer);
+  DALI_TIMER_EVENTHANDLER_PARAM( Dali, Timer);
 }
index e7aa444..0842c9b 100644 (file)
  Macros for signals with return values
 *****************/
 
+// 0 param signals ( with return )
+%define DALI_SIGNAL_0_PARAM_RETURN( returnType )
+
+  SIGNAL_TYPEMAP_HELPER( returnType (*func) () );
+  SIGNAL_TEMPLATE_HELPER_0( returnType, return);
+%enddef
+
 // 1 param signals ( with return )
 %define DALI_SIGNAL_1_PARAM_RETURN( returnType, argumentType1 )
 
@@ -249,6 +256,9 @@ namespace Dali
 // Signal< void () >
 DALI_SIGNAL_0_PARAM();
 
+// Signal< bool () >
+DALI_SIGNAL_0_PARAM_RETURN( bool );
+
 // Signal< void (Actor) >
 DALI_SIGNAL_1_PARAM( Dali::Actor );
 
@@ -351,6 +361,9 @@ DALI_SIGNAL_3_PARAM( Dali::Toolkit::PageTurnView, unsigned int, bool );
 // void Signal< Dali::Toolkit::PageTurnView >;
 DALI_SIGNAL_1_PARAM( Dali::Toolkit::PageTurnView );
 
+// void Signal< Dali::Toolkit::ProgressBar, float, float >;
+DALI_SIGNAL_3_PARAM( Dali::Toolkit::ProgressBar, float, float );
+
 // void Signal< const Dali::Toolkit::ScrollView::SnapEvent& >;
 DALI_SIGNAL_1_PARAM( const Dali::Toolkit::ScrollView::SnapEvent& );
 
index 0ddd6f1..3ec656e 100755 (executable)
@@ -40,14 +40,16 @@ namespace MyCSharpExample
 
     private Dali.Application _application;
     private TableView _contentContainer;
+    private Timer _timer;
     private Stage _stage;
     private Popup _popup;
+    private ProgressBar _progressBar;
 
     // List of items
     private Item[] mViewList = {
       new Item("PushButton", true),  new Item("DropDown", false),    new Item("Toggle", true),
       new Item("InputField", false),  new Item("AnimateGif", false),  new Item("Loading", false),
-      new Item("ProgressBar", false), new Item("CheckBox", false),    new Item("RadioButton", true),
+      new Item("ProgressBar", true), new Item("CheckBox", false),    new Item("RadioButton", true),
       new Item("Tooltip", true),     new Item("Popup", true),       new Item("Toast", true),
       new Item("ItemView", false),    new Item("CheckBox", true)
     };
@@ -191,7 +193,33 @@ namespace MyCSharpExample
         }
         if (item.name.CompareTo("ProgressBar") == 0)
         {
+          _progressBar = new ProgressBar();
+          _progressBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+          _progressBar.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
+          _progressBar.SetSize( 0, 50 );
 
+          _progressBar.ValueChanged += OnProgressBarValueChanged;
+
+          _timer = new Timer( 100 );
+          _timer.Tick += ( obj, e ) =>
+          {
+            float progress = (float)Math.Round( _progressBar.ProgressValue , 2 );
+
+            if( progress == 1.0f )
+            {
+              _progressBar.ProgressValue = 0.0f;
+              _progressBar.SecondaryProgressValue = 0.01f;
+            }
+            else
+            {
+              _progressBar.ProgressValue = progress + 0.01f;
+              _progressBar.SecondaryProgressValue = progress + 0.21f;
+            }
+            return true;
+          };
+          _timer.Start();
+
+          _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
         }
         if (item.name.CompareTo("ScrollBar") == 0)
         {
@@ -414,6 +442,15 @@ namespace MyCSharpExample
       return cancelButton;
     }
 
+    void OnProgressBarValueChanged( object source, ProgressBar.ValueChangedEventArgs e )
+    {
+      Property.Map labelVisual = new Property.Map();
+      labelVisual.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text) )
+        .Add( Dali.Constants.TextVisualProperty.Text, new Property.Value( Math.Round( e.ProgressBar.ProgressValue, 2 ) +" / "+Math.Round( e.ProgressBar.SecondaryProgressValue, 2 )) );
+      e.ProgressBar.LabelVisual = labelVisual;
+      return;
+    }
+
     public void MainLoop()
     {
       _application.MainLoop();
index dbc388c..daa7326 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ namespace MyCSharpExample
             constants.Insert( "CONFIG_SCRIPT_LOG_LEVEL",  new Property.Value( "Verbose") );
             _builder.AddConstants( constants );
 
-            _builder.LoadFromFile( "./json/date-picker.json" );
+            _builder.LoadFromFile( "./json/date-picker-template.json" );
 
             // create the date-picker from the template in the json file
             BaseHandle handle =  _builder.Create( "date-picker");
index 9bf6950..d0d531a 100644 (file)
@@ -35,24 +35,28 @@ SwigDirector_ViewWrapperImpl::~SwigDirector_ViewWrapperImpl() {
 
 
 void SwigDirector_ViewWrapperImpl::OnStageConnection(int depth) {
-    Dali::Toolkit::Internal::Control::OnStageConnection(depth);
     swig_callbackOnStageConnection(depth);
+
+    Dali::Toolkit::Internal::Control::OnStageConnection(depth);
 }
 
 void SwigDirector_ViewWrapperImpl::OnStageDisconnection() {
     swig_callbackOnStageDisconnection();
+
     Dali::Toolkit::Internal::Control::OnStageDisconnection();
 }
 
 void SwigDirector_ViewWrapperImpl::OnChildAdd(Dali::Actor &child) {
-    Dali::Toolkit::Internal::Control::OnChildAdd( child );
     void * jchild = (Dali::Actor *) &child;
     swig_callbackOnChildAdd(jchild);
+
+    Dali::Toolkit::Internal::Control::OnChildAdd( child );
 }
 
 void SwigDirector_ViewWrapperImpl::OnChildRemove(Dali::Actor &child) {
     void * jchild = (Dali::Actor *) &child;
     swig_callbackOnChildRemove(jchild);
+
     Dali::Toolkit::Internal::Control::OnChildRemove( child );
 }
 
@@ -60,24 +64,23 @@ void SwigDirector_ViewWrapperImpl::OnPropertySet(Dali::Property::Index index, Da
   int jindex  ;
   void * jpropertyValue  ;
 
-  if (!swig_callbackOnPropertySet) {
-    Dali::Toolkit::Internal::ControlWrapper::OnPropertySet(index,propertyValue);
-    return;
-  } else {
-    jindex = index;
-    jpropertyValue = (void *)new Dali::Property::Value((const Dali::Property::Value &)propertyValue);
-    swig_callbackOnPropertySet(jindex, jpropertyValue);
-  }
+  jindex = index;
+  jpropertyValue = (void *)new Dali::Property::Value((const Dali::Property::Value &)propertyValue);
+  swig_callbackOnPropertySet(jindex, jpropertyValue);
+
+  Dali::Toolkit::Internal::ControlWrapper::OnPropertySet(index,propertyValue);
 }
 
 void SwigDirector_ViewWrapperImpl::OnSizeSet(Dali::Vector3 const &targetSize) {
-  Dali::Toolkit::Internal::Control::OnSizeSet(targetSize);
   swig_callbackOnSizeSet((Dali::Vector3 *) &targetSize);
+
+  Dali::Toolkit::Internal::Control::OnSizeSet(targetSize);
 }
 
 void SwigDirector_ViewWrapperImpl::OnSizeAnimation(Dali::Animation &animation, Dali::Vector3 const &targetSize) {
-  Dali::Toolkit::Internal::Control::OnSizeAnimation(animation,targetSize);
   swig_callbackOnSizeAnimation(&animation, (Dali::Vector3 *) &targetSize);
+
+  Dali::Toolkit::Internal::Control::OnSizeAnimation(animation,targetSize);
 }
 
 bool SwigDirector_ViewWrapperImpl::OnTouchEvent(Dali::TouchEvent const &event) {
@@ -144,28 +147,22 @@ void SwigDirector_ViewWrapperImpl::OnRelayout(Dali::Vector2 const &size, Dali::R
   void * jsize = 0 ;
   void * jcontainer = 0 ;
 
-  if (!swig_callbackOnRelayout) {
-    Dali::Toolkit::Internal::Control::OnRelayout(size,container);
-    return;
-  } else {
-    jsize = (Dali::Vector2 *) &size;
-    jcontainer = (Dali::RelayoutContainer *) &container;
-    swig_callbackOnRelayout(jsize, jcontainer);
-  }
+  jsize = (Dali::Vector2 *) &size;
+  jcontainer = (Dali::RelayoutContainer *) &container;
+  swig_callbackOnRelayout(jsize, jcontainer);
+
+  Dali::Toolkit::Internal::Control::OnRelayout(size,container);
 }
 
 void SwigDirector_ViewWrapperImpl::OnSetResizePolicy(Dali::ResizePolicy::Type policy, Dali::Dimension::Type dimension) {
   int jpolicy  ;
   int jdimension  ;
 
-  if (!swig_callbackOnSetResizePolicy) {
-    Dali::Toolkit::Internal::Control::OnSetResizePolicy(policy,dimension);
-    return;
-  } else {
-    jpolicy = (int)policy;
-    jdimension = (int)dimension;
-    swig_callbackOnSetResizePolicy(jpolicy, jdimension);
-  }
+  jpolicy = (int)policy;
+  jdimension = (int)dimension;
+  swig_callbackOnSetResizePolicy(jpolicy, jdimension);
+
+  Dali::Toolkit::Internal::Control::OnSetResizePolicy(policy,dimension);
 }
 
 Dali::Vector3 SwigDirector_ViewWrapperImpl::GetNaturalSize() {
@@ -250,45 +247,38 @@ bool SwigDirector_ViewWrapperImpl::RelayoutDependentOnChildren(Dali::Dimension::
 void SwigDirector_ViewWrapperImpl::OnCalculateRelayoutSize(Dali::Dimension::Type dimension) {
   int jdimension  ;
 
-  if (!swig_callbackOnCalculateRelayoutSize) {
-    Dali::Toolkit::Internal::Control::OnCalculateRelayoutSize(dimension);
-    return;
-  } else {
-    jdimension = (int)dimension;
-    swig_callbackOnCalculateRelayoutSize(jdimension);
-  }
+  jdimension = (int)dimension;
+  swig_callbackOnCalculateRelayoutSize(jdimension);
+
+  Dali::Toolkit::Internal::Control::OnCalculateRelayoutSize(dimension);
 }
 
 void SwigDirector_ViewWrapperImpl::OnLayoutNegotiated(float size, Dali::Dimension::Type dimension) {
   float jsize  ;
   int jdimension  ;
 
-  if (!swig_callbackOnLayoutNegotiated) {
-    Dali::Toolkit::Internal::Control::OnLayoutNegotiated(size,dimension);
-    return;
-  } else {
-    jsize = size;
-    jdimension = (int)dimension;
-    swig_callbackOnLayoutNegotiated(jsize, jdimension);
-  }
+  jsize = size;
+  jdimension = (int)dimension;
+  swig_callbackOnLayoutNegotiated(jsize, jdimension);
+
+  Dali::Toolkit::Internal::Control::OnLayoutNegotiated(size,dimension);
 }
 
 void SwigDirector_ViewWrapperImpl::OnInitialize() {
-  if (!swig_callbackOnInitialize) {
-    Dali::Toolkit::Internal::Control::OnInitialize();
-    return;
-  } else {
-    swig_callbackOnInitialize();
-  }
+  swig_callbackOnInitialize();
+
+  Dali::Toolkit::Internal::Control::OnInitialize();
 }
 
 void SwigDirector_ViewWrapperImpl::OnControlChildAdd(Dali::Actor &child) {
-  Dali::Toolkit::Internal::Control::OnControlChildAdd(child);
   swig_callbackOnControlChildAdd(&child);
+
+  Dali::Toolkit::Internal::Control::OnControlChildAdd(child);
 }
 
 void SwigDirector_ViewWrapperImpl::OnControlChildRemove(Dali::Actor &child) {
   swig_callbackOnControlChildRemove(&child);
+
   Dali::Toolkit::Internal::Control::OnControlChildRemove(child);
 }
 
@@ -296,14 +286,11 @@ void SwigDirector_ViewWrapperImpl::OnStyleChange(Dali::Toolkit::StyleManager sty
   void * jstyleManager  ;
   int jchange  ;
 
-  if (!swig_callbackOnStyleChange) {
-    Dali::Toolkit::Internal::Control::OnStyleChange(styleManager,change);
-    return;
-  } else {
-    jstyleManager = (void *)new Dali::Toolkit::StyleManager((const Dali::Toolkit::StyleManager &)styleManager);
-    jchange = (int)change;
-    swig_callbackOnStyleChange(jstyleManager, jchange);
-  }
+  jstyleManager = (void *)new Dali::Toolkit::StyleManager((const Dali::Toolkit::StyleManager &)styleManager);
+  jchange = (int)change;
+  swig_callbackOnStyleChange(jstyleManager, jchange);
+
+  Dali::Toolkit::Internal::Control::OnStyleChange(styleManager,change);
 }
 
 bool SwigDirector_ViewWrapperImpl::OnAccessibilityActivated() {
@@ -378,21 +365,15 @@ bool SwigDirector_ViewWrapperImpl::OnAccessibilityZoom() {
 }
 
 void SwigDirector_ViewWrapperImpl::OnKeyInputFocusGained() {
-  if (!swig_callbackOnKeyInputFocusGained) {
-    Dali::Toolkit::Internal::Control::OnKeyInputFocusGained();
-    return;
-  } else {
-    swig_callbackOnKeyInputFocusGained();
-  }
+  swig_callbackOnKeyInputFocusGained();
+
+  Dali::Toolkit::Internal::Control::OnKeyInputFocusGained();
 }
 
 void SwigDirector_ViewWrapperImpl::OnKeyInputFocusLost() {
-  if (!swig_callbackOnKeyInputFocusLost) {
-    Dali::Toolkit::Internal::Control::OnKeyInputFocusLost();
-    return;
-  } else {
-    swig_callbackOnKeyInputFocusLost();
-  }
+  swig_callbackOnKeyInputFocusLost();
+
+  Dali::Toolkit::Internal::Control::OnKeyInputFocusLost();
 }
 
 Dali::Actor SwigDirector_ViewWrapperImpl::GetNextKeyboardFocusableActor(Dali::Actor currentFocusedActor, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) {
@@ -420,14 +401,10 @@ Dali::Actor SwigDirector_ViewWrapperImpl::GetNextKeyboardFocusableActor(Dali::Ac
 
 void SwigDirector_ViewWrapperImpl::OnKeyboardFocusChangeCommitted(Dali::Actor commitedFocusableActor) {
   void * jcommitedFocusableActor  ;
+  jcommitedFocusableActor = (void *)new Dali::Actor((const Dali::Actor &)commitedFocusableActor);
+  swig_callbackOnKeyboardFocusChangeCommitted(jcommitedFocusableActor);
 
-  if (!swig_callbackOnKeyboardFocusChangeCommitted) {
-    Dali::Toolkit::Internal::Control::OnKeyboardFocusChangeCommitted(commitedFocusableActor);
-    return;
-  } else {
-    jcommitedFocusableActor = (void *)new Dali::Actor((const Dali::Actor &)commitedFocusableActor);
-    swig_callbackOnKeyboardFocusChangeCommitted(jcommitedFocusableActor);
-  }
+  Dali::Toolkit::Internal::Control::OnKeyboardFocusChangeCommitted(commitedFocusableActor);
 }
 
 bool SwigDirector_ViewWrapperImpl::OnKeyboardEnter() {
@@ -445,78 +422,35 @@ bool SwigDirector_ViewWrapperImpl::OnKeyboardEnter() {
 
 void SwigDirector_ViewWrapperImpl::OnPinch(Dali::PinchGesture const &pinch) {
   void * jpinch = 0 ;
+  jpinch = (Dali::PinchGesture *) &pinch;
+  swig_callbackOnPinch(jpinch);
 
-  if (!swig_callbackOnPinch) {
-    Dali::Toolkit::Internal::Control::OnPinch(pinch);
-    return;
-  } else {
-    jpinch = (Dali::PinchGesture *) &pinch;
-    swig_callbackOnPinch(jpinch);
-  }
+  Dali::Toolkit::Internal::Control::OnPinch(pinch);
 }
 
 void SwigDirector_ViewWrapperImpl::OnPan(Dali::PanGesture const &pan) {
   void * jpan = 0 ;
+  jpan = (Dali::PanGesture *) &pan;
+  swig_callbackOnPan(jpan);
 
-  if (!swig_callbackOnPan) {
-    Dali::Toolkit::Internal::Control::OnPan(pan);
-    return;
-  } else {
-    jpan = (Dali::PanGesture *) &pan;
-    swig_callbackOnPan(jpan);
-  }
+  Dali::Toolkit::Internal::Control::OnPan(pan);
 }
 
 void SwigDirector_ViewWrapperImpl::OnTap(Dali::TapGesture const &tap) {
   void * jtap = 0 ;
+  jtap = (Dali::TapGesture *) &tap;
+  swig_callbackOnTap(jtap);
 
-  if (!swig_callbackOnTap) {
-    Dali::Toolkit::Internal::Control::OnTap(tap);
-    return;
-  } else {
-    jtap = (Dali::TapGesture *) &tap;
-    swig_callbackOnTap(jtap);
-  }
+  Dali::Toolkit::Internal::Control::OnTap(tap);
 }
 
 void SwigDirector_ViewWrapperImpl::OnLongPress(Dali::LongPressGesture const &longPress) {
   void * jlongPress = 0 ;
 
-  if (!swig_callbackOnLongPress) {
-    Dali::Toolkit::Internal::Control::OnLongPress(longPress);
-    return;
-  } else {
-    jlongPress = (Dali::LongPressGesture *) &longPress;
-    swig_callbackOnLongPress(jlongPress);
-  }
-}
-
-void SwigDirector_ViewWrapperImpl::SignalConnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback) {
-  void * jslotObserver = 0 ;
-  void * jcallback = 0 ;
-
-  if (!swig_callbackSignalConnected) {
-    Dali::Toolkit::Internal::Control::SignalConnected(slotObserver,callback);
-    return;
-  } else {
-    jslotObserver = (void *) slotObserver;
-    jcallback = (void *) callback;
-    swig_callbackSignalConnected(jslotObserver, jcallback);
-  }
-}
-
-void SwigDirector_ViewWrapperImpl::SignalDisconnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback) {
-  void * jslotObserver = 0 ;
-  void * jcallback = 0 ;
+  jlongPress = (Dali::LongPressGesture *) &longPress;
+  swig_callbackOnLongPress(jlongPress);
 
-  if (!swig_callbackSignalDisconnected) {
-    Dali::Toolkit::Internal::Control::SignalDisconnected(slotObserver,callback);
-    return;
-  } else {
-    jslotObserver = (void *) slotObserver;
-    jcallback = (void *) callback;
-    swig_callbackSignalDisconnected(jslotObserver, jcallback);
-  }
+  Dali::Toolkit::Internal::Control::OnLongPress(longPress);
 }
 
 Dali::Toolkit::Internal::Control::Extension *SwigDirector_ViewWrapperImpl::GetControlExtension() {
index f95d74a..9b5a8be 100644 (file)
@@ -140,8 +140,6 @@ public:
     virtual void OnPan(Dali::PanGesture const &pan);
     virtual void OnTap(Dali::TapGesture const &tap);
     virtual void OnLongPress(Dali::LongPressGesture const &longPress);
-    virtual void SignalConnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback);
-    virtual void SignalDisconnected(Dali::SlotObserver *slotObserver, Dali::CallbackBase *callback);
     virtual Dali::Toolkit::Internal::Control::Extension *GetControlExtension();
 
     typedef void (SWIGSTDCALL* SWIG_Callback0_t)(int);
index 9c54cdd..83540d3 100644 (file)
@@ -60,14 +60,14 @@ namespace Dali
             viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
             viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
             viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
-            viewWrapperImpl.SignalConnected = new ViewWrapperImpl.SignalConnectedDelegate(SignalConnected);
-            viewWrapperImpl.SignalDisconnected = new ViewWrapperImpl.SignalDisconnectedDelegate(SignalDisconnected);
 
             // Make sure CustomView is initialized.
             OnInitialize();
 
-            // Make sure the style of actors/visuals initialized above are applied by the style manager.
-            viewWrapperImpl.ApplyThemeStyle();
+            // Set the StyleName the name of the View
+            // We have to do this because the StyleManager on Native side can't workout it out
+            // This will also ensure that the style of actors/visuals initialized above are applied by the style manager.
+            SetStyleName( this.GetType().Name );
         }
 
         /**
@@ -805,14 +805,6 @@ namespace Dali
         {
         }
 
-        private void SignalConnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
-        {
-        }
-
-        private void SignalDisconnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback)
-        {
-        }
-
         private void OnControlChildAdd(Actor child)
         {
         }
index 0f42e4e..68fcef1 100644 (file)
@@ -58,8 +58,6 @@ namespace Dali
         public delegate void OnPanDelegate(PanGesture pan);
         public delegate void OnTapDelegate(TapGesture tap);
         public delegate void OnLongPressDelegate(LongPressGesture longPress);
-        public delegate void SignalConnectedDelegate(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback);
-        public delegate void SignalDisconnectedDelegate(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback);
 
         public OnStageConnectionDelegate OnStageConnection;
         public OnStageDisconnectionDelegate OnStageDisconnection;
@@ -99,8 +97,6 @@ namespace Dali
         public OnPanDelegate OnPan;
         public OnTapDelegate OnTap;
         public OnLongPressDelegate OnLongPress;
-        public SignalConnectedDelegate SignalConnected;
-        public SignalDisconnectedDelegate SignalDisconnected;
 
         internal ViewWrapperImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ViewWrapperImpl_SWIGUpcast(cPtr), cMemoryOwn)
         {
@@ -411,7 +407,10 @@ namespace Dali
 
         private void DirectorOnStyleChange(global::System.IntPtr styleManager, int change)
         {
-            OnStyleChange(new StyleManager(styleManager, false), (StyleChangeType)change);
+            if (OnStyleChange != null)
+            {
+                OnStyleChange(new StyleManager(styleManager, false), (StyleChangeType)change);
+            }
         }
 
         private bool DirectorOnAccessibilityActivated()
@@ -484,16 +483,6 @@ namespace Dali
             OnLongPress(new LongPressGesture(longPress, false));
         }
 
-        private void DirectorSignalConnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
-        {
-            SignalConnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback, false));
-        }
-
-        private void DirectorSignalDisconnected(global::System.IntPtr slotObserver, global::System.IntPtr callback)
-        {
-            SignalDisconnected((slotObserver == global::System.IntPtr.Zero) ? null : new SlotObserver(slotObserver, false), (callback == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_Dali__CallbackBase(callback, false));
-        }
-
         public delegate void DelegateViewWrapperImpl_0(int depth);
         public delegate void DelegateViewWrapperImpl_1();
         public delegate void DelegateViewWrapperImpl_2(global::System.IntPtr child);
index f31a49d..f4d6aec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public class Spin : CustomView
       ViewRegistry.Instance.Register(CreateInstance, typeof(Spin) );
     }
 
-    public Spin() : base(typeof(Spin).Name, ViewWrapperImpl.CustomViewBehaviour.REQUIRES_KEYBOARD_NAVIGATION_SUPPORT | ViewWrapperImpl.CustomViewBehaviour.DISABLE_STYLE_CHANGE_SIGNALS)
+    public Spin() : base(typeof(Spin).Name, ViewWrapperImpl.CustomViewBehaviour.REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)
     {
 
     }