Merge "Remove the unused-variable gLogFilter in internal/text/text-font-style.cpp...
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 21 Sep 2017 10:15:58 +0000 (10:15 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 21 Sep 2017 10:15:58 +0000 (10:15 +0000)
72 files changed:
automated-tests/packaging/core-dali-toolkit-tests.spec
automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-VisualUrl.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/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp [changed mode: 0644->0755]
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-TextureManager.cpp [new file with mode: 0644]
build/tizen/Makefile.am
build/tizen/configure.ac
build/tizen/dali-toolkit.pc.in
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/image-loader/texture-manager.cpp [new file with mode: 0644]
dali-toolkit/devel-api/image-loader/texture-manager.h [new file with mode: 0644]
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h
dali-toolkit/internal/helpers/round-robin-container-view.h [new file with mode: 0644]
dali-toolkit/internal/image-loader/image-load-thread.cpp
dali-toolkit/internal/scripting/script-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/rendering/text-typesetter.h
dali-toolkit/internal/text/rendering/view-model.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/rendering/view-model.h [changed mode: 0644->0755]
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/text-controller.h [changed mode: 0644->0755]
dali-toolkit/internal/text/text-effects-style.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/text-effects-style.h [changed mode: 0644->0755]
dali-toolkit/internal/text/text-model-interface.h [changed mode: 0644->0755]
dali-toolkit/internal/text/text-model.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/text-model.h [changed mode: 0644->0755]
dali-toolkit/internal/text/visual-model-impl.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/visual-model-impl.h [changed mode: 0644->0755]
dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h
dali-toolkit/internal/visuals/animated-image/image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp [changed mode: 0644->0755]
dali-toolkit/internal/visuals/text/text-visual.h
dali-toolkit/internal/visuals/texture-manager-impl.cpp [moved from dali-toolkit/internal/visuals/texture-manager.cpp with 83% similarity]
dali-toolkit/internal/visuals/texture-manager-impl.h [moved from dali-toolkit/internal/visuals/texture-manager.h with 83% similarity]
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/visual-factory-impl.h
dali-toolkit/internal/visuals/visual-url.cpp
dali-toolkit/internal/visuals/visual-url.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/visuals/image-visual-properties.h
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
packaging/dali-toolkit.spec

index 046b020..b2570aa 100644 (file)
@@ -37,8 +37,6 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 cd automated-tests
 %make_install
-mkdir -p %{buildroot}/opt/usr/share/license
-cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/opt/usr/share/license/%{name}
 mkdir -p %{buildroot}/tmp/
 cp %{_builddir}/%{name}-%{version}/automated-tests/scripts/add_all_smack_rule.sh %{buildroot}/tmp/
 cp %{_builddir}/%{name}-%{version}/automated-tests/scripts/all_smack.rule %{buildroot}/tmp/
@@ -50,6 +48,6 @@ cp %{_builddir}/%{name}-%{version}/automated-tests/scripts/all_smack.rule %{buil
 
 %files
 /opt/usr/bin/*
-/opt/usr/share/license/%{name}
 /tmp/add_all_smack_rule.sh
 /tmp/all_smack.rule
+%license LICENSE
index 2d06a44..24c5c5d 100644 (file)
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 
 #include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
 
 using namespace Dali::Toolkit::Internal;
index 476a023..962ad8e 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.
@@ -26,22 +26,22 @@ using namespace Dali::Toolkit::Internal;
 
 int UtcDaliVisualUrlConstructor(void)
 {
-  const char* url="http://bar.org/foobar.gif";
+  const char* url="file://bar.org/foobar.gif";
   VisualUrl visualUrl(url);
   DALI_TEST_EQUALS( true, visualUrl.IsValid(), TEST_LOCATION );
   DALI_TEST_EQUALS( visualUrl.GetType(), VisualUrl::GIF, TEST_LOCATION );
-  DALI_TEST_EQUALS( visualUrl.GetLocation(), VisualUrl::REMOTE, TEST_LOCATION );
+  DALI_TEST_EQUALS( visualUrl.GetProtocolType(), VisualUrl::LOCAL, TEST_LOCATION );
 
   VisualUrl visualUrl2("foobar.jpeg");
   visualUrl2 = visualUrl;
   DALI_TEST_EQUALS( true, visualUrl2.IsValid(), TEST_LOCATION );
   DALI_TEST_EQUALS( visualUrl2.GetType(), VisualUrl::GIF, TEST_LOCATION );
-  DALI_TEST_EQUALS( visualUrl2.GetLocation(), VisualUrl::REMOTE, TEST_LOCATION );
+  DALI_TEST_EQUALS( visualUrl2.GetProtocolType(), VisualUrl::LOCAL, TEST_LOCATION );
 
   VisualUrl visualUrl3( visualUrl );
   DALI_TEST_EQUALS( true, visualUrl3.IsValid(), TEST_LOCATION );
   DALI_TEST_EQUALS( visualUrl3.GetType(), VisualUrl::GIF, TEST_LOCATION );
-  DALI_TEST_EQUALS( visualUrl3.GetLocation(), VisualUrl::REMOTE, TEST_LOCATION );
+  DALI_TEST_EQUALS( visualUrl3.GetProtocolType(), VisualUrl::LOCAL, TEST_LOCATION );
   END_TEST;
 }
 
@@ -66,6 +66,8 @@ int UtcDaliVisualUrlRegularImage(void)
 
   DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("9").GetType(), TEST_LOCATION );
 
+  DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("dali://bar.org/foobar.gif").GetType(), TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -132,6 +134,7 @@ int UtcDaliVisualUrlGif(void)
 
   DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("gif.png").GetType(), TEST_LOCATION );
   DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("gif.gif1").GetType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("dali://.gif").GetType(), TEST_LOCATION );
 
   END_TEST;
 }
@@ -141,65 +144,82 @@ int UtcDaliVisualUrlLocationP(void)
 {
   tet_infoline( "UtcDaliVisualUrl Location" );
 
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.jpeg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://BAR.ORG/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://BAR.ORG/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.jpeg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ftp://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("ssh://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("http://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("https://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("FTP://BAR.ORG/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("SSH://BAR.ORG/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTP://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.GIF").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::REMOTE, VisualUrl("HTTPS://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://1234").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("DALI://1234").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::TEXTURE, VisualUrl("dali://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
 
   END_TEST;
 }
@@ -209,63 +229,48 @@ int UtcDaliVisualUrlLocationN(void)
 {
   tet_infoline( "UtcDaliVisualUrl Location negative tests" );
 
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("htp://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("htpp://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("sshttp://bar.org/foobar.svg").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("htth://bar.org/foobar.GIF").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http:https://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("https:http://bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("HPPT://bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ftp:/bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ssh;//bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ssh:/bar.org/foobar.9.png").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http:/bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("https:/bar.org/foobar.gif").GetLocation(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.png").GetLocation(), TEST_LOCATION );
-
-  END_TEST;
-}
-
-
-int UtcDaliVisualUrlIsLocal(void)
-{
-  tet_infoline( "UtcDaliVisualUrl IsLocal" );
-
-  DALI_TEST_EQUALS( true, VisualUrl("foobar.gif").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( true, VisualUrl("foobar.png").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( true, VisualUrl("foobar.svg").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( true, VisualUrl("foobar.GIF").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( true, VisualUrl("foobar.9.png").IsLocal(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.gif").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.png").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.svg").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.GIF").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.9.png").IsLocal(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.gif").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.png").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.svg").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.GIF").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.9.png").IsLocal(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.gif").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.png").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.svg").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.GIF").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.9.png").IsLocal(), TEST_LOCATION );
-
-  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.gif").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.png").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.svg").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.GIF").IsLocal(), TEST_LOCATION );
-  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.9.png").IsLocal(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("h://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ht://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("htp://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("htpp://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("httt://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http;//bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http:x/bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http:/xbar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("sshttp://bar.org/foobar.svg").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http:https://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("https:http://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("HPPT://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ftp:/bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ftp:a/bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("fpp://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ftt://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ssh;//bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ssh:/bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ssh:a/bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("shh://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("sss://bar.org/foobar.9.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http:/bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("h1tps://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("ht2ps://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("htt3s://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("http4://bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("https5/bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("https:6/bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("https:/7bar.org/foobar.gif").GetProtocolType(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("file://bar.org/foobar.png").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("dal://1").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("d1li://1").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("da2i://1").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("dal3://1").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("dali4//1").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("dali:5/1").GetProtocolType(), TEST_LOCATION );
+  DALI_TEST_EQUALS( VisualUrl::LOCAL, VisualUrl("dali:/61").GetProtocolType(), TEST_LOCATION );
 
   END_TEST;
 }
 
-
 int UtcDaliVisualUrlIsValid(void)
 {
   tet_infoline( "UtcDaliVisualUrl IsValid" );
@@ -305,3 +310,77 @@ int UtcDaliVisualUrlIsValid(void)
 
   END_TEST;
 }
+
+
+int UtcDaliVisualUrlIsLocalResource(void)
+{
+  tet_infoline( "UtcDaliVisualUrl IsLocalResource" );
+
+  DALI_TEST_EQUALS( true, VisualUrl("foobar.gif").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( true, VisualUrl("foobar.png").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( true, VisualUrl("foobar.svg").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( true, VisualUrl("foobar.GIF").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( true, VisualUrl("foobar.9.png").IsLocalResource(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.gif").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.png").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.svg").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.GIF").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("http://bar.org/foobar.9.png").IsLocalResource(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.gif").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.png").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.svg").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.GIF").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("https://bar.org/foobar.9.png").IsLocalResource(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.gif").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.png").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.svg").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.GIF").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTP://bar.org/foobar.9.png").IsLocalResource(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.gif").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.png").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.svg").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.GIF").IsLocalResource(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, VisualUrl("HTTPS://bar.org/foobar.9.png").IsLocalResource(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliVisualUrlGetLocationP(void)
+{
+  tet_infoline( "UtcDaliVisualUrl GetLocation Positive" );
+
+  DALI_TEST_EQUAL( "a", VisualUrl("http://a").GetLocation() );
+  DALI_TEST_EQUAL( "1", VisualUrl("dali://1").GetLocation() );
+  DALI_TEST_EQUAL( "", VisualUrl("ftp://").GetLocation() );
+  DALI_TEST_EQUAL( "http://", VisualUrl("http://http://").GetLocation() );
+
+  END_TEST;
+}
+
+int UtcDaliVisualUrlGetLocationN(void)
+{
+  tet_infoline( "UtcDaliVisualUrl GetLocation Negative" );
+
+  DALI_TEST_EQUAL( "", VisualUrl("").GetLocation() );
+  DALI_TEST_EQUAL( "a", VisualUrl("a").GetLocation() );
+  DALI_TEST_EQUAL( "dali:/1", VisualUrl("dali:/1").GetLocation() );
+  DALI_TEST_EQUAL( "dali//1", VisualUrl("dali//1").GetLocation() );
+  DALI_TEST_EQUAL( "", VisualUrl("http:/http://").GetLocation() );
+
+  END_TEST;
+}
+
+int UtcDaliVisualUrlCreateTextureUrl(void)
+{
+  tet_infoline( "UtcDaliVisualUrl CreateTextureUrl" );
+
+  DALI_TEST_EQUAL( "dali://a", VisualUrl::CreateTextureUrl( "a" ) );
+  DALI_TEST_EQUAL( "dali://1234", VisualUrl::CreateTextureUrl( "1234" ) );
+  DALI_TEST_EQUAL( "dali://", VisualUrl::CreateTextureUrl( "" ) );
+
+  END_TEST;
+}
index 6b3ddd1..30edbfd 100644 (file)
@@ -1,7 +1,8 @@
 {
   "config":
   {
-    "alwaysShowFocus":false
+    "alwaysShowFocus":false,
+    "clearFocusOnEscape":true
   },
   "constants":
   {
index 20de8e8..e8348f1 100644 (file)
 #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/visual-factory/visual-base.h>
+#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
+#include <dali/integration-api/events/key-event-integ.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -1298,3 +1302,46 @@ int UtcDaliStyleManagerSetSubState02(void)
 
   END_TEST;
 }
+
+
+int UtcDaliStyleManagerConfigSectionTest(void)
+{
+  tet_infoline("Test that the properties in config section are works" );
+
+  const char* defaultTheme =
+    "{\n"
+    "  \"config\":\n"
+    "  {\n"
+    "    \"alwaysShowFocus\":false,\n"
+    "    \"clearFocusOnEscape\":false\n"
+    "  },\n"
+    "  \"styles\":\n"
+    "  {\n"
+    "  }\n"
+    "}\n";
+
+  Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme );
+
+  ToolkitTestApplication application;
+
+  Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+
+  Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
+  bool alwaysShowFocus = config["alwaysShowFocus"].Get<bool>();
+  DALI_TEST_CHECK( !alwaysShowFocus );
+  bool clearFocusOnEscape = config["clearFocusOnEscape"].Get<bool>();
+  DALI_TEST_CHECK( !clearFocusOnEscape );
+
+  // For coverage
+  Toolkit::TextEditor editor = Toolkit::TextEditor::New();
+  editor.SetKeyboardFocusable( true );
+  Stage::GetCurrent().Add( editor );
+
+  Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( editor );
+
+  application.ProcessEvent( Integration::KeyEvent( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
index d3b5bba..4def66d 100755 (executable)
@@ -36,6 +36,7 @@ SET(TC_SOURCES
    utc-Dali-TextSelectionPopup.cpp
    utc-Dali-TextSelectionPopupMirroringLTR.cpp
    utc-Dali-TextSelectionPopupMirroringRTL.cpp
+   utc-Dali-TextureManager.cpp
    utc-Dali-ToolBar.cpp
    utc-Dali-Tooltip.cpp
    utc-Dali-TransitionData.cpp
index 8877a50..b38428b 100644 (file)
@@ -117,6 +117,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const cha
                m1[6],  m1[7], m1[8],   m2[6],  m2[7], m2[8]);
 
     tet_result(TET_FAIL);
+    throw("TET_FAIL");
   }
   else
   {
@@ -147,6 +148,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float eps
                m1[6],  m1[7], m1[8],   m2[6],  m2[7], m2[8]);
 
     tet_result(TET_FAIL);
+    throw("TET_FAIL");
   }
   else
   {
@@ -183,6 +185,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char*
               m1[12], m1[13], m1[14], m1[15],  m2[12], m2[13], m2[14], m2[15]);
 
     tet_result(TET_FAIL);
+    throw("TET_FAIL");
   }
   else
   {
@@ -214,6 +217,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsil
               m1[12], m1[13], m1[14], m1[15],  m2[12], m2[13], m2[14], m2[15]);
 
     tet_result(TET_FAIL);
+    throw("TET_FAIL");
   }
   else
   {
@@ -251,6 +255,7 @@ void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* loca
   else
   {
     tet_result(TET_FAIL);
+    throw("TET_FAIL");
   }
 }
 
@@ -265,6 +270,7 @@ void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const c
   {
     fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location );
     tet_result(TET_FAIL);
+    throw("TET_FAIL");
   }
   else
   {
@@ -294,6 +300,7 @@ void ConstraintAppliedCheck::CheckSignalReceived()
   {
     fprintf(stderr,  "Expected Applied signal was not received\n" );
     tet_result( TET_FAIL );
+    throw("TET_FAIL");
   }
   else
   {
@@ -307,6 +314,7 @@ void ConstraintAppliedCheck::CheckSignalNotReceived()
   {
     fprintf(stderr,  "Unexpected Applied signal was received\n" );
     tet_result( TET_FAIL );
+    throw("TET_FAIL");
   }
   else
   {
index 2b84d39..4f71920 100644 (file)
@@ -40,11 +40,24 @@ using namespace Dali;
 #define STRINGIZE_I(text) #text
 #define STRINGIZE(text) STRINGIZE_I(text)
 
-// the following is the other compilers way of token pasting, gcc seems to just concatenate strings automatically
-//#define TOKENPASTE(x,y) x ## y
-#define TOKENPASTE(x,y) x y
-#define TOKENPASTE2(x,y) TOKENPASTE( x, y )
-#define TEST_LOCATION TOKENPASTE2( "Test failed in ", TOKENPASTE2( __FILE__, TOKENPASTE2( ", line ", STRINGIZE(__LINE__) ) ) )
+/**
+ * Inspired by https://stackoverflow.com/questions/1706346/file-macro-manipulation-handling-at-compile-time
+ * answer by Chetan Reddy
+ */
+constexpr int32_t basenameIndex( const char * const path, const int32_t index = 0, const int32_t slashIndex = -1 )
+{
+   return path[ index ]
+       ? ( path[ index ] == '/'
+           ? basenameIndex( path, index + 1, index )
+           : basenameIndex( path, index + 1, slashIndex ) )
+       : ( slashIndex + 1 );
+}
+
+#define __FILELINE__ ( { static const int32_t basenameIdx = basenameIndex( __FILE__ ); \
+                         static_assert (basenameIdx >= 0, "compile-time basename" );   \
+                         __FILE__ ":" STRINGIZE(__LINE__) + basenameIdx ; } )
+
+#define TEST_LOCATION __FILELINE__
 #define TEST_INNER_LOCATION(x) ( std::string(x) + " (" + STRINGIZE(__LINE__) + ")" ).c_str()
 
 #define TET_UNDEF 2
@@ -73,7 +86,7 @@ if ( (condition) )
 }                                                                                         \
 else                                                                                      \
 {                                                                                         \
-  fprintf(stderr, "%s Failed in %s at line %d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__);    \
+  fprintf(stderr, "Test failed in %s, condition: %s\n", __FILELINE__, #condition );       \
   tet_result(TET_FAIL);                                                                   \
   throw("TET_FAIL");                                                                      \
 }
@@ -97,8 +110,9 @@ inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location)
   {
     std::ostringstream o;
     o << value1 << " == " << value2 << std::endl;
-    fprintf(stderr, "%s, checking %s", location, o.str().c_str());
+    fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else
   {
@@ -106,6 +120,13 @@ inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location)
   }
 }
 
+/**
+ * Test whether two values are equal.
+ * @param[in] value1 The first value
+ * @param[in] value2 The second value
+ */
+#define DALI_TEST_EQUAL( v1, v2 ) DALI_TEST_EQUALS( v1, v2, __FILELINE__ )
+
 template<typename Type>
 inline void DALI_TEST_EQUALS(Type value1, Type value2, float epsilon, const char* location)
 {
@@ -113,8 +134,9 @@ inline void DALI_TEST_EQUALS(Type value1, Type value2, float epsilon, const char
   {
     std::ostringstream o;
     o << value1 << " == " << value2 << std::endl;
-    fprintf(stderr, "%s, checking %s", location, o.str().c_str());
+    fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else
   {
@@ -129,8 +151,9 @@ inline void DALI_TEST_NOT_EQUALS(Type value1, Type value2, float epsilon, const
   {
     std::ostringstream o;
     o << value1 << " !=  " << value2 << std::endl;
-    fprintf(stderr, "%s, checking %s", location, o.str().c_str());
+    fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else
   {
@@ -151,13 +174,15 @@ inline void DALI_TEST_EQUALS<TimePeriod>( TimePeriod value1, TimePeriod value2,
 {
   if ((fabs(value1.durationSeconds - value2.durationSeconds) > epsilon))
   {
-    fprintf(stderr, "%s, checking durations %f == %f, epsilon %f\n", location, value1.durationSeconds, value2.durationSeconds, epsilon);
+    fprintf(stderr, "Test failed in %s, checking durations %f == %f, epsilon %f\n", location, value1.durationSeconds, value2.durationSeconds, epsilon);
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else if ((fabs(value1.delaySeconds - value2.delaySeconds) > epsilon))
   {
-    fprintf(stderr, "%s, checking delays %f == %f, epsilon %f\n", location, value1.delaySeconds, value2.delaySeconds, epsilon);
+    fprintf(stderr, "Test failed in %s, checking delays %f == %f, epsilon %f\n", location, value1.delaySeconds, value2.delaySeconds, epsilon);
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else
   {
@@ -232,8 +257,9 @@ inline void DALI_TEST_EQUALS<const char*>( const char* str1, const char* str2, c
 {
   if (strcmp(str1, str2))
   {
-    fprintf(stderr, "%s, checking '%s' == '%s'\n", location, str1, str2);
+    fprintf(stderr, "Test failed in %s, checking '%s' == '%s'\n", location, str1, str2);
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else
   {
@@ -289,8 +315,9 @@ void DALI_TEST_GREATER( T value1, T value2, const char* location)
 {
   if (!(value1 > value2))
   {
-    std::cerr << location << ", checking " << value1 <<" > " << value2 << "\n";
+    std::cerr << "Test failed in " << location << ", checking " << value1 <<" > " << value2 << "\n";
     tet_result(TET_FAIL);
+    throw("TET_FAIL");                                                                      \
   }
   else
   {
index 840ef0d..645d74b 100644 (file)
@@ -52,7 +52,14 @@ int RunTestCase( struct ::testcase_s& testCase )
   {
     testCase.startup();
   }
-  result = testCase.function();
+  try
+  {
+    result = testCase.function();
+  }
+  catch( const char* )
+  {
+    // just catch test fail exception, return is already set to EXIT_STATUS_TESTCASE_FAILED
+  }
   if( testCase.cleanup )
   {
     testCase.cleanup();
old mode 100644 (file)
new mode 100755 (executable)
index df25aaa..5cc9401
@@ -152,8 +152,8 @@ public:
   void GetFontMetrics( FontId fontId, FontMetrics& metrics ){}
   GlyphIndex GetGlyphIndex( FontId fontId, Character charcode ){return 0;}
   bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal ){return true;}
-  void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ){}
-  PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex ){return PixelData();}
+  void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ){}
+  PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth ){return PixelData();}
   void CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob,
                          unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
   {
@@ -472,14 +472,14 @@ bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType typ
   return GetImplementation(*this).GetGlyphMetrics( array, size, horizontal );
 }
 
-void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data )
+void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
 {
-  GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data );
+  GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data, outlineWidth );
 }
 
-PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
 {
-  return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
+  return GetImplementation(*this).CreateBitmap( fontId, glyphIndex, outlineWidth );
 }
 
 void FontClient::CreateVectorBlob( FontId fontId,
index 3fd4bd6..59925df 100644 (file)
@@ -732,8 +732,19 @@ int UtcDaliTextEditorSetPropertyP(void)
   DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_EMBOSS ), std::string("Emboss input properties"), TEST_LOCATION );
 
   // Check the outline property
-  editor.SetProperty( TextEditor::Property::OUTLINE, "Outline properties" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
+  Property::Map outlineMapSet;
+  Property::Map outlineMapGet;
+
+  outlineMapSet["color"] = Color::RED;
+  outlineMapSet["width"] = 2.0f;
+
+  editor.SetProperty( TextEditor::Property::OUTLINE, outlineMapSet );
+
+  outlineMapSet["color"] = "red";
+  outlineMapSet["width"] = "2";
+  outlineMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::OUTLINE );
+  DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
 
   // Check the input outline property
   editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "Outline input properties" );
index b764740..a7389b0 100644 (file)
@@ -827,8 +827,19 @@ int UtcDaliTextFieldSetPropertyP(void)
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_EMBOSS ), std::string("Emboss input properties"), TEST_LOCATION );
 
   // Check the outline property
-  field.SetProperty( TextField::Property::OUTLINE, "Outline properties" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
+  Property::Map outlineMapSet;
+  Property::Map outlineMapGet;
+
+  outlineMapSet["color"] = Color::RED;
+  outlineMapSet["width"] = 2.0f;
+
+  field.SetProperty( TextField::Property::OUTLINE, outlineMapSet );
+
+  outlineMapSet["color"] = "red";
+  outlineMapSet["width"] = "2";
+  outlineMapGet = field.GetProperty<Property::Map>( TextField::Property::OUTLINE );
+  DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
 
   // Check the input outline property
   field.SetProperty( TextField::Property::INPUT_OUTLINE, "Outline input properties" );
@@ -2502,3 +2513,54 @@ int utcDaliTextFieldSizeUpdate(void)
 
   END_TEST;
 }
+
+int utcDaliTextFieldExtremlyLargePointSize(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldExtremlyLargePointSize");
+
+  TextField field = TextField::New();
+
+  field.SetProperty( TextField::Property::TEXT, "Text" );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  Stage::GetCurrent().Add( field );
+
+  try
+  {
+    field.SetProperty( TextField::Property::POINT_SIZE, 160.0f );
+    application.SendNotification();
+    DALI_TEST_CHECK( field );
+  }
+  catch (...)
+  {
+    tet_result(TET_FAIL);
+  }
+  END_TEST;
+}
+
+int UtcDaliTextFieldDefaultFontStylePropertyCoverage(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliTextFieldFontStylePorpertyCoverage");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+
+  Property::Map fontStyleMapGet;
+
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+
+  Property::Value* weightValue = NULL;
+  Property::Value* widthValue = NULL;
+  Property::Value* slantValue = NULL;
+  weightValue = fontStyleMapGet.Find( "weight" );
+  widthValue = fontStyleMapGet.Find( "width" );
+  slantValue = fontStyleMapGet.Find( "slant" );
+  DALI_TEST_CHECK( !weightValue );
+  DALI_TEST_CHECK( !widthValue );
+  DALI_TEST_CHECK( !slantValue );
+
+  END_TEST;
+}
index beba3a6..2f2e692 100644 (file)
@@ -434,8 +434,18 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::EMBOSS ), std::string("Emboss properties"), TEST_LOCATION );
 
   // Check the outline property
-  label.SetProperty( TextLabel::Property::OUTLINE, "Outline properties" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
+  Property::Map outlineMapSet;
+  Property::Map outlineMapGet;
+
+  outlineMapSet["color"] = Color::RED;
+  outlineMapSet["width"] = 2.0f;
+  label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
+
+  outlineMapSet["color"] = "red";
+  outlineMapSet["width"] = "2";
+  outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
+  DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
 
   // Check the pixel size of font
   label.SetProperty( DevelTextLabel::Property::PIXEL_SIZE, 20.f );
@@ -990,3 +1000,71 @@ int UtcDaliToolkitTextLabelColorComponents(void)
 
   END_TEST;
 }
+
+int UtcDaliToolkitTextlabelTextStyle01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextlabelTextStyle Setting Outline after Shadow");
+
+  TextLabel label = TextLabel::New();
+  label.SetSize( 300.0f, 300.f );
+  label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
+  label.SetProperty( TextLabel::Property::POINT_SIZE, 12 );
+  Stage::GetCurrent().Add( label );
+
+  Property::Map outlineMapSet;
+  Property::Map outlineMapGet;
+
+  outlineMapSet["color"] = Color::BLUE;
+  outlineMapSet["width"] = 2.0f;
+  label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map shadowMapSet;
+  shadowMapSet.Insert( "color", "green" );
+  shadowMapSet.Insert( "offset", "2 2" );
+  label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
+
+  outlineMapSet["color"] = Color::RED;
+  outlineMapSet["width"] = 0.0f;
+  label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
+
+  application.SendNotification();
+  application.Render();
+
+  outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
+
+  Property::Value* colorValue = outlineMapGet.Find("color");
+
+  bool colorMatched( false );
+
+  if ( colorValue )
+  {
+     Property::Type valueType = colorValue->GetType();
+
+     if ( Property::STRING == valueType )
+     {
+       std::string stringValue;
+       colorValue->Get( stringValue );
+       if (  stringValue == "red" )
+       {
+         colorMatched = true;
+       }
+     }
+     else if ( Property::VECTOR4 == valueType )
+     {
+       Vector4 colorVector4;
+       colorValue->Get( colorVector4 );
+       if (  colorVector4 == Color::RED )
+       {
+         colorMatched = true;
+       }
+     }
+  }
+
+  DALI_TEST_EQUALS( colorMatched, true, TEST_LOCATION );
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextureManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextureManager.cpp
new file mode 100644 (file)
index 0000000..89a95ba
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include <stdlib.h>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali/public-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/texture.h>
+#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+} // namespace
+
+
+void dali_texture_manager_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void dali_texture_manager_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliTextureManagerAddRemoveP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliTextureManager" );
+
+  std::string url;
+  std::string url2;
+  std::string url3;
+  std::string url4;
+  // scope to ensure texturesets are kept alive by texture manager
+  {
+    auto texture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 88, 99 );
+    url = TextureManager::AddTexture( texture );
+    DALI_TEST_CHECK( url.size() > 0u );
+
+    auto textureSet = TextureSet::New();
+    textureSet.SetTexture( 0u, texture );
+    url2 = TextureManager::AddTexture( textureSet );
+    DALI_TEST_CHECK( url2.size() > 0u );
+    DALI_TEST_CHECK( url2 != url );
+
+    // add same texture again, should give new Url
+    url3 = TextureManager::AddTexture( texture );
+    DALI_TEST_CHECK( url3.size() > 0u );
+    DALI_TEST_CHECK( url3 != url );
+    DALI_TEST_CHECK( url3 != url2 );
+
+    textureSet = TextureSet::New();
+    url4 = TextureManager::AddTexture( textureSet );
+    DALI_TEST_CHECK( url4.size() > 0u );
+    DALI_TEST_CHECK( url4 != url );
+    DALI_TEST_CHECK( url4 != url2 );
+    DALI_TEST_CHECK( url4 != url3 );
+  }
+
+  auto textureSet = TextureManager::RemoveTexture( url );
+  DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
+  auto texture = textureSet.GetTexture( 0u );
+  DALI_TEST_EQUAL( texture.GetWidth(), 88u );
+  DALI_TEST_EQUAL( texture.GetHeight(), 99u );
+  textureSet = TextureManager::RemoveTexture( url );
+  DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
+
+  textureSet = TextureManager::RemoveTexture( url2 );
+  DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
+  texture = textureSet.GetTexture( 0u );
+  DALI_TEST_EQUAL( texture.GetWidth(), 88u );
+  DALI_TEST_EQUAL( texture.GetHeight(), 99u );
+  textureSet = TextureManager::RemoveTexture( url2 );
+  DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
+
+  textureSet = TextureManager::RemoveTexture( url3 );
+  DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
+  texture = textureSet.GetTexture( 0u );
+  DALI_TEST_EQUAL( texture.GetWidth(), 88u );
+  DALI_TEST_EQUAL( texture.GetHeight(), 99u );
+  textureSet = TextureManager::RemoveTexture( url3 );
+  DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
+
+  textureSet = TextureManager::RemoveTexture( url4 );
+  DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
+  textureSet = TextureManager::RemoveTexture( url4 );
+  DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
+
+  END_TEST;
+}
+
+int UtcDaliTextureManagerAddN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliTextureManager" );
+
+  // empty texture is ok, though pointless from app point of view
+  TextureSet empty;
+  std::string url = TextureManager::AddTexture( empty );
+  DALI_TEST_CHECK( url.size() > 0u );
+
+  END_TEST;
+}
+
+int UtcDaliTextureManagerRemoveN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliTextureManager" );
+
+  // removing empty texture returns empty handle
+  auto texture = TextureManager::RemoveTexture( "" );
+  DALI_TEST_CHECK( !texture && "Texture should not be found" );
+
+  // removing empty texture returns empty handle
+  texture = TextureManager::RemoveTexture( "dali://" );
+  DALI_TEST_CHECK( !texture && "Texture should not be found" );
+
+  // empty texture is ok, though pointless from app point of view
+  TextureSet empty;
+  std::string url = TextureManager::AddTexture( empty );
+  DALI_TEST_CHECK( url.size() > 0u );
+  // removing texture with wrong URL returns empty handle
+  texture = TextureManager::RemoveTexture( "dali://" );
+  DALI_TEST_CHECK( !texture && "Texture should not be found" );
+
+  // removing ftp texture returns empty handle
+  texture = TextureManager::RemoveTexture( "ftp://foobar" );
+  DALI_TEST_CHECK( !texture && "Texture should not be found" );
+
+  // add a texture
+  url = TextureManager::AddTexture( texture );
+  texture = TextureManager::RemoveTexture( url + "foo" );
+  DALI_TEST_CHECK( !texture && "Texture should not be found" );
+
+  END_TEST;
+}
+
+
+
index 89a5e28..1649112 100755 (executable)
@@ -28,6 +28,7 @@ endif
 SUBDIRS += docs
 
 pkgconfigdir = $(libdir)/pkgconfig
+
 pkgconfig_DATA = dali-toolkit.pc
 
 MAINTAINERCLEANFILES = \
@@ -56,8 +57,8 @@ rename_cov_data:
        @test -z $(COVERAGE_DIR) || mkdir -p $(COVERAGE_DIR)
        @rm -f $(COVERAGE_DIR)/*
        @cp dali-toolkit/.libs/*.gcda dali-toolkit/.libs/*.gcno  $(COVERAGE_DIR)
-       @for i in `find $(COVERAGE_DIR) -name "libdali_toolkit_la-*.gcda" -o -name "libdali_toolkit_la-*.gcno"` ;\
-               do mv $$i `echo $$i | sed s/libdali_toolkit_la-//` ; echo $$i ; done
+       @for i in `find $(COVERAGE_DIR) -name "libdali_toolkit*_la-*.gcda" -o -name "libdali_toolkit*_la-*.gcno"` ;\
+               do dest=`echo $$i | sed s/libdali_.*_la-//` ; mv $$i $$dest ; echo $$i ; done
 
 cov_data: rename_cov_data
        @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --base-directory . --directory . -c -o dali.info
index 80e4a8f..26be349 100755 (executable)
@@ -28,7 +28,6 @@ LT_INIT
 DALI_TOOLKIT_VERSION=dali_version
 AC_SUBST(DALI_TOOLKIT_VERSION)
 
-PKG_CHECK_MODULES(DALICORE, dali-core)
 
 DALI_TOOLKIT_CFLAGS=-DPLATFORM_TIZEN
 
@@ -75,6 +74,25 @@ AC_ARG_ENABLE([csharp],
               [enable_csharp=$enableval],
               [enable_csharp=automatic])
 
+AC_ARG_ENABLE([cxx03_abi],
+              [AC_HELP_STRING([--enable-cxx03-abi],
+                              [Specify abi for the build])],
+              [enable_cxx03_abi=$enableval],
+              [enable_cxx03_abi=no])
+
+AC_ARG_ENABLE([rename_so],
+              [AC_HELP_STRING([--enable-rename-so],
+                              [Specify whether so file is renamed or not])],
+              [enable_rename_so=$enableval],
+              [enable_rename_so=yes])
+
+AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
+AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
+
+if test "x$enable_cxx03_abi" = "xyes"; then
+  DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
+fi
+
 if test "x$enable_debug" = "xyes"; then
   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
 fi
@@ -203,6 +221,12 @@ if test x$enable_csharp = xyes; then
   AC_SUBST(DALITOOLKIT_LIBS)
 fi
 
+if test "x$enable_cxx03_abi" = "xyes"; then
+PKG_CHECK_MODULES(DALICORE, dali-core-cxx03)
+else
+PKG_CHECK_MODULES(DALICORE, dali-core)
+fi
+
 #set a variable for the makefile to force compile the csharp plugin
 AM_CONDITIONAL([ENABLE_CSHARP_PLUGIN], [test x$build_csharp_plugin = xyes])
 AM_CONDITIONAL([ENABLE_RUBY_FLAG], [test x$build_ruby_flag = xyes])
@@ -212,13 +236,16 @@ AC_CONFIG_FILES([
  dali-toolkit/Makefile
  plugins/javascript/Makefile
  plugins/csharp/Makefile
- dali-toolkit.pc
  docs/Makefile
  docs/dali.doxy
  docs-internal/dali-internal.doxy
  ../../automated-tests/CMakeLists.txt
 ])
 
+if test "x$enable_cxx03_abi" = "xno"; then
+AC_CONFIG_FILES([dali-toolkit.pc])
+fi
+
 AC_OUTPUT
 
 echo "
index 87cbcc0..16eacc4 100644 (file)
@@ -4,8 +4,8 @@ apiversion=@DALI_TOOLKIT_VERSION@
 libdir=@libdir@
 includedir=@devincludepath@
 
-Name: Samsung OpenGLES Toolkit (including Toolkit)
-Description: 3D Canvas Toolkit using OpenGLES (with the toolkit)
+Name: Dali 3D engine Toolkit
+Description: Cross platform 3D Engine Toolkit
 Version: ${apiversion}
 Requires: dali-core
 Libs: -L${libdir} -ldali-toolkit
index c2f73c3..25bdf75 100644 (file)
@@ -53,10 +53,7 @@ dalisound_DATA = ${dali_toolkit_sound_files}
 package_doxy_dir = ../../../doc
 include ../../../doc/file.list
 
-# The library
-lib_LTLIBRARIES = libdali-toolkit.la
-
-libdali_toolkit_la_SOURCES = \
+LIBDALI_TOOLKIT_LA_SOURCES = \
                      $(toolkit_src_files) \
                      $(public_api_src_files) \
                      $(devel_api_src_files) \
@@ -70,7 +67,7 @@ dalistyleimages_DATA = ${dali_toolkit_style_images}
 
 libdali_toolkit_la_DEPENDENCIES =
 
-libdali_toolkit_la_CXXFLAGS = -DDALI_COMPILATION \
+LIBDALI_TOOLKIT_LA_CXXFLAGS = -DDALI_COMPILATION \
                       -DDALI_IMAGE_DIR="\"${daliimagedir}\"" \
                       -DDALI_SOUND_DIR="\"${dalisounddir}\"" \
                       -DDALI_STYLE_DIR="\"${dalistyledir}\"" \
@@ -84,14 +81,49 @@ libdali_toolkit_la_CXXFLAGS = -DDALI_COMPILATION \
                       $(FRIBIDI_CFLAGS) \
                       $(HTMLCXX_CFLAGS)
 
-libdali_toolkit_la_LIBADD = \
+LIBDALI_TOOLKIT_LA_LIBADD = \
                       $(DALICORE_LIBS) \
                       $(DLOG_LIBS) \
                       $(FRIBIDI_LIBS) \
                       $(HTMLCXX_LIBS)
 
-# Install headers
 
+# The library
+if ENABLE_CXX03_ABI
+
+lib_LTLIBRARIES = libdali-toolkit.la
+libdali_toolkit_la_SOURCES = $(LIBDALI_TOOLKIT_LA_SOURCES)
+libdali_toolkit_la_LIBADD = $(LIBDALI_TOOLKIT_LA_LIBADD)
+libdali_toolkit_la_CXXFLAGS = $(LIBDALI_TOOLKIT_LA_CXXFLAGS)
+libdali_toolkit_la_CFLAGS = $(LIBDALI_TOOLKTI_LA_CFLAGS)
+
+if ENABLE_RENAME_SO
+#rename
+install: install-am
+       rm -rf $(libdir)/libdali-toolkit.so
+       rm -rf $(libdir)/libdali-toolkit-cxx03.so
+       ln -s $(libdir)/libdali-toolkit.so.0.0.* $(libdir)/libdali-toolkit-cxx03.so
+endif
+
+else
+
+lib_LTLIBRARIES = libdali-toolkit-cxx11.la
+libdali_toolkit_cxx11_la_SOURCES = $(LIBDALI_TOOLKIT_LA_SOURCES)
+libdali_toolkit_cxx11_la_LIBADD = $(LIBDALI_TOOLKIT_LA_LIBADD)
+libdali_toolkit_cxx11_la_CXXFLAGS = $(LIBDALI_TOOLKIT_LA_CXXFLAGS)
+libdali_toolkit_cxx11_la_CFLAGS = $(LIBDALI_TOOLKTI_LA_CFLAGS)
+
+if ENABLE_RENAME_SO
+#rename
+install: install-am
+       rm -rf $(libdir)/libdali-toolkit-cxx11.so
+       rm -rf $(libdir)/libdali-toolkit.so
+       ln -s $(libdir)/libdali-toolkit-cxx11.so.0.0.* $(libdir)/libdali-toolkit.so
+endif
+
+endif
+
+# Install headers
 topleveldir = $(devincludepath)/dali-toolkit
 toplevel_HEADERS = ../../../dali-toolkit/dali-toolkit.h
 
index 7f4308b..5cf6797 100644 (file)
@@ -30,6 +30,7 @@ devel_api_src_files = \
   $(devel_api_src_dir)/image-loader/async-image-loader-devel.cpp \
   $(devel_api_src_dir)/image-loader/atlas-upload-observer.cpp \
   $(devel_api_src_dir)/image-loader/image-atlas.cpp \
+  $(devel_api_src_dir)/image-loader/texture-manager.cpp \
   $(devel_api_src_dir)/scripting/script.cpp \
   $(devel_api_src_dir)/styling/style-manager-devel.cpp \
   $(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
diff --git a/dali-toolkit/devel-api/image-loader/texture-manager.cpp b/dali-toolkit/devel-api/image-loader/texture-manager.cpp
new file mode 100644 (file)
index 0000000..d46d2b4
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace TextureManager
+{
+
+std::string AddTexture( Texture& texture )
+{
+  TextureSet set = TextureSet::New();
+  set.SetTexture( 0u, texture );
+  return AddTexture( set );
+}
+
+std::string AddTexture( TextureSet& textureSet )
+{
+  auto visualFactory = Toolkit::VisualFactory::Get();
+  auto& textureMgr = GetImplementation( visualFactory ).GetTextureManager();
+  return textureMgr.AddExternalTexture( textureSet );
+}
+
+TextureSet RemoveTexture( const std::string& textureUrl )
+{
+  auto visualFactory = Toolkit::VisualFactory::Get();
+  auto& textureMgr = GetImplementation( visualFactory ).GetTextureManager();
+  return textureMgr.RemoveExternalTexture( textureUrl );
+}
+
+} // TextureManager
+
+} // Toolkit
+
+} // Dali
diff --git a/dali-toolkit/devel-api/image-loader/texture-manager.h b/dali-toolkit/devel-api/image-loader/texture-manager.h
new file mode 100644 (file)
index 0000000..b88eab9
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef DALI_TOOLKIT_DEVEL_API_TEXTURE_MANAGER_H
+#define DALI_TOOLKIT_DEVEL_API_TEXTURE_MANAGER_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.
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/rendering/texture-set.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+/**
+ * API to interface with the toolkit texture manager
+ * Allows developers to add Textures through TextureSets to toolkit so that visuals can use them to render
+ */
+namespace TextureManager
+{
+
+/**
+ * @brief Add a Texture to texture manager
+ * Toolkit keeps the Texture handle until RemoveTexture is called.
+ * @note this method does not check for duplicates,
+ *       if same Texture is added multiple times, a different URL is returned each time
+ * @param[in] texture the Texture to add
+ * @return the Url string representing this texture
+ */
+DALI_IMPORT_API std::string AddTexture( Texture& texture );
+
+/**
+ * @brief Add a TextureSet to texture manager
+ * Toolkit keeps the TextureSet handle until RemoveTexture is called.
+ * @note this method does not check for duplicates,
+ *       if same TextureSet is added multiple times, a different URL is returned each time
+ * @param[in] textureSet the TextureSet to add
+ * @return the Url string representing this texture
+ */
+DALI_IMPORT_API std::string AddTexture( TextureSet& textureSet );
+
+/**
+ * @brief Removes a TextureSet from toolkit
+ * @note TextureSet may still be used by visuals and kept alive by them
+ * @param[in] textureUrl to remove
+ * @return the handle to the TextureSet or empty handle in case TextureSet is not found
+ */
+DALI_IMPORT_API TextureSet RemoveTexture( const std::string& textureUrl );
+
+}
+
+} // Toolkit
+
+} // Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_TEXTURE_MANAGER_H
index 43c9307..703440a 100644 (file)
@@ -135,8 +135,8 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cellPadding",    VECTOR2, CELL_
 DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layoutRows",     MAP,     LAYOUT_ROWS    )
 DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layoutColumns",  MAP,     LAYOUT_COLUMNS )
 DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellIndex",                VECTOR2, CELL_INDEX                )
-DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "rowSpan",                  FLOAT,   ROW_SPAN                  )
-DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "columnSpan",               FLOAT,   COLUMN_SPAN               )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "rowSpan",                  INTEGER, ROW_SPAN                  )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "columnSpan",               INTEGER, COLUMN_SPAN               )
 DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellHorizontalAlignment",  STRING,  CELL_HORIZONTAL_ALIGNMENT )
 DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellVerticalAlignment",    STRING,  CELL_VERTICAL_ALIGNMENT   )
 
@@ -996,12 +996,12 @@ void TableView::OnChildAdd( Actor& child )
     Toolkit::TableView::CellPosition cellPosition;
     if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
     {
-      cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
+      cellPosition.rowSpan = child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get< int >();
     }
 
     if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
     {
-      cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
+      cellPosition.columnSpan = child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get< int >();
     }
 
     if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
index d089d97..77005c0 100644 (file)
@@ -1478,7 +1478,7 @@ bool TextEditor::OnKeyEvent( const KeyEvent& event )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
 
-  if( Dali::DALI_KEY_ESCAPE == event.keyCode ) // Make a Dali key code for this
+  if( Dali::DALI_KEY_ESCAPE == event.keyCode && mController->ShouldClearFocusOnEscape() )
   {
     // Make sure ClearKeyInputFocus when only key is up
     if( event.state == KeyEvent::Up )
index 1ed87bd..d5ea993 100644 (file)
@@ -1526,7 +1526,7 @@ 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 ) // Make a Dali key code for this
+  if( Dali::DALI_KEY_ESCAPE == event.keyCode && mController->ShouldClearFocusOnEscape() )
   {
     // Make sure ClearKeyInputFocus when only key is up
     if( event.state == KeyEvent::Up )
index d92b1cd..e871db3 100644 (file)
@@ -948,7 +948,7 @@ void TextLabel::SetUpAutoScrolling()
 
   // Create a texture of the text for scrolling
   Text::TypesetterPtr typesetter = Text::Typesetter::New( mController->GetTextModel() );
-  PixelData data = typesetter->Render( textNaturalSize, Text::Typesetter::RENDER_TEXT_AND_STYLES, true ); // ignore the horizontal alignment
+  PixelData data = typesetter->Render( textNaturalSize, Text::Typesetter::RENDER_TEXT_AND_STYLES, true, Pixel::RGBA8888 ); // ignore the horizontal alignment
   Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D,
                                   data.GetPixelFormat(),
                                   data.GetWidth(),
index b09de6b..2fdb70b 100644 (file)
@@ -620,7 +620,11 @@ void VideoView::SetWindowSurfaceTarget()
     mVideoPlayer.Play();
     mVideoPlayer.Pause();
   }
-  mVideoPlayer.SetPlayPosition( curPos );
+
+  if( curPos > 0 )
+  {
+    mVideoPlayer.SetPlayPosition( curPos );
+  }
 
   // For underlay rendering mode, video display area have to be transparent.
   Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
@@ -660,7 +664,10 @@ void VideoView::SetNativeImageTarget()
     mVideoPlayer.Play();
     mVideoPlayer.Pause();
   }
-  mVideoPlayer.SetPlayPosition( curPos );
+  if( curPos > 0 )
+  {
+    mVideoPlayer.SetPlayPosition( curPos );
+  }
 }
 
 void VideoView::UpdateDisplayArea()
index 9b6809f..77df72f 100644 (file)
@@ -31,7 +31,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/visuals/svg/svg-visual.cpp \
    $(toolkit_src_dir)/visuals/text/text-visual.cpp \
    $(toolkit_src_dir)/visuals/transition-data-impl.cpp \
-   $(toolkit_src_dir)/visuals/texture-manager.cpp \
+   $(toolkit_src_dir)/visuals/texture-manager-impl.cpp \
    $(toolkit_src_dir)/visuals/texture-upload-observer.cpp \
    $(toolkit_src_dir)/visuals/visual-base-data-impl.cpp \
    $(toolkit_src_dir)/visuals/visual-base-impl.cpp \
index c3ebe62..3f398c5 100644 (file)
@@ -122,6 +122,7 @@ KeyboardFocusManager::KeyboardFocusManager()
   mIsFocusIndicatorEnabled( -1 ),
   mFocusGroupLoopEnabled( false ),
   mIsWaitingKeyboardFocusChangeCommit( false ),
+  mClearFocusOnTouch( true ),
   mFocusHistory(),
   mSlotDelegate( this ),
   mCustomAlgorithmInterface(NULL)
@@ -142,6 +143,7 @@ void KeyboardFocusManager::GetConfigurationFromStyleManger()
     {
       Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
       mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
+      mClearFocusOnTouch = mIsFocusIndicatorEnabled ? false : true;
     }
 }
 
@@ -863,9 +865,17 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
 
 void KeyboardFocusManager::OnTouch(const TouchData& touch)
 {
+  // if mIsFocusIndicatorEnabled is -1, it means Configuration is not loaded.
+  // Try to load configuration.
+  if( mIsFocusIndicatorEnabled == -1 )
+  {
+    GetConfigurationFromStyleManger();
+  }
+
   // Clear the focus when user touch the screen.
   // We only do this on a Down event, otherwise the clear action may override a manually focused actor.
-  if( ( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN ) )
+  // If mClearFocusOnTouch is false, do not clear the focus even if user touch the screen.
+  if( (( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN )) && mClearFocusOnTouch )
   {
     ClearFocus();
   }
index 049ce1f..32a0390 100644 (file)
@@ -265,6 +265,8 @@ private:
 
   bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet.
 
+  bool mClearFocusOnTouch:1; ///< Whether clear focus on touch.
+
   FocusStack mFocusHistory; ///< Stack to contain pre-focused actor's BaseObject*
 
   SlotDelegate< KeyboardFocusManager > mSlotDelegate;
diff --git a/dali-toolkit/internal/helpers/round-robin-container-view.h b/dali-toolkit/internal/helpers/round-robin-container-view.h
new file mode 100644 (file)
index 0000000..c3619f9
--- /dev/null
@@ -0,0 +1,124 @@
+
+#ifndef DALI_TOOLKIT_INTERNAL_ROUND_ROBIN_CONTAINER_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_ROUND_ROBIN_CONTAINER_VIEW_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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <cstddef>
+#include <vector>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+/**
+ * @brief RoundRobinContainerView is a view to a container that allows iterating through the elements cyclically.
+ */
+template<typename T>
+class RoundRobinContainerView
+{
+public:
+  using ContainerType = std::vector<T>;
+
+  /**
+   * @brief Constructs a new RoundRobinControlView with the given number elements using the provided factory.
+   * @param[in] numberOfElements The number of elements in the container
+   * @param[in] factory          Factory function of functor that will be used to create instances of the elements
+   */
+  template<typename FactoryType>
+  RoundRobinContainerView(size_t numberOfElements, const FactoryType& factory)
+  : mElements(),
+    mNextIndex{}
+  {
+    mElements.reserve(numberOfElements);
+    for(unsigned i = {}; i < numberOfElements; ++i)
+    {
+      mElements.push_back(factory());
+    }
+  }
+
+  /**
+   * @brief Reset the position of the iterator returned by GetNext() to the first element.
+   */
+  void Reset()
+  {
+    mNextIndex = 0u;
+  }
+
+  /**
+   * @brief Returns the next element on the container.
+   * @return Iterator for the next element
+   */
+  typename ContainerType::iterator GetNext()
+  {
+    SetValidNextIndex();
+
+    return mElements.begin() + mNextIndex++;
+  }
+
+  /**
+   * @brief Returns the iterator to the end of the container.
+   *
+   * Can be used to compare against GetNext() to check if the container is empty.
+   *
+   * @return The container end() element
+   */
+  typename ContainerType::const_iterator End() const
+  {
+    return mElements.cend();
+  }
+
+  // default members
+  ~RoundRobinContainerView() = default;
+
+  RoundRobinContainerView(const RoundRobinContainerView&)  = delete;
+  RoundRobinContainerView& operator=(const RoundRobinContainerView&)  = delete;
+  RoundRobinContainerView(RoundRobinContainerView&&) = default;
+  RoundRobinContainerView& operator=(RoundRobinContainerView&&) = default;
+
+private:
+  /**
+   * @brief Check the current index and reset if necessary.
+   */
+  void SetValidNextIndex()
+  {
+    if(mNextIndex >= mElements.size())
+    {
+      Reset();
+    }
+  }
+
+private:
+  ContainerType mElements; //< container of elements
+  size_t mNextIndex;       //< index to the next element to be viewed
+};
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+
+#endif // DALI_TOOLKIT_INTERNAL_ROUND_ROBIN_CONTAINER_VIEW_H
index c1b4a91..7e0a181 100644 (file)
@@ -44,7 +44,7 @@ LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dim
 
 void LoadingTask::Load()
 {
-  if( url.IsLocal() )
+  if( url.IsLocalResource() )
   {
     pixelBuffer = Dali::LoadImageFromFile( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
   }
index 9cc0d24..6c9191b 100644 (file)
@@ -33,7 +33,11 @@ namespace Internal
 
 namespace
 {
+#if _GLIBCXX_USE_CXX11_ABI
+const char* PLUGIN_FILE = "libdali-script-plugin-v8-cxx11.so";
+#else
 const char* PLUGIN_FILE = "libdali-script-plugin-v8.so";
+#endif
 }
 
 Script::Script()
index 7e672bd..0d72be9 100644 (file)
@@ -49,6 +49,8 @@ void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "Added glyph, font: %d index: %d\n", glyph.fontId, glyph.index );
 
+  // If glyph added to an existing or new atlas then a new glyph record is required.
+  // Check if an existing atlas will fit the image, create a new one if required.
   if ( mAtlasManager.Add( bitmap, slot ) )
   {
     // A new atlas was created so set the texture set details for the atlas
index 958749e..ba07cef 100644 (file)
@@ -42,6 +42,11 @@ namespace
   const uint32_t SINGLE_PIXEL_PADDING( 1u );
   const uint32_t DOUBLE_PIXEL_PADDING( SINGLE_PIXEL_PADDING << 1 );
   Toolkit::AtlasManager::AtlasSize EMPTY_SIZE;
+
+  bool IsBlockSizeSufficient( uint32_t width, uint32_t height, uint32_t requiredBlockWidth, uint32_t requiredBlockHeight )
+  {
+    return ( width + DOUBLE_PIXEL_PADDING <= requiredBlockWidth ) && ( height + DOUBLE_PIXEL_PADDING <= requiredBlockHeight );
+  }
 }
 
 AtlasManager::AtlasManager()
@@ -139,39 +144,46 @@ bool AtlasManager::Add( const PixelData& image,
   }
 
   // Search current atlases to see if there is a good match
-  while( !foundAtlas && index < mAtlasList.size() )
+  while( ( 0u == foundAtlas ) && ( index < mAtlasList.size() ) )
   {
     foundAtlas = CheckAtlas( index, width, height, pixelFormat );
     ++index;
   }
 
   // If we can't find a suitable atlas then check the policy to determine action
-  if ( !foundAtlas-- )
+  if ( 0u == foundAtlas )
   {
     if ( Toolkit::AtlasManager::FAIL_ON_ADD_CREATES == mAddFailPolicy )
     {
-      foundAtlas = CreateAtlas( mNewAtlasSize, pixelFormat );
-      if ( !foundAtlas-- )
+      if ( IsBlockSizeSufficient( width, height, mNewAtlasSize.mBlockWidth, mNewAtlasSize.mBlockHeight ) ) // Checks if image fits within the atlas blocks
       {
-        DALI_LOG_ERROR("Failed to create an atlas of %i x %i blocksize: %i x %i.\n",
-                       mNewAtlasSize.mWidth,
-                       mNewAtlasSize.mHeight,
-                       mNewAtlasSize.mBlockWidth,
-                       mNewAtlasSize.mBlockHeight );
-        return created;
+        foundAtlas = CreateAtlas( mNewAtlasSize, pixelFormat ); // Creating atlas with mNewAtlasSize, may not be the needed size!
+        if (  0u == foundAtlas )
+        {
+          DALI_LOG_ERROR("Failed to create an atlas of %i x %i blocksize: %i x %i.\n",
+                         mNewAtlasSize.mWidth,
+                         mNewAtlasSize.mHeight,
+                         mNewAtlasSize.mBlockWidth,
+                         mNewAtlasSize.mBlockHeight );
+          return false;
+        }
+        else
+        {
+          created = true;
+        }
       }
-      created = true;
-      foundAtlas = CheckAtlas( foundAtlas, width, height, pixelFormat );
     }
 
-    if ( !foundAtlas-- || Toolkit::AtlasManager::FAIL_ON_ADD_FAILS == mAddFailPolicy )
+    if ( (  0u == foundAtlas )  || Toolkit::AtlasManager::FAIL_ON_ADD_FAILS == mAddFailPolicy )
     {
-      // Haven't found an atlas for this image!!!!!!
+      // Haven't found an atlas for this image ( may have failed to add image to atlas )
       DALI_LOG_ERROR("Failed to create an atlas under current policy.\n");
-      return created;
+      return false;
     }
   }
 
+  foundAtlas--; // Atlas created successfully, decrement by 1 to get <vector> index (starts at 0 not 1)
+
   // Work out which the block we're going to use
   // Is there currently a next free block available ?
   if ( mAtlasList[ foundAtlas ].mAvailableBlocks )
@@ -188,7 +200,7 @@ bool AtlasManager::Add( const PixelData& image,
 
   desc.mImageWidth = width;
   desc.mImageHeight = height;
-  desc.mAtlasId = foundAtlas + 1u;
+  desc.mAtlasId = foundAtlas + 1u;  // Ids start from 1 not the 0 index
   desc.mCount = 1u;
 
   // See if there's a previously freed image ID that we can assign to this new image
@@ -211,7 +223,7 @@ bool AtlasManager::Add( const PixelData& image,
     mImageList[ imageId - 1u ] = desc;
     slot.mImageId = imageId;
   }
-  slot.mAtlasId = foundAtlas + 1u;
+  slot.mAtlasId = foundAtlas + 1u; // Ids start from 1 not the 0 index
 
   // Upload the buffer image into the atlas
   UploadImage( image, desc );
@@ -226,12 +238,13 @@ AtlasManager::SizeType AtlasManager::CheckAtlas( SizeType atlas,
   AtlasManager::SizeType result = 0u;
   if ( pixelFormat == mAtlasList[ atlas ].mPixelFormat )
   {
-    // Check to see if the image will fit in these blocks, if not we'll need to create a new atlas
-    if ( ( mAtlasList[ atlas ].mAvailableBlocks + mAtlasList[ atlas ].mFreeBlocksList.Size() )
-           && width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mBlockWidth
-           && height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mBlockHeight )
+    // Check to see if the image will fit in these blocks
+
+    const SizeType availableBlocks = mAtlasList[ atlas ].mAvailableBlocks + mAtlasList[ atlas ].mFreeBlocksList.Size();
+
+    if ( availableBlocks && IsBlockSizeSufficient( width, height,mAtlasList[ atlas ].mSize.mBlockWidth, mAtlasList[ atlas ].mSize.mBlockHeight ) )
     {
-      result = atlas + 1u;
+      result = atlas + 1u; // Atlas ids start from 1 not 0
     }
   }
   return result;
index 863bba9..dc48498 100644 (file)
@@ -178,7 +178,7 @@ private:
   std::vector< AtlasDescriptor > mAtlasList;            // List of atlases created
   Vector< AtlasSlotDescriptor > mImageList;             // List of bitmaps stored in atlases
   Toolkit::AtlasManager::AtlasSize mNewAtlasSize;       // Atlas size to use in next creation
-  Toolkit::AtlasManager::AddFailPolicy mAddFailPolicy;  // Policy for faling to add an Image
+  Toolkit::AtlasManager::AddFailPolicy mAddFailPolicy;  // Policy for failing to add an Image
 
   SizeType CheckAtlas( SizeType atlas,
                        SizeType width,
index e9b876d..62865d6 100644 (file)
@@ -94,6 +94,7 @@ const float HALF( 0.5f );
 const float ONE( 1.0f );
 const uint32_t DEFAULT_ATLAS_WIDTH = 512u;
 const uint32_t DEFAULT_ATLAS_HEIGHT = 512u;
+const int NO_OUTLINE( 0 );
 }
 
 struct AtlasRenderer::Impl
@@ -315,25 +316,28 @@ struct AtlasRenderer::Impl
           lastUnderlinedFontId = glyph.fontId;
         } // underline
 
-        if( !mGlyphManager.IsCached( glyph.fontId, glyph.index, slot ) )
+        bool glyphNotCached = !mGlyphManager.IsCached( glyph.fontId, glyph.index, slot );  // Check FontGlyphRecord vector for entry with glyph index and fontId
+
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "AddGlyphs fontID[%u] glyphIndex[%u] [%s]\n", glyph.fontId, glyph.index, (glyphNotCached)?"not cached":"cached" );
+
+        if( glyphNotCached )
         {
-          // Select correct size for new atlas if needed....?
-          if( lastFontId != glyph.fontId )
+          MaxBlockSize& blockSize = mBlockSizes[currentBlockSize];
+
+          if ( lastFontId != glyph.fontId )
           {
             uint32_t index = 0u;
+            // Looks through all stored block sizes until finds the one which mataches required glyph font it.  Ensures new atlas block size will match existing for same font id.
+            // CalculateBlocksSize() above ensures a block size entry exists.
             for( std::vector<MaxBlockSize>::const_iterator it = mBlockSizes.begin(),
                    endIt = mBlockSizes.end();
                  it != endIt;
                  ++it, ++index )
             {
-              const MaxBlockSize& blockSize = *it;
-              if( blockSize.mFontId == glyph.fontId )
+              const MaxBlockSize& blockSizeEntry = *it;
+              if( blockSizeEntry.mFontId == glyph.fontId )
               {
-                currentBlockSize = index;
-                mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
-                                               DEFAULT_ATLAS_HEIGHT,
-                                               blockSize.mNeededBlockWidth,
-                                               blockSize.mNeededBlockHeight );
+                blockSize = mBlockSizes[index];
               }
             }
           }
@@ -351,7 +355,8 @@ struct AtlasRenderer::Impl
 
           mFontClient.CreateBitmap( glyph.fontId,
                                     glyph.index,
-                                    glyphBufferData );
+                                    glyphBufferData,
+                                    NO_OUTLINE );
 
           // Create the pixel data.
           bitmap = PixelData::New( glyphBufferData.buffer,
@@ -363,31 +368,27 @@ struct AtlasRenderer::Impl
 
           if( bitmap )
           {
-            MaxBlockSize& blockSize = mBlockSizes[currentBlockSize];
-
             // Ensure that the next image will fit into the current block size
-            bool setSize = false;
             if( bitmap.GetWidth() > blockSize.mNeededBlockWidth )
             {
-              setSize = true;
               blockSize.mNeededBlockWidth = bitmap.GetWidth();
             }
+
             if( bitmap.GetHeight() > blockSize.mNeededBlockHeight )
             {
-              setSize = true;
               blockSize.mNeededBlockHeight = bitmap.GetHeight();
             }
 
-            if( setSize )
-            {
-              mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
-                                             DEFAULT_ATLAS_HEIGHT,
-                                             blockSize.mNeededBlockWidth,
-                                             blockSize.mNeededBlockHeight );
-            }
+            // If CheckAtlas in AtlasManager::Add can't fit the bitmap in the current atlas it will create a new atlas
+
+            // Setting the block size and size of new atlas does not mean a new one will be created. An existing atlas may still surffice.
+            mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
+                                           DEFAULT_ATLAS_HEIGHT,
+                                           blockSize.mNeededBlockWidth,
+                                           blockSize.mNeededBlockHeight );
 
             // Locate a new slot for our glyph
-            mGlyphManager.Add( glyph, bitmap, slot );
+            mGlyphManager.Add( glyph, bitmap, slot ); // slot will be 0 is glyph not added
           }
         }
         else
@@ -399,40 +400,44 @@ struct AtlasRenderer::Impl
         // Move the origin (0,0) of the mesh to the center of the actor
         const Vector2 position = *( positionsBuffer + i ) - halfTextSize - lineOffsetPosition;
 
-        // Generate mesh data for this quad, plugging in our supplied position
-        AtlasManager::Mesh2D newMesh;
-        mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
-        textCacheEntry.mFontId = glyph.fontId;
-        textCacheEntry.mImageId = slot.mImageId;
-        textCacheEntry.mIndex = glyph.index;
-        newTextCache.PushBack( textCacheEntry );
-
-        AtlasManager::Vertex2D* verticesBuffer = newMesh.mVertices.Begin();
-
-        // Get the color of the character.
-        const ColorIndex colorIndex = useDefaultColor ? 0u : *( colorIndicesBuffer + i );
-        const Vector4& color = ( useDefaultColor || ( 0u == colorIndex ) ) ? defaultColor : *( colorsBuffer + colorIndex - 1u );
-
-        for( unsigned int index = 0u, size = newMesh.mVertices.Count();
-             index < size;
-             ++index )
+        if ( 0u != slot.mImageId ) // invalid slot id, glyph has failed to be added to atlas
         {
-          AtlasManager::Vertex2D& vertex = *( verticesBuffer + index );
+          // Generate mesh data for this quad, plugging in our supplied position
+          AtlasManager::Mesh2D newMesh;
+          mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
+          textCacheEntry.mFontId = glyph.fontId;
+          textCacheEntry.mImageId = slot.mImageId;
+          textCacheEntry.mIndex = glyph.index;
+          newTextCache.PushBack( textCacheEntry );
+
+          AtlasManager::Vertex2D* verticesBuffer = newMesh.mVertices.Begin();
+
+          // Get the color of the character.
+          const ColorIndex colorIndex = useDefaultColor ? 0u : *( colorIndicesBuffer + i );
+          const Vector4& color = ( useDefaultColor || ( 0u == colorIndex ) ) ? defaultColor : *( colorsBuffer + colorIndex - 1u );
+
+          for( unsigned int index = 0u, size = newMesh.mVertices.Count();
+               index < size;
+               ++index )
+          {
+            AtlasManager::Vertex2D& vertex = *( verticesBuffer + index );
 
-          // Set the color of the vertex.
-          vertex.mColor = color;
-        }
+            // Set the color of the vertex.
+            vertex.mColor = color;
+          }
 
-        // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
-        StitchTextMesh( meshContainer,
-                        newMesh,
-                        extents,
-                        position.y + glyph.yBearing,
-                        underlineGlyph,
-                        currentUnderlinePosition,
-                        currentUnderlineThickness,
-                        slot );
-        lastFontId = glyph.fontId;
+          // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
+          StitchTextMesh( meshContainer,
+                          newMesh,
+                          extents,
+                          position.y + glyph.yBearing,
+                          underlineGlyph,
+                          currentUnderlinePosition,
+                          currentUnderlineThickness,
+                          slot );
+
+          lastFontId = glyph.fontId; // Prevents searching for existing blocksizes when string of the same fontId.
+        }
       }
     } // glyphs
 
@@ -737,8 +742,9 @@ struct AtlasRenderer::Impl
            blockIt != blockEndIt;
            ++blockIt )
       {
-        if( (*blockIt).mFontId == fontId )
+        if( (*blockIt).mFontId == fontId )  // Different size fonts will have a different fontId
         {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Text::AtlasRenderer::CalculateBlocksSize match found fontID(%u) glyphIndex(%u)\n", fontId, (*glyphIt).index );
           foundFont = true;
           break;
         }
@@ -753,7 +759,7 @@ struct AtlasRenderer::Impl
         maxBlockSize.mNeededBlockWidth = static_cast< uint32_t >( fontMetrics.height );
         maxBlockSize.mNeededBlockHeight = maxBlockSize.mNeededBlockWidth;
         maxBlockSize.mFontId = fontId;
-
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Text::AtlasRenderer::CalculateBlocksSize New font with no matched blocksize, setting blocksize[%u]\n", maxBlockSize.mNeededBlockWidth );
         mBlockSizes.push_back( maxBlockSize );
       }
     }
old mode 100644 (file)
new mode 100755 (executable)
index 1821db4..b524710
@@ -59,11 +59,13 @@ struct GlyphData
  * @param[in] position The position of the glyph.
  * @param[in] color The color of the glyph.
  * @param[in] style The style of the text.
+ * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8).
  */
 void TypesetGlyph( GlyphData& data,
                    const Vector2* const position,
                    const Vector4* const color,
-                   Typesetter::Style style)
+                   Typesetter::Style style,
+                   Pixel::Format pixelFormat )
 {
   if( ( 0u == data.glyphBitmap.width ) || ( 0u == data.glyphBitmap.height ) )
   {
@@ -74,81 +76,138 @@ void TypesetGlyph( GlyphData& data,
   const int widthMinusOne = static_cast<int>( data.width - 1u );
   const int heightMinusOne = static_cast<int>( data.height - 1u );
 
-  // Whether the given glyph is a color one.
-  const bool isColorGlyph = Pixel::BGRA8888 == data.glyphBitmap.format;
-
-  // Pointer to the color glyph if there is one.
-  const uint32_t* const colorGlyphBuffer = isColorGlyph ? reinterpret_cast<uint32_t*>( data.glyphBitmap.buffer ) : NULL;
+  if ( Pixel::RGBA8888 == pixelFormat )
+  {
+    // Whether the given glyph is a color one.
+    const bool isColorGlyph = Pixel::BGRA8888 == data.glyphBitmap.format;
 
-  // Pack the given color into a 32bit buffer. The alpha channel will be updated later for each pixel.
-  // The format is RGBA8888.
-  uint32_t packedColor = 0u;
-  uint8_t* packedColorBuffer = reinterpret_cast<uint8_t*>( &packedColor );
-  *( packedColorBuffer + 2 ) = static_cast<uint8_t>( color->b * 255.f );
-  *( packedColorBuffer + 1 ) = static_cast<uint8_t>( color->g * 255.f );
-    *packedColorBuffer       = static_cast<uint8_t>( color->r * 255.f );
+    // Pointer to the color glyph if there is one.
+    const uint32_t* const colorGlyphBuffer = isColorGlyph ? reinterpret_cast<uint32_t*>( data.glyphBitmap.buffer ) : NULL;
 
-  // Initial vertical offset.
-  const int yOffset = data.verticalOffset + position->y;
+    // Pack the given color into a 32bit buffer. The alpha channel will be updated later for each pixel.
+    // The format is RGBA8888.
+    uint32_t packedColor = 0u;
+    uint8_t* packedColorBuffer = reinterpret_cast<uint8_t*>( &packedColor );
+    *( packedColorBuffer + 2 ) = static_cast<uint8_t>( color->b * 255.f );
+    *( packedColorBuffer + 1 ) = static_cast<uint8_t>( color->g * 255.f );
+      *packedColorBuffer       = static_cast<uint8_t>( color->r * 255.f );
 
-  // Traverse the pixels of the glyph line per line.
-  for( int lineIndex = 0, glyphHeight = static_cast<int>( data.glyphBitmap.height ); lineIndex < glyphHeight; ++lineIndex )
-  {
-    const int yOffsetIndex = yOffset + lineIndex;
-    if( ( 0 > yOffsetIndex ) || ( yOffsetIndex > heightMinusOne ) )
-    {
-      // Do not write out of bounds.
-      break;
-    }
+    // Initial vertical offset.
+    const int yOffset = data.verticalOffset + position->y;
 
-    const int verticalOffset = yOffsetIndex * data.width;
-    const int xOffset = data.horizontalOffset + position->x;
-    const int glyphBufferOffset = lineIndex * static_cast<int>( data.glyphBitmap.width );
-    for( int index = 0, glyphWidth = static_cast<int>( data.glyphBitmap.width ); index < glyphWidth; ++index )
+    // Traverse the pixels of the glyph line per line.
+    for( int lineIndex = 0, glyphHeight = static_cast<int>( data.glyphBitmap.height ); lineIndex < glyphHeight; ++lineIndex )
     {
-      const int xOffsetIndex = xOffset + index;
-      if( ( 0 > xOffsetIndex ) || ( xOffsetIndex > widthMinusOne ) )
+      const int yOffsetIndex = yOffset + lineIndex;
+      if( ( 0 > yOffsetIndex ) || ( yOffsetIndex > heightMinusOne ) )
       {
-        // Don't write out of bounds.
-        break;
+        // Do not write out of bounds.
+        continue;
       }
 
-      uint32_t* bitmapBuffer = reinterpret_cast< uint32_t* >( data.bitmapBuffer.GetBuffer() );
-
-      if( isColorGlyph )
+      const int verticalOffset = yOffsetIndex * data.width;
+      const int xOffset = data.horizontalOffset + position->x;
+      const int glyphBufferOffset = lineIndex * static_cast<int>( data.glyphBitmap.width );
+      for( int index = 0, glyphWidth = static_cast<int>( data.glyphBitmap.width ); index < glyphWidth; ++index )
       {
-        // Retrieves the color from the color glyph. The format is BGRA8888.
-        uint32_t packedColorGlyph = *( colorGlyphBuffer + glyphBufferOffset + index );
-        uint8_t* packedColorGlyphBuffer = reinterpret_cast<uint8_t*>( &packedColorGlyph );
-
-        if( Typesetter::STYLE_SHADOW == style )
-        {
-          // The shadow of color glyph needs to have the shadow color.
-          *( packedColorGlyphBuffer + 2 ) = static_cast<uint8_t>( color->b * 255.f );
-          *( packedColorGlyphBuffer + 1 ) = static_cast<uint8_t>( color->g * 255.f );
-            *packedColorGlyphBuffer       = static_cast<uint8_t>( color->r * 255.f );
-        }
-        else
+        const int xOffsetIndex = xOffset + index;
+        if( ( 0 > xOffsetIndex ) || ( xOffsetIndex > widthMinusOne ) )
         {
-          std::swap( *packedColorGlyphBuffer, *( packedColorGlyphBuffer + 2u ) ); // Swap B and R.
+          // Don't write out of bounds.
+          continue;
         }
 
-        // Update the alpha channel.
-        if( Typesetter::STYLE_MASK == style )
+        uint32_t* bitmapBuffer = reinterpret_cast< uint32_t* >( data.bitmapBuffer.GetBuffer() );
+
+        if( isColorGlyph )
         {
-          // Create an alpha mask for color glyph.
-          *( packedColorGlyphBuffer + 3u ) = 0u;
+          // Retrieves the color from the color glyph. The format is BGRA8888.
+          uint32_t packedColorGlyph = *( colorGlyphBuffer + glyphBufferOffset + index );
+          uint8_t* packedColorGlyphBuffer = reinterpret_cast<uint8_t*>( &packedColorGlyph );
+
+          if( Typesetter::STYLE_SHADOW == style )
+          {
+            // The shadow of color glyph needs to have the shadow color.
+            *( packedColorGlyphBuffer + 2 ) = static_cast<uint8_t>( color->b * 255.f );
+            *( packedColorGlyphBuffer + 1 ) = static_cast<uint8_t>( color->g * 255.f );
+              *packedColorGlyphBuffer       = static_cast<uint8_t>( color->r * 255.f );
+          }
+          else
+          {
+            std::swap( *packedColorGlyphBuffer, *( packedColorGlyphBuffer + 2u ) ); // Swap B and R.
+          }
+
+          // Update the alpha channel.
+          if( Typesetter::STYLE_MASK == style || Typesetter::STYLE_OUTLINE == style ) // Outline not shown for color glyph
+          {
+            // Create an alpha mask for color glyph.
+            *( packedColorGlyphBuffer + 3u ) = 0u;
+          }
+          else
+          {
+            *( packedColorGlyphBuffer + 3u ) = static_cast<uint8_t>( color->a * static_cast<float>( *( packedColorGlyphBuffer + 3u ) ) );
+          }
+
+          // Set the color into the final pixel buffer.
+          *( bitmapBuffer + verticalOffset + xOffsetIndex ) = packedColorGlyph;
         }
         else
         {
-          *( packedColorGlyphBuffer + 3u ) = static_cast<uint8_t>( color->a * static_cast<float>( *( packedColorGlyphBuffer + 3u ) ) );
+          // Update the alpha channel.
+          const uint8_t alpha = *( data.glyphBitmap.buffer + glyphBufferOffset + index );
+
+          // Copy non-transparent pixels only
+          if ( alpha > 0u )
+          {
+            // Check alpha of overlapped pixels
+            uint32_t& currentColor = *( bitmapBuffer + verticalOffset + xOffsetIndex );
+            uint8_t* packedCurrentColorBuffer = reinterpret_cast<uint8_t*>( &currentColor );
+
+            uint8_t currentAlpha = *( packedCurrentColorBuffer + 3u );
+            uint8_t newAlpha = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
+
+            // For any pixel overlapped with the pixel in previous glyphs, make sure we don't
+            // overwrite a previous bigger alpha with a smaller alpha (in order to avoid
+            // semi-transparent gaps between joint glyphs with overlapped pixels, which could
+            // happen, for example, in the RTL text when we copy glyphs from right to left).
+            *( packedColorBuffer + 3u ) = std::max( currentAlpha, newAlpha );
+
+            // Set the color into the final pixel buffer.
+            currentColor = packedColor;
+          }
         }
+      }
+    }
+  }
+  else
+  {
+    // Initial vertical offset.
+    const int yOffset = data.verticalOffset + position->y;
 
-        // Set the color into the final pixel buffer.
-        *( bitmapBuffer + verticalOffset + xOffsetIndex ) = packedColorGlyph;
+    // Traverse the pixels of the glyph line per line.
+    for( int lineIndex = 0, glyphHeight = static_cast<int>( data.glyphBitmap.height ); lineIndex < glyphHeight; ++lineIndex )
+    {
+      const int yOffsetIndex = yOffset + lineIndex;
+      if( ( 0 > yOffsetIndex ) || ( yOffsetIndex > heightMinusOne ) )
+      {
+        // Do not write out of bounds.
+        continue;
       }
-      else
+
+      const int verticalOffset = yOffsetIndex * data.width;
+      const int xOffset = data.horizontalOffset + position->x;
+      const int glyphBufferOffset = lineIndex * static_cast<int>( data.glyphBitmap.width );
+      for( int index = 0, glyphWidth = static_cast<int>( data.glyphBitmap.width ); index < glyphWidth; ++index )
       {
+        const int xOffsetIndex = xOffset + index;
+        if( ( 0 > xOffsetIndex ) || ( xOffsetIndex > widthMinusOne ) )
+        {
+          // Don't write out of bounds.
+          continue;
+        }
+
+        uint8_t* bitmapBuffer = reinterpret_cast< uint8_t* >( data.bitmapBuffer.GetBuffer() );
+
         // Update the alpha channel.
         const uint8_t alpha = *( data.glyphBitmap.buffer + glyphBufferOffset + index );
 
@@ -156,20 +215,14 @@ void TypesetGlyph( GlyphData& data,
         if ( alpha > 0u )
         {
           // Check alpha of overlapped pixels
-          uint32_t& currentColor = *( bitmapBuffer + verticalOffset + xOffsetIndex );
-          uint8_t* packedCurrentColorBuffer = reinterpret_cast<uint8_t*>( &currentColor );
-
-          uint8_t currentAlpha = *( packedCurrentColorBuffer + 3u );
+          uint8_t& currentAlpha = *( bitmapBuffer + verticalOffset + xOffsetIndex );
           uint8_t newAlpha = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
 
           // For any pixel overlapped with the pixel in previous glyphs, make sure we don't
           // overwrite a previous bigger alpha with a smaller alpha (in order to avoid
           // semi-transparent gaps between joint glyphs with overlapped pixels, which could
           // happen, for example, in the RTL text when we copy glyphs from right to left).
-          *( packedColorBuffer + 3u ) = std::max( currentAlpha, newAlpha );
-
-          // Set the color into the final pixel buffer.
-          currentColor = packedColor;
+          *( bitmapBuffer + verticalOffset + xOffsetIndex ) = std::max( currentAlpha, newAlpha );
         }
       }
     }
@@ -207,7 +260,7 @@ ViewModel* Typesetter::GetViewModel()
   return mModel;
 }
 
-PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bool ignoreHorizontalAlignment )
+PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat )
 {
   // @todo. This initial implementation for a TextLabel has only one visible page.
 
@@ -257,7 +310,7 @@ PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bo
   if( RENDER_MASK == behaviour )
   {
     // Generate the image buffer as an alpha mask for color glyphs.
-    imageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_MASK, ignoreHorizontalAlignment, penY, 0u, numberOfGlyphs - 1 );
+    imageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_MASK, ignoreHorizontalAlignment, pixelFormat, penY, 0u, numberOfGlyphs - 1 );
   }
   else if( RENDER_NO_TEXT == behaviour )
   {
@@ -268,11 +321,23 @@ PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bo
   else
   {
     // Generate the image buffer for the text with no style.
-    imageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_NONE, ignoreHorizontalAlignment, penY, 0u, numberOfGlyphs -1 );
+    imageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_NONE, ignoreHorizontalAlignment, pixelFormat, penY, 0u, numberOfGlyphs -1 );
   }
 
   if ( ( RENDER_NO_STYLES != behaviour ) && ( RENDER_MASK != behaviour ) )
   {
+
+    // Generate the outline if enabled
+    const float outlineWidth = mModel->GetOutlineWidth();
+    if ( outlineWidth > Math::MACHINE_EPSILON_1 )
+    {
+      // Create the image buffer for outline
+      Devel::PixelBuffer outlineImageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_OUTLINE, ignoreHorizontalAlignment, pixelFormat, penY, 0u, numberOfGlyphs -1 );
+
+      // Combine the two buffers
+      imageBuffer = CombineImageBuffer( imageBuffer, outlineImageBuffer, bufferWidth, bufferHeight );
+    }
+
     // @todo. Support shadow and underline for partial text later on.
 
     // Generate the shadow if enabled
@@ -280,7 +345,7 @@ PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bo
     if ( fabsf( shadowOffset.x ) > Math::MACHINE_EPSILON_1 || fabsf( shadowOffset.y ) > Math::MACHINE_EPSILON_1 )
     {
       // Create the image buffer for shadow
-      Devel::PixelBuffer shadowImageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_SHADOW, ignoreHorizontalAlignment, penY, 0u, numberOfGlyphs - 1 );
+      Devel::PixelBuffer shadowImageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_SHADOW, ignoreHorizontalAlignment, pixelFormat, penY, 0u, numberOfGlyphs - 1 );
 
       // Combine the two buffers
       imageBuffer = CombineImageBuffer( imageBuffer, shadowImageBuffer, bufferWidth, bufferHeight );
@@ -291,7 +356,7 @@ PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bo
     if ( underlineEnabled )
     {
       // Create the image buffer for underline
-      Devel::PixelBuffer underlineImageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_UNDERLINE, ignoreHorizontalAlignment, penY, 0u, numberOfGlyphs - 1 );
+      Devel::PixelBuffer underlineImageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_UNDERLINE, ignoreHorizontalAlignment, pixelFormat, penY, 0u, numberOfGlyphs - 1 );
 
       // Combine the two buffers
       imageBuffer = CombineImageBuffer( imageBuffer, underlineImageBuffer, bufferWidth, bufferHeight );
@@ -304,7 +369,7 @@ PixelData Typesetter::Render( const Vector2& size, RenderBehaviour behaviour, bo
   return pixelData;
 }
 
-Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth, const unsigned int bufferHeight, Typesetter::Style style, bool ignoreHorizontalAlignment, int verticalOffset, GlyphIndex fromGlyphIndex, GlyphIndex toGlyphIndex )
+Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth, const unsigned int bufferHeight, Typesetter::Style style, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat, int verticalOffset, GlyphIndex fromGlyphIndex, GlyphIndex toGlyphIndex )
 {
   // Retrieve lines, glyphs, positions and colors from the view model.
   const Length modelNumberOfLines = mModel->GetNumberOfLines();
@@ -322,13 +387,21 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth
   // Create and initialize the pixel buffer.
   GlyphData glyphData;
   glyphData.verticalOffset = verticalOffset;
-
   glyphData.width = bufferWidth;
   glyphData.height = bufferHeight;
-  const unsigned int bufferSizeInt = bufferWidth * bufferHeight;
-  const unsigned int bufferSizeChar = 4u * bufferSizeInt;
-  glyphData.bitmapBuffer = Devel::PixelBuffer::New( bufferWidth, bufferHeight, Pixel::RGBA8888 );
-  memset( glyphData.bitmapBuffer.GetBuffer(), 0u, bufferSizeChar );
+  glyphData.bitmapBuffer = Devel::PixelBuffer::New( bufferWidth, bufferHeight, pixelFormat );
+  glyphData.horizontalOffset = 0;
+
+  if ( Pixel::RGBA8888 == pixelFormat )
+  {
+    const unsigned int bufferSizeInt = bufferWidth * bufferHeight;
+    const unsigned int bufferSizeChar = 4u * bufferSizeInt;
+    memset( glyphData.bitmapBuffer.GetBuffer(), 0u, bufferSizeChar );
+  }
+  else
+  {
+    memset( glyphData.bitmapBuffer.GetBuffer(), 0, bufferWidth * bufferHeight );
+  }
 
   // Get a handle of the font client. Used to retrieve the bitmaps of the glyphs.
   TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
@@ -344,14 +417,27 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth
     // Increases the vertical offset with the line's ascender.
     glyphData.verticalOffset += static_cast<int>( line.ascender );
 
-    if ( style == Typesetter::STYLE_SHADOW )
+    // Retrieves the glyph's outline width
+    float outlineWidth = mModel->GetOutlineWidth();
+
+    if( style == Typesetter::STYLE_OUTLINE )
+    {
+      glyphData.horizontalOffset -= outlineWidth;
+      if( lineIndex == 0u )
+      {
+        // Only need to add the vertical outline offset for the first line
+        glyphData.verticalOffset -= outlineWidth;
+      }
+    }
+    else if ( style == Typesetter::STYLE_SHADOW )
     {
       const Vector2& shadowOffset = mModel->GetShadowOffset();
-      glyphData.horizontalOffset += shadowOffset.x;
+      glyphData.horizontalOffset += shadowOffset.x - outlineWidth; // if outline enabled then shadow should offset from outline
+
       if ( lineIndex == 0u )
       {
-        // Only need to add the vertical shadow offset for once
-        glyphData.verticalOffset += shadowOffset.y;
+        // Only need to add the vertical shadow offset for first line
+        glyphData.verticalOffset += shadowOffset.y - outlineWidth;
       }
     }
 
@@ -471,6 +557,10 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth
       {
         color = &( mModel->GetShadowColor() );
       }
+      else if ( style == Typesetter::STYLE_OUTLINE )
+      {
+        color = &( mModel->GetOutlineColor() );
+      }
       else
       {
         color = ( useDefaultColor || ( 0u == colorIndex ) ) ? &defaultColor : colorsBuffer + ( colorIndex - 1u );
@@ -480,9 +570,17 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth
       glyphData.glyphBitmap.buffer = NULL;
       glyphData.glyphBitmap.width = glyphInfo->width;   // Desired width and height.
       glyphData.glyphBitmap.height = glyphInfo->height;
+
+      if( style != Typesetter::STYLE_OUTLINE && style != Typesetter::STYLE_SHADOW )
+      {
+        // Don't render outline for other styles
+        outlineWidth = 0.0f;
+      }
+
       fontClient.CreateBitmap( glyphInfo->fontId,
                                glyphInfo->index,
-                               glyphData.glyphBitmap );
+                               glyphData.glyphBitmap,
+                               outlineWidth );
 
       // Sets the glyph's bitmap into the bitmap of the whole text.
       if( NULL != glyphData.glyphBitmap.buffer )
@@ -490,7 +588,8 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth
         TypesetGlyph( glyphData,
                       position,
                       color,
-                      style );
+                      style,
+                      pixelFormat);
         // delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer
         delete []glyphData.glyphBitmap.buffer;
         glyphData.glyphBitmap.buffer = NULL;
@@ -518,6 +617,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth
             break;
           }
 
+          // Always RGBA image for text with styles
           uint32_t* bitmapBuffer = reinterpret_cast< uint32_t* >( glyphData.bitmapBuffer.GetBuffer() );
           uint32_t underlinePixel = *( bitmapBuffer + y * glyphData.width + x );
           uint8_t* underlinePixelBuffer = reinterpret_cast<uint8_t*>( &underlinePixel );
@@ -565,6 +665,7 @@ Devel::PixelBuffer Typesetter::CombineImageBuffer( Devel::PixelBuffer topPixelBu
     return topPixelBuffer;
   }
 
+  // Always combine two RGBA images
   const unsigned int bufferSizeInt = bufferWidth * bufferHeight;
   const unsigned int bufferSizeChar = 4u * bufferSizeInt;
 
index c1408cc..285348e 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/images/pixel.h>
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
@@ -103,10 +104,11 @@ public:
    * @param[in] size The renderer size.
    * @param[in] behaviour The behaviour of how to render the text (i.e. whether to render the text only or the styles only or both).
    * @param[in] ignoreHorizontalAlignment Whether to ignore the horizontal alignment (i.e. always render as if HORIZONTAL_ALIGN_BEGIN).
+   * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8).
    *
    * @return A pixel data with the text rendered.
    */
-  PixelData Render( const Vector2& size, RenderBehaviour behaviour = RENDER_TEXT_AND_STYLES, bool ignoreHorizontalAlignment = false );
+  PixelData Render( const Vector2& size, RenderBehaviour behaviour = RENDER_TEXT_AND_STYLES, bool ignoreHorizontalAlignment = false, Pixel::Format pixelFormat = Pixel::RGBA8888 );
 
 private:
   /**
@@ -134,16 +136,17 @@ private:
    * @param[in] bufferHeight The height of the image buffer.
    * @param[in] style The style of the text.
    * @param[in] ignoreHorizontalAlignment Whether to ignore the horizontal alignment, not ignored by default.
+   * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8).
    * @param[in] verticalOffset The vertical offset to be added to the glyph's position.
    * @param[in] fromGlyphIndex The index of the first glyph within the text to be drawn
    * @param[in] toGlyphIndex The index of the last glyph within the text to be drawn
    *
    * @return An image buffer with the text.
    */
-  Devel::PixelBuffer CreateImageBuffer( const unsigned int bufferWidth, const unsigned int bufferHeight, Typesetter::Style style, bool ignoreHorizontalAlignment, int verticalOffset, TextAbstraction::GlyphIndex fromGlyphIndex, TextAbstraction::GlyphIndex toGlyphIndex );
+  Devel::PixelBuffer CreateImageBuffer( const unsigned int bufferWidth, const unsigned int bufferHeight, Typesetter::Style style, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat, int verticalOffset, TextAbstraction::GlyphIndex fromGlyphIndex, TextAbstraction::GlyphIndex toGlyphIndex );
 
   /**
-   * @brief Combine the two image buffers together.
+   * @brief Combine the two RGBA image buffers together.
    *
    * The top layer buffer will blend over the bottom layer buffer:
    * - If the pixel is not fully opaque from either buffer, it will be blended with
@@ -159,7 +162,7 @@ private:
    * @return The combined image buffer with the text.
    *
    */
-  Devel::PixelBuffer CombineImageBuffer( Devel::PixelBuffer topPixelBuffer, Devel::PixelBuffer bottomPixelBuffer, const unsigned int bufferWidth, const unsigned int bufferHeight );
+  Devel::PixelBuffer CombineImageBuffer( Devel::PixelBuffer topPixelBuffer, Devel::PixelBuffer bottomPixelBuffer, const unsigned int bufferWidth, const unsigned int bufferHeightbool );
 
 protected:
 
old mode 100644 (file)
new mode 100755 (executable)
index 3a0d319..fe3c451
@@ -86,6 +86,16 @@ const LineRun* const ViewModel::GetLines() const
   return mModel->GetLines();
 }
 
+Length ViewModel::GetNumberOfScripts() const
+{
+  return mModel->GetNumberOfScripts();
+}
+
+const ScriptRun* const ViewModel::GetScriptRuns() const
+{
+  return mModel->GetScriptRuns();
+}
+
 Length ViewModel::GetNumberOfGlyphs() const
 {
   if( mIsTextElided && mModel->IsTextElideEnabled() )
@@ -178,6 +188,16 @@ void ViewModel::GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex ind
   mModel->GetUnderlineRuns( underlineRuns, index, numberOfRuns );
 }
 
+const Vector4& ViewModel::GetOutlineColor() const
+{
+  return mModel->GetOutlineColor();
+}
+
+float ViewModel::GetOutlineWidth() const
+{
+  return mModel->GetOutlineWidth();
+}
+
 void ViewModel::ElideGlyphs()
 {
   mIsTextElided = false;
old mode 100644 (file)
new mode 100755 (executable)
index df0e32c..827ecf0
@@ -97,6 +97,16 @@ public:
   virtual const LineRun* const GetLines() const;
 
   /**
+   * @copydoc ModelInterface::GetNumberOfScripts()
+   */
+  virtual Length GetNumberOfScripts() const;
+
+  /**
+   * @copydoc ModelInterface::GetScriptRuns()
+   */
+  virtual const ScriptRun* const GetScriptRuns() const;
+
+  /**
    * @copydoc ModelInterface::GetNumberOfGlyphs()
    */
   virtual Length GetNumberOfGlyphs() const;
@@ -162,6 +172,16 @@ public:
   virtual void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const;
 
   /**
+   * @copydoc ModelInterface::GetOutlineColor()
+   */
+  virtual const Vector4& GetOutlineColor() const;
+
+  /**
+   * @copydoc ModelInterface::GetOutlineWidth()
+   */
+  virtual float GetOutlineWidth() const;
+
+ /**
    * @brief Does the text elide.
    *
    * It stores a copy of the visible glyphs and removes as many glyphs as needed
index 054f4a7..898e2c6 100644 (file)
@@ -27,6 +27,8 @@
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/text-model.h>
 #include <dali-toolkit/internal/text/text-view.h>
+#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 
 namespace Dali
 {
@@ -320,7 +322,8 @@ struct Controller::Impl
     mAutoScrollDirectionRTL( false ),
     mUnderlineSetByString( false ),
     mShadowSetByString( false ),
-    mFontStyleSetByString( false )
+    mFontStyleSetByString( false ),
+    mShouldClearFocusOnEscape( true )
   {
     mModel = Model::New();
 
@@ -336,6 +339,17 @@ struct Controller::Impl
     // Set the text properties to default
     mModel->mVisualModel->SetUnderlineEnabled( false );
     mModel->mVisualModel->SetUnderlineHeight( 0.0f );
+
+    Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+    if( styleManager )
+    {
+      bool temp;
+      Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
+      if( config["clearFocusOnEscape"].Get( temp ) )
+      {
+        mShouldClearFocusOnEscape = temp;
+      }
+    }
   }
 
   ~Impl()
@@ -730,6 +744,7 @@ public:
   bool mUnderlineSetByString:1;            ///< Set when underline is set by string (legacy) instead of map
   bool mShadowSetByString:1;               ///< Set when shadow is set by string (legacy) instead of map
   bool mFontStyleSetByString:1;            ///< Set when font style is set by string (legacy) instead of map
+  bool mShouldClearFocusOnEscape:1;        ///< Whether text control should clear key input focus
 };
 
 } // namespace Text
old mode 100644 (file)
new mode 100755 (executable)
index 8b0ee5b..482cfc3
@@ -686,7 +686,12 @@ void Controller::SetDefaultFontWeight( FontWeight weight )
 
 bool Controller::IsDefaultFontWeightDefined() const
 {
-  return mImpl->mFontDefaults->weightDefined;
+  if( NULL != mImpl->mFontDefaults )
+  {
+    return mImpl->mFontDefaults->weightDefined;
+  }
+
+  return false;
 }
 
 FontWeight Controller::GetDefaultFontWeight() const
@@ -752,7 +757,12 @@ void Controller::SetDefaultFontWidth( FontWidth width )
 
 bool Controller::IsDefaultFontWidthDefined() const
 {
-  return mImpl->mFontDefaults->widthDefined;
+  if( NULL != mImpl->mFontDefaults )
+  {
+    return mImpl->mFontDefaults->widthDefined;
+  }
+
+  return false;
 }
 
 FontWidth Controller::GetDefaultFontWidth() const
@@ -818,7 +828,11 @@ void Controller::SetDefaultFontSlant( FontSlant slant )
 
 bool Controller::IsDefaultFontSlantDefined() const
 {
-  return mImpl->mFontDefaults->slantDefined;
+  if( NULL != mImpl->mFontDefaults )
+  {
+    return mImpl->mFontDefaults->slantDefined;
+  }
+  return false;
 }
 
 FontSlant Controller::GetDefaultFontSlant() const
@@ -1115,6 +1129,30 @@ float Controller::GetUnderlineHeight() const
   return mImpl->mModel->mVisualModel->GetUnderlineHeight();
 }
 
+void Controller::SetOutlineColor( const Vector4& color )
+{
+  mImpl->mModel->mVisualModel->SetOutlineColor( color );
+
+  mImpl->RequestRelayout();
+}
+
+const Vector4& Controller::GetOutlineColor() const
+{
+  return mImpl->mModel->mVisualModel->GetOutlineColor();
+}
+
+void Controller::SetOutlineWidth( float width )
+{
+  mImpl->mModel->mVisualModel->SetOutlineWidth( width );
+
+  mImpl->RequestRelayout();
+}
+
+float Controller::GetOutlineWidth() const
+{
+  return mImpl->mModel->mVisualModel->GetOutlineWidth();
+}
+
 void Controller::SetDefaultEmbossProperties( const std::string& embossProperties )
 {
   if( NULL == mImpl->mEmbossDefaults )
@@ -2222,13 +2260,10 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
       // Do nothing.
       return false;
     }
-    else if( Dali::DALI_KEY_ESCAPE == keyCode )
+    else if( Dali::DALI_KEY_ESCAPE == keyCode || Dali::DALI_KEY_BACK == keyCode )
     {
-      // Escape key is a special case which causes focus loss
-      KeyboardFocusLostEvent();
-
-      // Will request for relayout.
-      relayoutNeeded = true;
+      // Do nothing
+      return false;
     }
     else if( ( Dali::DALI_KEY_CURSOR_LEFT  == keyCode ) ||
              ( Dali::DALI_KEY_CURSOR_RIGHT == keyCode ) ||
@@ -3688,6 +3723,11 @@ void Controller::SetControlInterface( ControlInterface* controlInterface )
   mImpl->mControlInterface = controlInterface;
 }
 
+bool Controller::ShouldClearFocusOnEscape() const
+{
+  return mImpl->mShouldClearFocusOnEscape;
+}
+
 // private : Private contructors & copy operator.
 
 Controller::Controller()
old mode 100644 (file)
new mode 100755 (executable)
index 5cb079c..3d0eb6c
@@ -777,6 +777,34 @@ public: // Default style & Input style
   float GetUnderlineHeight() const;
 
   /**
+   * @brief Set the outline color.
+   *
+   * @param[in] color color of outline.
+   */
+  void SetOutlineColor( const Vector4& color );
+
+  /**
+   * @brief Retrieve the outline color.
+   *
+   * @return The outline color.
+   */
+  const Vector4& GetOutlineColor() const;
+
+  /**
+   * @brief Set the outline width
+   *
+   * @param[in] width The width in pixels of the outline, 0 indicates no outline
+   */
+  void SetOutlineWidth( float width );
+
+  /**
+   * @brief Retrieves the width of an outline
+   *
+   * @return The width of the outline.
+   */
+  float GetOutlineWidth() const;
+
+  /**
    * @brief Sets the emboss's properties string.
    *
    * @note The string is stored to be recovered.
@@ -1180,6 +1208,13 @@ public: // Text-input Event Queuing.
    */
   void PasteClipboardItemEvent();
 
+  /**
+   * @brief Return true when text control should clear key input focus when escape key is pressed.
+   *
+   * @return Whether text control should clear key input focus or not when escape key is pressed.
+   */
+  bool ShouldClearFocusOnEscape() const;
+
 protected: // Inherit from Text::Decorator::ControllerInterface.
 
   /**
old mode 100644 (file)
new mode 100755 (executable)
index 75fabd7..8b71d30
@@ -35,6 +35,7 @@ namespace
 {
 const std::string COLOR_KEY( "color" );
 const std::string OFFSET_KEY( "offset" );
+const std::string WIDTH_KEY( "width" );
 const std::string HEIGHT_KEY( "height" );
 const std::string ENABLE_KEY( "enable" );
 const std::string TRUE_TOKEN( "true" );
@@ -120,6 +121,36 @@ bool ParseUnderlineProperties( const Property::Map& underlinePropertiesMap,
   return 0u == numberOfItems;
 }
 
+bool ParseOutlineProperties( const Property::Map& underlinePropertiesMap,
+                               bool& colorDefined,
+                               Vector4& color,
+                               bool& widthDefined,
+                               float& width )
+{
+  const unsigned int numberOfItems = underlinePropertiesMap.Count();
+
+  // Parses and applies the style.
+  for( unsigned int index = 0u; index < numberOfItems; ++index )
+  {
+    const KeyValuePair& valueGet = underlinePropertiesMap.GetKeyValue( index );
+
+    if( COLOR_KEY == valueGet.first.stringKey )
+    {
+      /// Color key.
+      colorDefined = true;
+      color = valueGet.second.Get<Vector4>();
+    }
+    else if( WIDTH_KEY == valueGet.first.stringKey )
+    {
+      /// Width key.
+      widthDefined = true;
+      width = valueGet.second.Get<float>();
+    }
+  }
+
+  return 0u == numberOfItems;
+}
+
 bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type )
 {
   bool update = false;
@@ -463,24 +494,63 @@ bool SetOutlineProperties( ControllerPtr controller, const Property::Value& valu
 
   if( controller )
   {
-    const std::string properties = value.Get< std::string >();
-
     switch( type )
     {
       case EffectStyle::DEFAULT:
       {
-        // Stores the default outline's properties string to be recovered by the GetOutlineProperties() function.
-        controller->SetDefaultOutlineProperties( properties );
+        const Property::Map& propertiesMap = value.Get<Property::Map>();
+
+        bool colorDefined = false;
+        Vector4 color;
+        bool widthDefined = false;
+        float width = 0.f;
+
+        bool empty = true;
+
+        if ( !propertiesMap.Empty() )
+        {
+           empty = ParseOutlineProperties( propertiesMap,
+                                           colorDefined,
+                                           color,
+                                           widthDefined,
+                                           width );
+        }
+
+        if( !empty )
+        {
+          // Sets the default outline values.
+          if( colorDefined && ( controller->GetOutlineColor() != color ) )
+          {
+            controller->SetOutlineColor( color );
+            update = true;
+          }
+
+          if( widthDefined && ( fabsf( controller->GetOutlineWidth() - width ) > Math::MACHINE_EPSILON_1000 ) )
+          {
+            controller->SetOutlineWidth( width );
+            update = true;
+          }
+        }
+        else
+        {
+          // Disable outline
+          if( fabsf( controller->GetOutlineWidth() ) > Math::MACHINE_EPSILON_1000 )
+          {
+            controller->SetOutlineWidth( 0.0f );
+            update = true;
+          }
+        }
         break;
       }
       case EffectStyle::INPUT:
       {
-        // Stores the input outline's properties string to be recovered by the GetOutlineProperties() function.
-        controller->SetInputOutlineProperties( properties );
+        const std::string& outlineProperties = value.Get<std::string>();
+
+        controller->SetInputOutlineProperties( outlineProperties );
         break;
       }
-    }
-  }
+    } // switch
+  } // if( controller )
 
   return update;
 }
@@ -493,7 +563,21 @@ void GetOutlineProperties( ControllerPtr controller, Property::Value& value, Eff
     {
       case EffectStyle::DEFAULT:
       {
-        value = controller->GetDefaultOutlineProperties();
+        const Vector4& color = controller->GetOutlineColor();
+        const float width = controller->GetOutlineWidth();
+
+        Property::Map map;
+
+        std::string colorStr;
+        Vector4ToColorString( color, colorStr );
+        map.Insert( COLOR_KEY, colorStr );
+
+        std::string widthStr;
+        FloatToString( width, widthStr );
+        map.Insert( WIDTH_KEY, widthStr );
+
+        value = map;
+
         break;
       }
       case EffectStyle::INPUT:
old mode 100644 (file)
new mode 100755 (executable)
index 4ab61a3..521f52c
@@ -72,6 +72,21 @@ bool ParseUnderlineProperties( const Property::Map& underlineProperties,
                                float& height );
 
 /**
+ * @brief Parses the outline properties.
+ *
+ * @param[in] outlineProperties The map with the outline properties.
+ * @param[out] colorDefined Whether the outline's color is defined.
+ * @param[out] color The outline's color.
+ * @param[out] widthDefined Whether the outline's width is defined.
+ * @param[out] width The outline's width.
+ */
+bool ParseOutlineProperties( const Property::Map& outlineProperties,
+                               bool& colorDefined,
+                               Vector4& color,
+                               bool& widthDefined,
+                               float& width );
+
+/**
  * @brief Sets the underline properties.
  *
  * @param[in] controller The text's controller.
old mode 100644 (file)
new mode 100755 (executable)
index d84b46a..18cb7cc
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/layouts/layout-alignment.h>
 #include <dali-toolkit/internal/text/line-run.h>
+#include <dali-toolkit/internal/text/script-run.h>
 #include <dali-toolkit/internal/text/text-definitions.h>
 
 namespace Dali
@@ -104,6 +105,20 @@ public:
   virtual const LineRun* const GetLines() const = 0;
 
   /**
+   * @brief Retrieves the number of script runs.
+   *
+   * @return The number of script runs.
+   */
+  virtual Length GetNumberOfScripts() const = 0;
+
+  /**
+   * @brief Retrieves the script runs.
+   *
+   * @return A pointer to the vector with the runs of characters with the same script..
+   */
+  virtual const ScriptRun* const GetScriptRuns() const = 0;
+
+  /**
    * @brief Retrieves the number of laid-out glyphs.
    *
    * @return The number of laid-out glyphs.
@@ -195,6 +210,21 @@ public:
    * @param[in] numberOfRuns Number of underline runs to be copied.
    */
   virtual void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const = 0;
+
+  /**
+   * @brief Retrieve the outline color.
+   *
+   * @return The outline color.
+   */
+  virtual const Vector4& GetOutlineColor() const = 0;
+
+  /**
+   * @brief Retrieves the width of an outline
+   *
+   * @return The width of the outline.
+   */
+  virtual float GetOutlineWidth() const = 0;
+
 };
 
 } // namespace Text
old mode 100644 (file)
new mode 100755 (executable)
index 05cb405..cf6f35c
@@ -72,6 +72,16 @@ const LineRun* const Model::GetLines() const
   return mVisualModel->mLines.Begin();
 }
 
+Length Model::GetNumberOfScripts() const
+{
+  return mLogicalModel->mScriptRuns.Count();
+}
+
+const ScriptRun* const Model::GetScriptRuns() const
+{
+  return mLogicalModel->mScriptRuns.Begin();
+}
+
 Length Model::GetNumberOfGlyphs() const
 {
   return mVisualModel->mGlyphs.Count();
@@ -137,6 +147,16 @@ void Model::GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index,
   mVisualModel->GetUnderlineRuns( underlineRuns, index, numberOfRuns );
 }
 
+const Vector4& Model::GetOutlineColor() const
+{
+  return mVisualModel->GetOutlineColor();
+}
+
+float Model::GetOutlineWidth() const
+{
+  return mVisualModel->GetOutlineWidth();
+}
+
 Model::Model()
 : mLogicalModel(),
   mVisualModel(),
old mode 100644 (file)
new mode 100755 (executable)
index d8b08e9..cd49581
@@ -100,6 +100,16 @@ public:
   virtual const LineRun* const GetLines() const;
 
   /**
+   * @copydoc ModelInterface::GetNumberOfScripts()
+   */
+  virtual Length GetNumberOfScripts() const;
+
+  /**
+   * @copydoc ModelInterface::GetScriptRuns()
+   */
+  virtual const ScriptRun* const GetScriptRuns() const;
+
+  /**
    * @copydoc ModelInterface::GetNumberOfGlyphs()
    */
   virtual Length GetNumberOfGlyphs() const;
@@ -164,6 +174,16 @@ public:
    */
   virtual void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const;
 
+  /**
+   * @copydoc ModelInterface::GetOutlineColor()
+   */
+  virtual const Vector4& GetOutlineColor() const;
+
+  /**
+   * @copydoc ModelInterface::GetOutlineWidth()
+   */
+  virtual float GetOutlineWidth() const;
+
 private: // Private contructors & copy operator.
 
   /**
old mode 100644 (file)
new mode 100755 (executable)
index 1b114c4..3e3f2d6
@@ -350,6 +350,11 @@ void VisualModel::SetUnderlineColor( const Vector4& color )
   mUnderlineColorSet = true;
 }
 
+void VisualModel::SetOutlineColor( const Vector4& color )
+{
+  mOutlineColor = color;
+}
+
 void VisualModel::SetUnderlineEnabled( bool enabled )
 {
   mUnderlineEnabled = enabled;
@@ -360,6 +365,11 @@ void VisualModel::SetUnderlineHeight( float height )
   mUnderlineHeight = height;
 }
 
+void VisualModel::SetOutlineWidth( float width )
+{
+  mOutlineWidth = width;
+}
+
 const Vector4& VisualModel::GetTextColor() const
 {
   return mTextColor;
@@ -380,6 +390,11 @@ const Vector4& VisualModel::GetUnderlineColor() const
   return mUnderlineColor;
 }
 
+const Vector4& VisualModel::GetOutlineColor() const
+{
+  return mOutlineColor;
+}
+
 bool VisualModel::IsUnderlineEnabled() const
 {
   return mUnderlineEnabled;
@@ -390,6 +405,11 @@ float VisualModel::GetUnderlineHeight() const
   return mUnderlineHeight;
 }
 
+float VisualModel::GetOutlineWidth() const
+{
+  return mOutlineWidth;
+}
+
 Length VisualModel::GetNumberOfUnderlineRuns() const
 {
   return mUnderlineRuns.Count();
@@ -415,9 +435,11 @@ VisualModel::VisualModel()
   mTextColor( Color::BLACK ),
   mShadowColor( Color::BLACK ),
   mUnderlineColor( Color::BLACK ),
+  mOutlineColor( Color::WHITE ),
   mControlSize(),
   mShadowOffset(),
   mUnderlineHeight( 0.0f ),
+  mOutlineWidth( 0.0f ),
   mNaturalSize(),
   mLayoutSize(),
   mCachedLineIndex( 0u ),
old mode 100644 (file)
new mode 100755 (executable)
index 6356f32..ea888cd
@@ -287,6 +287,34 @@ public:
    */
   Length GetNumberOfUnderlineRuns() const;
 
+  /**
+   * @brief Set the outline color.
+   *
+   * @param[in] color color of outline.
+   */
+  void SetOutlineColor( const Vector4& color );
+
+  /**
+   * @brief Retrieve the outline color.
+   *
+   * @return The outline color.
+   */
+  const Vector4& GetOutlineColor() const;
+
+  /**
+   * @brief Set the outline width
+   *
+   * @param[in] width The width in pixels of the outline, 0 indicates no outline
+   */
+  void SetOutlineWidth( float width );
+
+  /**
+   * @brief Retrieves the width of an outline
+   *
+   * @return The width of the outline.
+   */
+  float GetOutlineWidth() const;
+
 protected:
 
   /**
@@ -323,9 +351,11 @@ public:
   Vector4                mTextColor;            ///< The text color
   Vector4                mShadowColor;          ///< Color of drop shadow
   Vector4                mUnderlineColor;       ///< Color of underline
+  Vector4                mOutlineColor;         ///< Color of outline
   Size                   mControlSize;          ///< The size of the UI control.
   Vector2                mShadowOffset;         ///< Offset for drop shadow, 0 indicates no shadow
   float                  mUnderlineHeight;      ///< Fixed height for underline to override font metrics.
+  float                  mOutlineWidth;         ///< Width of outline.
 
 private:
 
index be736e1..9f775a1 100644 (file)
@@ -266,15 +266,26 @@ void AnimatedImageVisual::DoSetProperty( Property::Index index,
     case Toolkit::ImageVisual::Property::WRAP_MODE_U:
     {
       int wrapMode;
-      Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode );
-      mWrapModeU = Dali::WrapMode::Type( wrapMode );
-      break;
+      if(Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode ))
+      {
+        mWrapModeU = Dali::WrapMode::Type(wrapMode);
+      }
+      else
+      {
+        mWrapModeU = Dali::WrapMode::Type::DEFAULT;
+      }
     }
     case Toolkit::ImageVisual::Property::WRAP_MODE_V:
     {
       int wrapMode;
-      Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode );
-      mWrapModeV = Dali::WrapMode::Type( wrapMode );
+      if(Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode ))
+      {
+        mWrapModeV = Dali::WrapMode::Type(wrapMode);
+      }
+      else
+      {
+        mWrapModeV = Dali::WrapMode::Type::DEFAULT;
+      }
       break;
     }
 
@@ -466,7 +477,7 @@ TextureSet AnimatedImageVisual::PrepareAnimatedGifImage()
   // load from image file
   std::vector<Dali::PixelData> pixelDataList;
 
-  if( mImageUrl.IsLocal() )
+  if( mImageUrl.IsLocalResource() )
   {
     if( Dali::LoadAnimatedGifFromFile( mImageUrl.GetUrl().c_str() , pixelDataList, mFrameDelayContainer ) )
     {
index b30a11a..4c59447 100644 (file)
@@ -19,7 +19,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 
 namespace Dali
 {
index 5061d76..12e89e9 100644 (file)
@@ -19,7 +19,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 
 namespace Dali
 {
index 6f5607c..1aed961 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <dali/devel-api/common/circular-queue.h>
 #include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 
 namespace Dali
 {
index dcb222d..ee0042a 100644 (file)
@@ -34,7 +34,7 @@
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
@@ -554,7 +554,7 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize )
   }
   else if( mImageUrl.IsValid() )
   {
-    if( mImageUrl.GetLocation() == VisualUrl::LOCAL )
+    if( mImageUrl.GetProtocolType() == VisualUrl::LOCAL )
     {
       ImageDimensions dimensions = Dali::GetClosestImageSize( mImageUrl.GetUrl() );
 
@@ -787,7 +787,7 @@ void ImageVisual::InitializeRenderer()
 {
   mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
 
-  if( ! mImpl->mCustomShader && mImageUrl.GetLocation() == VisualUrl::LOCAL )
+  if( ! mImpl->mCustomShader && mImageUrl.GetProtocolType() == VisualUrl::LOCAL )
   {
     bool defaultWrapMode = mWrapModeU <= WrapMode::CLAMP_TO_EDGE && mWrapModeV <= WrapMode::CLAMP_TO_EDGE;
 
index 9235545..7be7301 100755 (executable)
@@ -264,7 +264,7 @@ void NPatchVisual::GetNaturalSize( Vector2& naturalSize )
   naturalSize.y = 0u;
 
   // load now if not already loaded
-  if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocal() )
+  if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocalResource() )
   {
     mId = mLoader.Load( mImageUrl.GetUrl(), mBorder );
   }
@@ -304,7 +304,7 @@ void NPatchVisual::DoSetProperties( const Property::Map& propertyMap )
 void NPatchVisual::DoSetOnStage( Actor& actor )
 {
   // load when first go on stage
-  if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocal() )
+  if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocalResource() )
   {
     mId = mLoader.Load( mImageUrl.GetUrl(), mBorder );
   }
index 1e95223..ef2fdae 100644 (file)
@@ -155,7 +155,7 @@ void SvgVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
 void SvgVisual::ParseFromUrl( const VisualUrl& imageUrl )
 {
   mImageUrl = imageUrl;
-  if( mImageUrl.IsLocal() )
+  if( mImageUrl.IsLocalResource() )
   {
     Vector2 dpi = Stage::GetCurrent().GetDpi();
     float meanDpi = (dpi.height + dpi.width) * 0.5f;
old mode 100644 (file)
new mode 100755 (executable)
index 46cb2a1..4031f94
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/constraints.h>
+#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
 
 // INTERNAL HEADER
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
@@ -31,6 +32,7 @@
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
 #include <dali-toolkit/internal/text/text-font-style.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
+#include <dali-toolkit/internal/text/script-run.h>
 
 namespace Dali
 {
@@ -80,7 +82,11 @@ std::string GetHorizontalAlignment( Toolkit::Text::Layout::HorizontalAlignment a
                                                                                                 HORIZONTAL_ALIGNMENT_STRING_TABLE,
                                                                                                 HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
 
-  return std::string( name );
+  if( name )
+  {
+    return std::string( name );
+  }
+  return std::string();
 }
 
 std::string GetVerticalAlignment( Toolkit::Text::Layout::VerticalAlignment alignment )
@@ -89,7 +95,11 @@ std::string GetVerticalAlignment( Toolkit::Text::Layout::VerticalAlignment align
                                                                                                 VERTICAL_ALIGNMENT_STRING_TABLE,
                                                                                                 VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
 
-  return std::string( name );
+  if( name )
+  {
+    return std::string( name );
+  }
+  return std::string();
 }
 
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
@@ -129,7 +139,7 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   }\n
 );
 
-const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
+const char* FRAGMENT_SHADER_ATLAS_CLAMP_RGBA = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform sampler2D sStyle;\n
@@ -160,6 +170,25 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
   }\n
 );
 
+const char* FRAGMENT_SHADER_ATLAS_CLAMP_L8 = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vTexCoord;\n
+  uniform sampler2D sTexture;\n
+  uniform lowp vec4 uTextColorAnimatable;\n
+  uniform mediump vec4 uAtlasRect;\n
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform lowp float opacity;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
+    mediump float textTexture = texture2D( sTexture, texCoord ).r;\n
+
+    // Set the color of the text to what it is animated to.
+    gl_FragColor = uTextColorAnimatable * textTexture * uColor * vec4( mixColor, opacity );\n
+  }\n
+);
+
 /**
  * Return Property index for the given string key
  * param[in] stringKey the string index key
@@ -351,15 +380,7 @@ void TextVisual::DoSetOnStage( Actor& actor )
   mControl = actor;
 
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
-
-  Shader shader = mFactoryCache.GetShader( VisualFactoryCache::TEXT_SHADER );
-  if( ! shader )
-  {
-    shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_ATLAS_CLAMP );
-    shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
-
-    mFactoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER, shader );
-  }
+  Shader shader = GetTextShader(mFactoryCache, true);
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
   mImpl->mRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, Toolkit::DepthIndex::CONTENT );
@@ -545,66 +566,138 @@ void TextVisual::UpdateRenderer()
     if( ( relayoutSize.width > Math::MACHINE_EPSILON_1000 ) &&
         ( relayoutSize.height > Math::MACHINE_EPSILON_1000 ) )
     {
-      Vector4 atlasRect = FULL_TEXTURE_RECT;
+      // Check whether it is a markup text with multiple text colors
+      const Vector4* const colorsBuffer = mController->GetTextModel()->GetColors();
+      bool hasMultipleTextColors = ( NULL != colorsBuffer );
 
-      // Create a texture for the text without any styles
-      PixelData data = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_NO_STYLES );
+      // Check whether the text contains any emoji
+      bool containsEmoji = false;
 
-      // It may happen the image atlas can't handle a pixel data it exceeds the maximum size.
-      // In that case, create a texture. TODO: should tile the text.
+      Text::ScriptRunIndex numberOfScripts = mController->GetTextModel()->GetNumberOfScripts();
+      const Text::ScriptRun* scripts = mController->GetTextModel()->GetScriptRuns();
+      for ( Text::ScriptRunIndex scriptIndex = 0u; scriptIndex < numberOfScripts; scriptIndex++ )
+      {
+        const Text::ScriptRun& scriptRun = *( scripts + scriptIndex );
+        if( TextAbstraction::EMOJI == scriptRun.script )
+        {
+          containsEmoji = true;
+          break;
+        }
+      }
 
-      Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D,
-                                      data.GetPixelFormat(),
-                                      data.GetWidth(),
-                                      data.GetHeight() );
+      // Check whether the text contains any style colors (e.g. underline color, shadow color, etc.)
 
-      texture.Upload( data );
+      bool shadowEnabled = false;
+      const Vector2& shadowOffset = mController->GetTextModel()->GetShadowOffset();
+      if ( fabsf( shadowOffset.x ) > Math::MACHINE_EPSILON_1 || fabsf( shadowOffset.y ) > Math::MACHINE_EPSILON_1 )
+      {
+        shadowEnabled = true;
+      }
 
-      TextureSet textureSet = TextureSet::New();
-      textureSet.SetTexture( 0u, texture );
+      bool outlineWidthEnabled = false;
+      float outlineWidth = mController->GetTextModel()->GetOutlineWidth();
+      if ( outlineWidth > Math::MACHINE_EPSILON_1 )
+      {
+        outlineWidthEnabled = true;
+      }
+
+      const bool underlineEnabled = mController->GetTextModel()->IsUnderlineEnabled();
+
+      if ( hasMultipleTextColors || containsEmoji || shadowEnabled || underlineEnabled || outlineWidthEnabled )
+      {
+        // Create RGBA textures if the text contains emojis or styles or multiple text colors
 
-      // Create a texture for all the text styles (without the text itself)
-      PixelData styleData = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_NO_TEXT );
+        // Create a texture for the text without any styles
+        PixelData data = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_NO_STYLES );
 
-      Texture styleTexture = Texture::New( Dali::TextureType::TEXTURE_2D,
-                                           styleData.GetPixelFormat(),
-                                           styleData.GetWidth(),
-                                           styleData.GetHeight() );
+        // It may happen the image atlas can't handle a pixel data it exceeds the maximum size.
+        // In that case, create a texture. TODO: should tile the text.
 
-      styleTexture.Upload( styleData );
+        Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D,
+                                        data.GetPixelFormat(),
+                                        data.GetWidth(),
+                                        data.GetHeight() );
 
-      textureSet.SetTexture( 1u, styleTexture );
+        texture.Upload( data );
 
-      // Create a texture as a mask to avoid color glyphs (e.g. emojis) to be affected by text color animation
-      PixelData maskData = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_MASK );
+        TextureSet textureSet = TextureSet::New();
+        textureSet.SetTexture( 0u, texture );
 
-      Texture maskTexture = Texture::New( Dali::TextureType::TEXTURE_2D,
-                                          styleData.GetPixelFormat(),
-                                          styleData.GetWidth(),
-                                          styleData.GetHeight() );
+        // Create a texture for all the text styles (without the text itself)
+        PixelData styleData = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_NO_TEXT );
 
-      maskTexture.Upload( maskData );
+        Texture styleTexture = Texture::New( Dali::TextureType::TEXTURE_2D,
+                                             styleData.GetPixelFormat(),
+                                             styleData.GetWidth(),
+                                             styleData.GetHeight() );
 
-      textureSet.SetTexture( 2u, maskTexture );
+        styleTexture.Upload( styleData );
 
-      // Filter mode needs to be set to linear to produce better quality while scaling.
-      Sampler sampler = Sampler::New();
-      sampler.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
-      textureSet.SetSampler( 0u, sampler );
-      textureSet.SetSampler( 1u, sampler );
-      textureSet.SetSampler( 2u, sampler );
+        textureSet.SetTexture( 1u, styleTexture );
 
-      mImpl->mRenderer.SetTextures( textureSet );
+        // Create a texture as a mask to avoid color glyphs (e.g. emojis) to be affected by text color animation
+        PixelData maskData = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_MASK );
+
+        Texture maskTexture = Texture::New( Dali::TextureType::TEXTURE_2D,
+                                            styleData.GetPixelFormat(),
+                                            styleData.GetWidth(),
+                                            styleData.GetHeight() );
+
+        maskTexture.Upload( maskData );
+
+        textureSet.SetTexture( 2u, maskTexture );
+
+        // Filter mode needs to be set to nearest to produce better quality while static.
+        Sampler sampler = Sampler::New();
+        sampler.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
+        textureSet.SetSampler( 0u, sampler );
+        textureSet.SetSampler( 1u, sampler );
+        textureSet.SetSampler( 2u, sampler );
+
+        mImpl->mRenderer.SetTextures( textureSet );
+
+        Shader shader = GetTextShader(mFactoryCache, true); // RGBA shader
+        mImpl->mRenderer.SetShader(shader);
+      }
+      else
+      {
+        // Create L8 texture if the text contains only single text color with no emoji and no style
+
+        // Create a texture for the text without any styles
+        PixelData data = mTypesetter->Render( relayoutSize, Text::Typesetter::RENDER_NO_STYLES, false, Pixel::L8 );
+
+        // It may happen the image atlas can't handle a pixel data it exceeds the maximum size.
+        // In that case, create a texture. TODO: should tile the text.
+
+        Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D,
+                                        data.GetPixelFormat(),
+                                        data.GetWidth(),
+                                        data.GetHeight() );
+
+        texture.Upload( data );
+
+        TextureSet textureSet = TextureSet::New();
+        textureSet.SetTexture( 0u, texture );
+
+        // Filter mode needs to be set to nearest to produce better quality while static.
+        Sampler sampler = Sampler::New();
+        sampler.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
+        textureSet.SetSampler( 0u, sampler );
+
+        mImpl->mRenderer.SetTextures( textureSet );
+
+        Shader shader = GetTextShader(mFactoryCache, false); // L8 shader
+        mImpl->mRenderer.SetShader(shader);
+      }
 
       mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
 
+      Vector4 atlasRect = FULL_TEXTURE_RECT;
       mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
-
-      // Check whether it is a markup text with multiple text colors
-      const Vector4* const colorsBuffer = mController->GetTextModel()->GetColors();
-      bool hasMultipleTextColors = ( NULL != colorsBuffer );
       mImpl->mRenderer.RegisterProperty( "uHasMultipleTextColors", static_cast<float>( hasMultipleTextColors ) );
 
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON);
+
       //Register transform properties
       mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 
@@ -635,6 +728,33 @@ void TextVisual::RemoveTextureSet()
   }
 }
 
+Shader TextVisual::GetTextShader( VisualFactoryCache& factoryCache, bool isRgbaTexture )
+{
+  Shader shader;
+  if( isRgbaTexture )
+  {
+    shader = factoryCache.GetShader( VisualFactoryCache::TEXT_SHADER_RGBA );
+    if( !shader )
+    {
+      shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_ATLAS_CLAMP_RGBA );
+      shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
+      factoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER_RGBA, shader );
+    }
+  }
+  else
+  {
+    shader = factoryCache.GetShader( VisualFactoryCache::TEXT_SHADER_L8 );
+    if( !shader )
+    {
+      shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_ATLAS_CLAMP_L8 );
+      shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
+      factoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER_L8, shader );
+    }
+  }
+
+  return shader;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 2ed7bee..31353b9 100644 (file)
@@ -192,6 +192,13 @@ private:
   void RemoveTextureSet();
 
   /**
+   * Get the text rendering shader.
+   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] isRgbaTexture Whether the texture is in RGBA format.
+   */
+  Shader GetTextShader( VisualFactoryCache& factoryCache, bool isRgbaTexture );
+
+  /**
    * @brief Retrieve the text's controller.
    * @param[in] visual The text visual.
    * @return The text controller
  */
 
 // CLASS HEADER
-#include "texture-manager.h"
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 
 // EXTERNAL HEADERS
+#include <cstdlib>
+#include <string>
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
 #include <dali/devel-api/common/hash.h>
 #include <dali/devel-api/images/texture-set-image.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL HEADERS
-#include <dali/integration-api/debug.h>
-#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
 #include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
-#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
 #include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
 
+namespace
+{
+
+constexpr auto DEFAULT_NUMBER_OF_LOCAL_LOADER_THREADS = size_t{4u};
+constexpr auto DEFAULT_NUMBER_OF_REMOTE_LOADER_THREADS = size_t{8u};
+
+constexpr auto NUMBER_OF_LOCAL_LOADER_THREADS_ENV = "DALI_TEXTURE_LOCAL_THREADS";
+constexpr auto NUMBER_OF_REMOTE_LOADER_THREADS_ENV = "DALI_TEXTURE_REMOTE_THREADS";
+
+size_t GetNumberOfThreads(const char* environmentVariable, size_t defaultValue)
+{
+  using Dali::EnvironmentVariable::GetEnvironmentVariable;
+  auto numberString = GetEnvironmentVariable(environmentVariable);
+  auto numberOfThreads = numberString ? std::strtol(numberString, nullptr, 10) : 0;
+  return (numberOfThreads > 0) ? numberOfThreads : defaultValue;
+}
+
+size_t GetNumberOfLocalLoaderThreads()
+{
+  return GetNumberOfThreads(NUMBER_OF_LOCAL_LOADER_THREADS_ENV, DEFAULT_NUMBER_OF_LOCAL_LOADER_THREADS);
+}
+
+size_t GetNumberOfRemoteLoaderThreads()
+{
+  return GetNumberOfThreads(NUMBER_OF_REMOTE_LOADER_THREADS_ENV, DEFAULT_NUMBER_OF_REMOTE_LOADER_THREADS);
+}
+
+} // namespace
 
 namespace Dali
 {
@@ -58,12 +86,10 @@ const int           INVALID_CACHE_INDEX( -1 ); ///< Invalid Cache index
 
 
 TextureManager::TextureManager()
-: mAsyncLocalLoader( Toolkit::AsyncImageLoader::New() ),
-  mAsyncRemoteLoader( Toolkit::AsyncImageLoader::New() ),
+: mAsyncLocalLoaders( GetNumberOfLocalLoaderThreads(), [&]() { return AsyncLoadingHelper(*this); } ),
+  mAsyncRemoteLoaders( GetNumberOfRemoteLoaderThreads(), [&]() { return AsyncLoadingHelper(*this); } ),
   mCurrentTextureId( 0 )
 {
-  DevelAsyncImageLoader::PixelBufferLoadedSignal(mAsyncLocalLoader).Connect( this, &TextureManager::AsyncLocalLoadComplete );
-  DevelAsyncImageLoader::PixelBufferLoadedSignal(mAsyncRemoteLoader).Connect( this, &TextureManager::AsyncRemoteLoadComplete );
 }
 
 TextureManager::TextureId TextureManager::RequestLoad(
@@ -284,6 +310,43 @@ TextureSet TextureManager::GetTextureSet( TextureId textureId )
   return textureSet;
 }
 
+std::string TextureManager::AddExternalTexture( TextureSet& textureSet )
+{
+  TextureManager::ExternalTextureInfo info;
+  info.textureId = GenerateUniqueTextureId();
+  info.textureSet = textureSet;
+  mExternalTextures.emplace_back( info );
+  return VisualUrl::CreateTextureUrl( std::to_string( info.textureId ) );
+}
+
+TextureSet TextureManager::RemoveExternalTexture( const std::string& url )
+{
+  if( url.size() > 0u )
+  {
+    // get the location from the Url
+    VisualUrl parseUrl( url );
+    if( VisualUrl::TEXTURE == parseUrl.GetProtocolType() )
+    {
+      std::string location = parseUrl.GetLocation();
+      if( location.size() > 0u )
+      {
+        TextureId id = std::stoi( location );
+        const auto end = mExternalTextures.end();
+        for( auto iter = mExternalTextures.begin(); iter != end; ++iter )
+        {
+          if( iter->textureId == id )
+          {
+            auto textureSet = iter->textureSet;
+            mExternalTextures.erase( iter );
+            return textureSet;
+          }
+        }
+      }
+    }
+  }
+  return TextureSet();
+}
+
 bool TextureManager::LoadTexture( TextureInfo& textureInfo )
 {
   bool success = true;
@@ -294,22 +357,12 @@ bool TextureManager::LoadTexture( TextureInfo& textureInfo )
 
     if( !textureInfo.loadSynchronously )
     {
-      if( textureInfo.url.IsLocal() )
-      {
-        mAsyncLocalLoadingInfoContainer.push_back( AsyncLoadingInfo( textureInfo.textureId ) );
-        mAsyncLocalLoadingInfoContainer.back().loadId =
-          GetImplementation(mAsyncLocalLoader).Load( textureInfo.url, textureInfo.desiredSize,
-                                                     textureInfo.fittingMode,
-                                                     textureInfo.samplingMode, true );
-      }
-      else
-      {
-        mAsyncRemoteLoadingInfoContainer.push_back( AsyncLoadingInfo( textureInfo.textureId ) );
-        mAsyncRemoteLoadingInfoContainer.back().loadId =
-          GetImplementation(mAsyncRemoteLoader).Load( textureInfo.url, textureInfo.desiredSize,
-                                                      textureInfo.fittingMode,
-                                                      textureInfo.samplingMode, true );
-      }
+      auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
+      auto loadingHelperIt = loadersContainer.GetNext();
+      DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End());
+      loadingHelperIt->Load(textureInfo.textureId, textureInfo.url,
+                            textureInfo.desiredSize, textureInfo.fittingMode,
+                            textureInfo.samplingMode, true);
     }
   }
 
@@ -326,16 +379,6 @@ void TextureManager::ObserveTexture( TextureInfo& textureInfo,
   }
 }
 
-void TextureManager::AsyncLocalLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer )
-{
-  AsyncLoadComplete( mAsyncLocalLoadingInfoContainer, id, pixelBuffer );
-}
-
-void TextureManager::AsyncRemoteLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer )
-{
-  AsyncLoadComplete( mAsyncRemoteLoadingInfoContainer, id, pixelBuffer );
-}
-
 void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id, Devel::PixelBuffer pixelBuffer )
 {
   DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::AsyncLoadComplete( id:%d )\n", id );
@@ -674,13 +717,48 @@ void TextureManager::ObserverDestroyed( TextureUploadObserver* observer )
 
 TextureManager::~TextureManager()
 {
-  mTextureInfoContainer.clear();
-  mAsyncLocalLoadingInfoContainer.clear();
-  mAsyncRemoteLoadingInfoContainer.clear();
 }
 
+TextureManager::AsyncLoadingHelper::AsyncLoadingHelper(TextureManager& textureManager)
+: AsyncLoadingHelper(Toolkit::AsyncImageLoader::New(), textureManager,
+                     AsyncLoadingInfoContainerType())
+{
+}
 
+void TextureManager::AsyncLoadingHelper::Load(TextureId          textureId,
+                                              const VisualUrl&   url,
+                                              ImageDimensions    desiredSize,
+                                              FittingMode::Type  fittingMode,
+                                              SamplingMode::Type samplingMode,
+                                              bool               orientationCorrection)
+{
+  mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
+  auto id = mLoader.Load(url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection);
+  mLoadingInfoContainer.back().loadId = id;
+}
 
+TextureManager::AsyncLoadingHelper::AsyncLoadingHelper(AsyncLoadingHelper&& rhs)
+: AsyncLoadingHelper(rhs.mLoader, rhs.mTextureManager, std::move(rhs.mLoadingInfoContainer))
+{
+}
+
+TextureManager::AsyncLoadingHelper::AsyncLoadingHelper(
+    Toolkit::AsyncImageLoader loader,
+    TextureManager& textureManager,
+    AsyncLoadingInfoContainerType&& loadingInfoContainer)
+: mLoader(loader),
+  mTextureManager(textureManager),
+  mLoadingInfoContainer(std::move(loadingInfoContainer))
+{
+  DevelAsyncImageLoader::PixelBufferLoadedSignal(mLoader).Connect(
+      this, &AsyncLoadingHelper::AsyncLoadComplete);
+}
+
+void TextureManager::AsyncLoadingHelper::AsyncLoadComplete(uint32_t           id,
+                                                           Devel::PixelBuffer pixelBuffer)
+{
+  mTextureManager.AsyncLoadComplete(mLoadingInfoContainer, id, pixelBuffer);
+}
 
 } // namespace Internal
 
@@ -1,5 +1,5 @@
-#ifndef DALI_TOOLKIT_TEXTURE_MANAGER_H
-#define DALI_TOOLKIT_TEXTURE_MANAGER_H
+#ifndef DALI_TOOLKIT_TEXTURE_MANAGER_IMPL_H
+#define DALI_TOOLKIT_TEXTURE_MANAGER_IMPL_H
 
 /*
  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  */
 
 // EXTERNAL INCLUDES
+#include <deque>
+#include <functional>
 #include <string>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/rendering/texture-set.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
-#include <deque>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
 #include <dali-toolkit/devel-api/image-loader/image-atlas.h>
 #include <dali-toolkit/public-api/image-loader/async-image-loader.h>
 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
 #include <dali-toolkit/internal/visuals/visual-url.h>
+#include <dali-toolkit/internal/helpers/round-robin-container-view.h>
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
 
 
 namespace Dali
@@ -42,8 +46,6 @@ namespace Toolkit
 namespace Internal
 {
 
-class MaskTextureObserver;
-
 /**
  * The TextureManager provides a common Image loading API for Visuals.
  *
@@ -208,6 +210,20 @@ public:
    */
   TextureSet GetTextureSet( TextureId textureId );
 
+  /**
+   * Adds an external texture to the texture manager
+   * @param[in] texture The texture to add
+   * @return string containing the URL for the texture
+   */
+  std::string AddExternalTexture( TextureSet& texture );
+
+  /**
+   * Removes an external texture from texture manager
+   * @param[in] url The string containing the texture to remove
+   * @return handle to the texture
+   */
+  TextureSet RemoveExternalTexture( const std::string& url );
+
 private:
 
   /**
@@ -485,18 +501,81 @@ private:
     const bool useAtlas,
     TextureId maskTextureId );
 
+private:
+
+  /**
+   * @brief Helper class to keep the relation between AsyncImageLoader and corresponding LoadingInfo container
+   */
+  class AsyncLoadingHelper : public ConnectionTracker
+  {
+  public:
+    /**
+     * @brief Create an AsyncLoadingHelper.
+     * @param[in] textureManager Reference to the texture manager
+     */
+    AsyncLoadingHelper(TextureManager& textureManager);
+
+    /**
+     * @brief Load a new texture.
+     * @param[in] textureId             TextureId to reference the texture that will be loaded
+     * @param[in] url                   The URL of the image to load
+     * @param[in] desiredSize           The size the image is likely to appear at. This can be set to 0,0 for automatic
+     * @param[in] fittingMode           The FittingMode to use
+     * @param[in] samplingMode          The SamplingMode to use
+     * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image, e.g., from portrait to landscape
+     */
+    void Load(TextureId textureId,
+              const VisualUrl& url,
+              ImageDimensions desiredSize,
+              FittingMode::Type fittingMode,
+              SamplingMode::Type samplingMode,
+              bool orientationCorrection);
+
+  public:
+    AsyncLoadingHelper(const AsyncLoadingHelper&) = delete;
+    AsyncLoadingHelper& operator=(const AsyncLoadingHelper&) = delete;
+
+    AsyncLoadingHelper(AsyncLoadingHelper&& rhs);
+    AsyncLoadingHelper& operator=(AsyncLoadingHelper&&rhs) = delete;
+
+  private:
+    /**
+     * @brief Main constructor that used by all other constructors
+     */
+    AsyncLoadingHelper(Toolkit::AsyncImageLoader loader,
+                       TextureManager& textureManager,
+                       AsyncLoadingInfoContainerType&& loadingInfoContainer);
+
+    /**
+     * @brief Callback to be called when texture loading is complete, it passes the pixel buffer on to texture manager.
+     * @param[in] id          Loader id
+     * @param[in] pixelBuffer Image data
+     */
+    void AsyncLoadComplete(uint32_t id, Devel::PixelBuffer pixelBuffer);
+
+  private:
+    Toolkit::AsyncImageLoader     mLoader;
+    TextureManager&               mTextureManager;
+    AsyncLoadingInfoContainerType mLoadingInfoContainer;
+  };
+
+  struct ExternalTextureInfo
+  {
+    TextureId textureId;
+    TextureSet textureSet;
+  };
 
 private:
 
   /**
-   * Undefined copy constructor.
+   * Deleted copy constructor.
    */
-  TextureManager( const TextureManager& );
+  TextureManager( const TextureManager& ) = delete;
 
   /**
-   * Undefined assignment operator.
+   * Deleted assignment operator.
    */
-  TextureManager& operator=( const TextureManager& rhs );
+  TextureManager& operator=( const TextureManager& rhs ) = delete;
 
   /**
    * This is called by the TextureManagerUploadObserver when an observer is destroyed.
@@ -507,13 +586,12 @@ private:
 
 private:  // Member Variables:
 
-  AsyncLoadingInfoContainerType         mAsyncLocalLoadingInfoContainer;     ///< Used to manage Asynchronous loads in progress
-  AsyncLoadingInfoContainerType         mAsyncRemoteLoadingInfoContainer;     ///< Used to manage Asynchronous loads in progress
-  AtlasInfoContainerType                mAtlasContainer;                ///< Used to manage Atlas creation and destruction
-  TextureInfoContainerType              mTextureInfoContainer;          ///< Used to manage the life-cycle and caching of Textures
-  Toolkit::AsyncImageLoader             mAsyncLocalLoader;              ///< The Asynchronous image loader used to provide all local async loads
-  Toolkit::AsyncImageLoader             mAsyncRemoteLoader;             ///< The Asynchronous image loader used to provide all remote async loads
-  TextureId                             mCurrentTextureId;              ///< The current value used for the unique Texture Id generation
+  AtlasInfoContainerType                        mAtlasContainer;       ///< Used to manage Atlas creation and destruction
+  TextureInfoContainerType                      mTextureInfoContainer; ///< Used to manage the life-cycle and caching of Textures
+  RoundRobinContainerView< AsyncLoadingHelper > mAsyncLocalLoaders;    ///< The Asynchronous image loaders used to provide all local async loads
+  RoundRobinContainerView< AsyncLoadingHelper > mAsyncRemoteLoaders;   ///< The Asynchronous image loaders used to provide all remote async loads
+  std::vector< ExternalTextureInfo >            mExternalTextures;     ///< Externally provided textures
+  TextureId                                     mCurrentTextureId;     ///< The current value used for the unique Texture Id generation
 
 };
 
@@ -524,4 +602,4 @@ private:  // Member Variables:
 
 } // namespace Dali
 
-#endif // DALI_TOOLKIT_TEXTURE_MANAGER_H
+#endif // DALI_TOOLKIT_TEXTURE_MANAGER_IMPL_H
index cc68e0f..aac15c7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VISUAL_FACTORY_CACHE_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/npatch-loader.h>
 #include <dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h>
-#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 
 namespace Dali
 {
@@ -69,7 +69,8 @@ public:
     IMAGE_SHADER_ATLAS_CUSTOM_WRAP,
     NINE_PATCH_SHADER,
     SVG_SHADER,
-    TEXT_SHADER,
+    TEXT_SHADER_RGBA,
+    TEXT_SHADER_L8,
     WIREFRAME_SHADER,
     SHADER_TYPE_MAX = WIREFRAME_SHADER
   };
index 469ead5..3aef5bc 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.
@@ -316,6 +316,15 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const std::string& url, Image
   return Toolkit::Visual::Base( visualPtr.Get() );
 }
 
+Internal::TextureManager& VisualFactory::GetTextureManager()
+{
+  if( !mFactoryCache )
+  {
+    mFactoryCache = new VisualFactoryCache();
+  }
+  return mFactoryCache->GetTextureManager();
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 030512e..257b03c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,6 +66,11 @@ public:
    */
   Toolkit::Visual::Base CreateVisual( const std::string& image, ImageDimensions size );
 
+  /**
+   * @return the reference to texture manager
+   */
+  Internal::TextureManager& GetTextureManager();
+
 protected:
 
   /**
index c3c675d..907b428 100644 (file)
@@ -30,54 +30,59 @@ namespace Internal
 namespace
 {
 
-VisualUrl::Location ResolveLocation( const std::string& url)
+VisualUrl::ProtocolType ResolveLocation( const std::string& url )
 {
-  const char FTP[] = { 'f', 't', 'p', ':', '/', '/' };
-  const char SSH[] = { 's', 's', 'h', ':', '/', '/' };
-  const char HTTP[] = { 'h', 't', 't', 'p', ':', '/', '/' };
-  const char HTTPS[] = { 'h', 't', 't', 'p', 's', ':', '/', '/' };
-
-  const int MATCH_FTP = 0x01;
-  const int MATCH_SSH = 0x02;
-  const int MATCH_HTTP = 0x04;
-  const int MATCH_HTTPS = 0x08;
-
   const char* urlCStr = url.c_str();
-  if( url.size() > 6 )
+  const uint32_t length = url.size();
+  if( ( length > 7 ) && urlCStr[5] == ':' && urlCStr[6] == '/' && urlCStr[7] == '/' )
+  {
+    // https://
+    if( ( 'h' == tolower( urlCStr[0] ) )&&
+        ( 't' == tolower( urlCStr[1] ) )&&
+        ( 't' == tolower( urlCStr[2] ) )&&
+        ( 'p' == tolower( urlCStr[3] ) )&&
+        ( 's' == tolower( urlCStr[4] ) ) )
+    {
+      return VisualUrl::REMOTE;
+    }
+  }
+  else if( ( length > 6 ) && urlCStr[4] == ':' && urlCStr[5] == '/' && urlCStr[6] == '/' )
+  {
+    // http:// or dali://
+    const char hOrd = tolower( urlCStr[0] );
+    const char tOra = tolower( urlCStr[1] );
+    const char tOrl = tolower( urlCStr[2] );
+    const char pOri = tolower( urlCStr[3] );
+    if( ( 'h' == hOrd )&&
+        ( 't' == tOra )&&
+        ( 't' == tOrl )&&
+        ( 'p' == pOri ) )
+    {
+      return VisualUrl::REMOTE;
+    }
+    if( ( 'd' == hOrd )&&
+        ( 'a' == tOra )&&
+        ( 'l' == tOrl )&&
+        ( 'i' == pOri ) )
+    {
+      return VisualUrl::TEXTURE;
+    }
+  }
+  else if( ( length > 5 ) && urlCStr[3] == ':' && urlCStr[4] == '/' && urlCStr[5] == '/' )
   {
-    if( urlCStr[3] == ':' || urlCStr[4] == ':' || urlCStr[5] == ':' )
+    // ftp:// or ssh://
+    const char fOrS = tolower( urlCStr[0] );
+    if( ( 'f' == fOrS )||( 's' == fOrS ) )
     {
-      int flags = 0x0F;
-      for( unsigned int i=0; i < sizeof(HTTPS); ++i )
+      const char tOrs = tolower( urlCStr[1] );
+      if( ( 't' == tOrs )||( 's' == tOrs ) )
       {
-        char c = tolower( urlCStr[i] );
-        if( i < sizeof(FTP) && (flags & MATCH_FTP) && c != FTP[i] )
-        {
-          flags &= ~MATCH_FTP;
-        }
-        if( i < sizeof(SSH) && (flags & MATCH_SSH) && c != SSH[i] )
-        {
-          flags &= ~MATCH_SSH;
-        }
-        if( i < sizeof(HTTP) && (flags & MATCH_HTTP) && c != HTTP[i] )
-        {
-          flags &= ~MATCH_HTTP;
-        }
-        if( i < sizeof(HTTPS) && (flags & MATCH_HTTPS) && c != HTTPS[i] )
+        const char pOrh = tolower( urlCStr[2] );
+        if( ( 'p' == pOrh )||( 'h' == pOrh ) )
         {
-          flags &= ~MATCH_HTTPS;
-        }
-
-        if( (flags & (MATCH_FTP | MATCH_SSH | MATCH_HTTP | MATCH_HTTPS )) == 0 )
-        {
-          break;
+          return VisualUrl::REMOTE;
         }
       }
-
-      if( flags )
-      {
-        return VisualUrl::REMOTE;
-      }
     }
   }
   return VisualUrl::LOCAL;
@@ -99,9 +104,9 @@ VisualUrl::Type ResolveType( const std::string& url )
     int index = count;
     while( --index >= 0 )
     {
-      const char currentChar = url[ index ];
+      const char currentChar = tolower( url[ index ] );
       const std::size_t offsetFromEnd = count - index - 1u;
-      if( ( offsetFromEnd < sizeof(SVG) )&&( tolower( currentChar ) == SVG[ offsetFromEnd ] ) )
+      if( ( offsetFromEnd < sizeof(SVG) )&&( currentChar == SVG[ offsetFromEnd ] ) )
       {
         // early out if SVG as can't be used in N patch for now
         if( ++svgScore == sizeof(SVG) )
@@ -109,9 +114,9 @@ VisualUrl::Type ResolveType( const std::string& url )
           return VisualUrl::SVG;
         }
       }
-      if( ( offsetFromEnd < sizeof(GIF) )&&( tolower( currentChar ) == GIF[ offsetFromEnd ] ) )
+      if( ( offsetFromEnd < sizeof(GIF) )&&( currentChar == GIF[ offsetFromEnd ] ) )
       {
-        // early out if GIF
+        // early out if GIF as can't be used in N patch for now
         if( ++gifScore == sizeof(GIF) )
         {
           return VisualUrl::GIF;
@@ -178,7 +183,11 @@ VisualUrl::VisualUrl( const std::string& url )
   if( ! url.empty() )
   {
     mLocation = ResolveLocation( url );
-    mType = ResolveType( url );
+    if( VisualUrl::TEXTURE != mLocation )
+    {
+      // TEXTURE location url doesn't need type resolving, REGULAR_IMAGE is fine
+      mType = ResolveType( url );
+    }
   }
 }
 
@@ -210,7 +219,7 @@ VisualUrl::Type VisualUrl::GetType() const
   return mType;
 }
 
-VisualUrl::Location VisualUrl::GetLocation() const
+VisualUrl::ProtocolType VisualUrl::GetProtocolType() const
 {
   return mLocation;
 }
@@ -220,13 +229,28 @@ bool VisualUrl::IsValid() const
   return mUrl.size() > 0u;
 }
 
-bool VisualUrl::IsLocal() const
+bool VisualUrl::IsLocalResource() const
 {
   return mLocation == VisualUrl::LOCAL;
 }
 
+std::string VisualUrl::GetLocation()
+{
+  const auto location = mUrl.find( "://" );
+  if( std::string::npos != location )
+  {
+    return mUrl.substr( location + 3u ); // 3 characters forwards from the start of ://
+  }
+  return mUrl;
+}
 
+std::string VisualUrl::CreateTextureUrl( const std::string& location )
+{
+  return "dali://" + location;
+}
 
 } // Internal
+
 } // Toolkit
+
 } // Dali
index d9ed48a..b261813 100644 (file)
@@ -43,10 +43,11 @@ public:
     GIF
   };
 
-  enum Location
+  enum ProtocolType
   {
-    LOCAL,
-    REMOTE
+    LOCAL,   ///< file in local file system
+    TEXTURE, ///< texture uploaded to texture manager
+    REMOTE   ///< remote image
   };
 
   /**
@@ -90,7 +91,7 @@ public:
    * Is the URL is local to the device, or remote?
    * @return the location of the resource
    */
-  Location GetLocation() const;
+  ProtocolType GetProtocolType() const;
 
   /**
    * Is the URL valid?
@@ -99,14 +100,26 @@ public:
   bool IsValid() const;
 
   /**
-   * @return true if the location is LOCAL
+   * @return true if the location is LOCAL, i.e. is loadable from local file system
    */
-  bool IsLocal() const;
+  bool IsLocalResource() const;
+
+  /**
+   * @return the location part of the url
+   */
+  std::string GetLocation();
+
+  /**
+   * Helper to create a URL of type TEXTURE
+   * @param location the location of the texture
+   * @return the Url
+   */
+  static std::string CreateTextureUrl( const std::string& location );
 
 private:
   std::string mUrl;
   Type mType;
-  Location mLocation;
+  ProtocolType mLocation;
 };
 
 
index aa4f80f..cc78eff 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 = 54;
+const unsigned int TOOLKIT_MICRO_VERSION = 57;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 44d5692..8eff9fa 100644 (file)
@@ -56,6 +56,9 @@ enum
    * @brief The URL of the image.
    * @details Name "url", type Property::STRING or Property::ARRAY of Property::STRING
    * @note The array form is used for generating animated image visuals.
+   * @note The number of threads used for local and remote image loading can be controlled by the
+   *       environment variables DALI_TEXTURE_LOCAL_THREADS and DALI_TEXTURE_REMOTE_THREADS respectively.
+   *       The default values are 4 threads for local image loading and 8 threads for remote image loading.
    * @SINCE_1_1.45
    * @note Mandatory.
    */
index dd06d35..50f9529 100644 (file)
@@ -28,7 +28,8 @@
 {
   "config":
   {
-    "alwaysShowFocus":false
+    "alwaysShowFocus":true,
+    "clearFocusOnEscape":false
   },
   "styles":
   {
@@ -38,7 +39,7 @@
       {
         "content":
         {
-          "pointSize":84
+          "pointSize":42
         },
         "waitTime":0.5,
         "background":
@@ -60,7 +61,7 @@
     },
     "TextLabel":
     {
-      "pointSize":108,
+      "pointSize":54,
       "enableAutoScroll":false,
       "autoScrollLoopCount":2,
       "autoScrollGap":50,
 
     "TextLabelFontSize0":
     {
-      "pointSize":84
+      "pointSize":42
     },
     "TextLabelFontSize1":
     {
-      "pointSize":96
+      "pointSize":48
     },
     "TextLabelFontSize2":
     {
-      "pointSize":108
+      "pointSize":54
     },
     "TextLabelFontSize3":
     {
-      "pointSize":120
+      "pointSize":60
     },
     "TextLabelFontSize4":
     {
-      "pointSize":132
+      "pointSize":66
     },
 
     "TextField":
     {
-      "pointSize":120,
+      "pointSize":60,
       "primaryCursorColor":[0.0,0.72,0.9,1.0],
       "secondaryCursorColor":[0.0,0.72,0.9,1.0],
       "cursorWidth":6,
 
     "TextFieldFontSize0":
     {
-      "pointSize":120
+      "pointSize":60
     },
     "TextFieldFontSize1":
     {
-      "pointSize":120
+      "pointSize":60
     },
     "TextFieldFontSize2":
     {
-      "pointSize":120
+      "pointSize":60
     },
     "TextFieldFontSize3":
     {
-      "pointSize":120
+      "pointSize":60
     },
     "TextFieldFontSize4":
     {
-      "pointSize":120
+      "pointSize":60
     },
     "TextSelectionPopup":
     {
       "label":
       {
         "visualType":"TEXT",
-        "pointSize":120
+        "pointSize":60
       },
       "unselectedBackgroundVisual":
       {
     },
     "TextEditor":
     {
-      "pointSize":120,
+      "pointSize":60,
       "primaryCursorColor":[0.0,0.72,0.9,1.0],
       "secondaryCursorColor":[0.0,0.72,0.9,1.0],
       "cursorWidth":6,
index 8612b3c..460d0f8 100644 (file)
@@ -28,7 +28,8 @@
 {
   "config":
   {
-    "alwaysShowFocus":false
+    "alwaysShowFocus":false,
+    "clearFocusOnEscape":true
   },
   "styles":
   {
index 0c48655..9390546 100644 (file)
@@ -28,7 +28,8 @@
 {
   "config":
   {
-    "alwaysShowFocus":false
+    "alwaysShowFocus":false,
+    "clearFocusOnEscape":true
   },
   "styles":
   {
index 10159cf..b46e4ff 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
-Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.54
+Summary:    Dali 3D engine Toolkit
+Version:    1.2.56
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -10,15 +10,25 @@ Source0:    %{name}-%{version}.tar.gz
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
+%if 0%{?tizen_version_major} < 4
+%define disable_cxx03_build 1
+%endif
+
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(dali-core)
+%if !0%{?disable_cxx03_build}
+BuildRequires:  pkgconfig(dali-core-cxx03)
+%endif
 BuildRequires: gettext
 
 # dali-toolkit only need to know the interfaces(APIs) of dali-adaptor(the devel package).
 # It doesn't need to know which adaptor will be used by applications.
 # Applications or dali-addon will decide which one they will use.
 BuildRequires:  dali-adaptor-devel
+%if !0%{?disable_cxx03_build}
+BuildRequires:  dali-adaptor-devel-cxx03
+%endif
 
 #need libtzplatform-config for directory if tizen version is 3.x
 
@@ -35,7 +45,7 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 %endif
 
 %description
-The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
+Dali 3D engine Toolkit - a set of controls that provide
 user interface functionality.
 
 ##############################
@@ -68,16 +78,25 @@ Conflicts:  %{name}-resources_720x1280
 dali-toolkit default resource files for 1920x1080
 Contain po / sounds / common images / style / style images
 
+%if !0%{?disable_cxx03_build}
+%package cxx03
+Summary:       Dali 3D engine Toolkit with cxx03
+Provides:      %{name}-cxx03 = %{version}-%{release}
+
+%description cxx03
+Dali 3D engine Toolkit with cxx03
+%endif
+
 ##############################
 # devel
 ##############################
 %package devel
-Summary:    Application development package for the OpenGLES Canvas toolkit
+Summary:    Application development package for Dali 3D engine toolkit
 Group:      Development/Building
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
-Application development package for the OpenGLES Canvas toolkit - headers and package config
+Application development package for Dali 3D engine toolkit - headers and package config
 
 ##############################
 # Preparation
@@ -133,18 +152,52 @@ DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
 %if 0%{?enable_debug}
            --enable-debug \
 %endif
-           --enable-i18n=yes
+           --enable-i18n=yes \
+           --enable-rename-so=no
+
+make %{?jobs:-j%jobs}
+
+pushd %{_builddir}/%{name}-%{version}/build/tizen
+%make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
+popd
+
+pushd %{buildroot}%{_libdir}
+for FILE in libdali-toolkit-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+mv pkgconfig/dali-toolkit.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-toolkit.pc
+popd
+
+%if !0%{?disable_cxx03_build}
+make clean
+
+libtoolize --force
+cd %{_builddir}/dali-toolkit-%{version}/build/tizen
+autoreconf --install
+
+DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
+DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
+
+%configure --enable-profile=TIZEN \
+           --enable-cxx03-abi=yes \
+%if 0%{?enable_debug}
+           --enable-debug \
+%endif
+           --enable-i18n=yes \
+           --enable-rename-so=no
 
 make %{?jobs:-j%jobs}
+%endif
 
 ##############################
 # Installation
 ##############################
 %install
 rm -rf %{buildroot}
-pushd build/tizen
+pushd %{_builddir}/%{name}-%{version}/build/tizen
 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
 
+for FILE in libdali-toolkit-cxx11.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
+mv dali-toolkit.pc %{buildroot}%{_libdir}/pkgconfig/dali-toolkit.pc
+
 # PO
 {
 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
@@ -157,6 +210,18 @@ done
 } &> /dev/null
 popd
 
+#############################
+#rename
+#############################
+pushd  %{buildroot}%{_libdir}
+rm -rf libdali-toolkit.so
+rm -rf libdali-toolkit-cxx11.so
+%if !0%{?disable_cxx03_build}
+ln -s libdali-toolkit.so.0.0.* libdali-toolkit-cxx03.so
+%endif
+ln -s libdali-toolkit-cxx11.so.0.0.* libdali-toolkit.so
+popd
+
 # Remove default style and style images which are for Linux build
 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
 
@@ -232,19 +297,19 @@ popd
 %preun resources_480x800
 pushd %{dali_toolkit_style_files}
 mv images ./480x800
-mv *.json ./480x800
+mv dali-toolkit-default-theme.json ./480x800
 popd
 
 %preun resources_720x1280
 pushd %{dali_toolkit_style_files}
 mv images ./720x1280
-mv *.json ./720x1280
+mv dali-toolkit-default-theme.json ./720x1280
 popd
 
 %preun resources_1920x1080
 pushd %{dali_toolkit_style_files}
 mv images ./1920x1080
-mv *.json ./1920x1080
+mv dali-toolkit-default-theme.json ./1920x1080
 popd
 
 ##############################
@@ -255,19 +320,31 @@ popd
 exit 0
 
 %postun resources_480x800
-pushd %{dali_toolkit_style_files}
-rm -rf *
-popd
+case "$1" in
+  0)
+    pushd %{dali_toolkit_style_files}
+    rm -rf *
+    popd
+  ;;
+esac
 
 %postun resources_720x1280
-pushd %{dali_toolkit_style_files}
-rm -rf *
-popd
+case "$1" in
+  0)
+    pushd %{dali_toolkit_style_files}
+    rm -rf *
+    popd
+  ;;
+esac
 
 %postun resources_1920x1080
-pushd %{dali_toolkit_style_files}
-rm -rf *
-popd
+case "$1" in
+  0)
+    pushd %{dali_toolkit_style_files}
+    rm -rf *
+    popd
+  ;;
+esac
 
 ##############################
 # Files in Binary Packages
@@ -279,13 +356,27 @@ popd
 %manifest dali-toolkit.manifest
 %endif
 %defattr(-,root,root,-)
-%{_libdir}/lib%{name}.so*
+%{_libdir}/libdali-toolkit-cxx11.so.*
+%{_libdir}/libdali-toolkit.so
+%license LICENSE
+
+%if !0%{?disable_cxx03_build}
+%files cxx03
+%if 0%{?enable_dali_smack_rules}
+%manifest dali-toolkit.manifest-smack
+%else
+%manifest dali-toolkit.manifest
+%endif
+%defattr(-,root,root,-)
+%{_libdir}/libdali-toolkit.so.*
+%{_libdir}/libdali-toolkit-cxx03.so
 %license LICENSE
+%endif
 
 %files devel
 %defattr(-,root,root,-)
-%{dev_include_path}/%{name}/*
-%{_libdir}/pkgconfig/*.pc
+%{dev_include_path}/dali-toolkit/*
+%{_libdir}/pkgconfig/dali-toolkit.pc
 
 %files resources_480x800
 %manifest dali-toolkit-resources.manifest