Merge branch 'devel/master' into tizen 75/72275/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Tue, 31 May 2016 08:58:44 +0000 (17:58 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Tue, 31 May 2016 08:59:08 +0000 (17:59 +0900)
Change-Id: Ie43a9ae8376489e2dc67bff9ab1c416c14602afb

112 files changed:
README
automated-tests/resources/test-image-600.jpg [new file with mode: 0644]
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-button.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/dali-toolkit.h
dali-toolkit/devel-api/file.list
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-actor.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.h
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.h
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/popup/confirmation-popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/renderers/color/color-renderer.cpp
dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h
dali-toolkit/internal/controls/renderers/control-renderer-impl.cpp
dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
dali-toolkit/internal/controls/renderers/image/image-renderer.cpp
dali-toolkit/internal/controls/renderers/image/image-renderer.h
dali-toolkit/internal/controls/renderers/renderer-factory-cache.cpp
dali-toolkit/internal/controls/renderers/renderer-factory-cache.h
dali-toolkit/internal/controls/renderers/renderer-factory-impl.cpp
dali-toolkit/internal/controls/renderers/svg/nanosvg/nanosvg.cc
dali-toolkit/internal/controls/renderers/svg/nanosvg/nanosvg.h
dali-toolkit/internal/controls/renderers/svg/nanosvg/nanosvgrast.cc
dali-toolkit/internal/controls/renderers/svg/svg-renderer.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/feedback/feedback-style.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-scroller-interface.cpp [new file with mode: 0644]
dali-toolkit/internal/text/text-scroller-interface.h [new file with mode: 0644]
dali-toolkit/internal/text/text-scroller.cpp [new file with mode: 0644]
dali-toolkit/internal/text/text-scroller.h [new file with mode: 0644]
dali-toolkit/internal/text/text-view-interface.h
dali-toolkit/internal/text/visual-model-impl.h
dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/flex-container/flex-container.cpp [moved from dali-toolkit/devel-api/controls/flex-container/flex-container.cpp with 95% similarity]
dali-toolkit/public-api/controls/flex-container/flex-container.h [moved from dali-toolkit/devel-api/controls/flex-container/flex-container.h with 68% similarity]
dali-toolkit/public-api/controls/image-view/image-view.h
dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h
dali-toolkit/public-api/controls/table-view/table-view.h
dali-toolkit/public-api/controls/text-controls/text-label.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/file.list
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
docs/content/images/text-controls/AutoScroll.gif [new file with mode: 0644]
docs/content/main.md
docs/content/programming-guide/properties.h
docs/content/shared-javascript-and-cpp-documentation/flex-container.md
docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/text-label.md
node-addon/examples/flex-container.js
packaging/dali-toolkit.spec
plugins/dali-script-v8/src/module-loader/module-loader.cpp
plugins/dali-script-v8/src/object/handle-wrapper.cpp
plugins/dali-script-v8/src/object/property-value-wrapper.cpp
plugins/dali-script-v8/src/object/property-value-wrapper.h
plugins/dali-script-v8/src/utils/v8-utils.cpp
plugins/dali-script-v8/src/utils/v8-utils.h

diff --git a/README b/README
index 2ecae9d..9b8ab0e 100644 (file)
--- a/README
+++ b/README
@@ -4,6 +4,8 @@ T.O.C.
  1.   GBS Builds
  1.1. NON-SMACK Targets
  1.2. SMACK enabled Targets
+ 1.3. DEBUG Builds
+ 1.4. MOBILE Profile
  2.   Building for Ubuntu desktop
  2.1. Minimum Requirements
  2.2. Building the Repository
@@ -23,10 +25,10 @@ T.O.C.
 
  gbs build -A [TARGET_ARCH] --define "%enable_dali_smack_rules 1"
 
-1.3. MOBILE Profile
--------------------
+1.3. DEBUG Builds
+-----------------
 
- gbs build -A [TARGET_ARCH] --spec dali-toolkit-mobile.spec
+ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
 
 2. Building for Ubuntu desktop
 ==============================
diff --git a/automated-tests/resources/test-image-600.jpg b/automated-tests/resources/test-image-600.jpg
new file mode 100644 (file)
index 0000000..c93db33
Binary files /dev/null and b/automated-tests/resources/test-image-600.jpg differ
index 4d63fee..8a6003f 100644 (file)
@@ -58,6 +58,7 @@ SET(TC_SOURCES
 LIST(APPEND TC_SOURCES
    dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
    dali-toolkit-test-utils/toolkit-application.cpp
+   dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
    dali-toolkit-test-utils/toolkit-clipboard.cpp
    dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
index 5b127c7..4cc72bd 100644 (file)
@@ -28,6 +28,7 @@ TextureSet CreateTextureSet()
 {
   return TextureSet::New();
 }
+
 TextureSet CreateTextureSet( Image image )
 {
   TextureSet textureSet = TextureSet::New();
@@ -45,32 +46,4 @@ PropertyBuffer CreatePropertyBuffer()
   return vertexData;
 }
 
-Geometry CreateQuadGeometry(void)
-{
-  PropertyBuffer vertexData = CreatePropertyBuffer();
-  return CreateQuadGeometryFromBuffer( vertexData );
-}
-
-Geometry CreateQuadGeometryFromBuffer( PropertyBuffer vertexData )
-{
-  const float halfQuadSize = .5f;
-  struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
-  TexturedQuadVertex texturedQuadVertexData[4] = {
-    { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
-    { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
-    { Vector2(-halfQuadSize,  halfQuadSize), Vector2(0.f, 1.f) },
-    { Vector2( halfQuadSize,  halfQuadSize), Vector2(1.f, 1.f) } };
-  vertexData.SetData(texturedQuadVertexData, 4);
-
-  unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
-
-  Geometry geometry = Geometry::New();
-  geometry.AddVertexBuffer( vertexData );
-  geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
-
-  return geometry;
-}
-
-
-
 } // namespace Dali
index bf5f6a6..391bcc4 100644 (file)
@@ -30,8 +30,6 @@ namespace Dali
 Shader CreateShader();
 TextureSet CreateTextureSet();
 TextureSet CreateTextureSet( Image image );
-Geometry CreateQuadGeometry();
-Geometry CreateQuadGeometryFromBuffer( PropertyBuffer vertexData );
 PropertyBuffer CreatePropertyBuffer();
 
 }
index 2f833c6..fb50bf5 100644 (file)
@@ -67,7 +67,7 @@ Actor CreateRenderableActor( Image texture )
 Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader )
 {
   // Create the geometry
-  Geometry geometry = CreateQuadGeometry();
+  Geometry geometry = Geometry::QUAD();
 
   // Create Shader
   Shader shader = Shader::New( vertexShader, fragmentShader );
index a83f3e3..3d25205 100644 (file)
@@ -17,7 +17,6 @@
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <test-button.h>
-#include <dali/devel-api/object/type-registry-helper.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index 00c1204..3acafbd 100644 (file)
  * limitations under the License.
  */
 
+// CLASS HEADER
+#include "toolkit-bitmap-loader.h"
+
+// EXTERNAL INCLUDES
 #include <dali/public-api/object/base-object.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <cstring>
+#include <semaphore.h>
 
 using namespace Dali;
 
 namespace Dali
 {
-class Adaptor;
+namespace
+{
+Dali::BitmapLoader gBitmapLoader;
+}
+
 
 namespace Internal
 {
@@ -49,6 +57,7 @@ public:
     mPixelData(),
     mUrl(url)
   {
+    sem_init( &mySemaphore, 0, 0 );
   }
 
   ~BitmapLoader(){}
@@ -60,6 +69,8 @@ public:
     memset(buffer, 0, bufferSize);
 
     mPixelData = PixelData::New( buffer, mSize.GetWidth(), mSize.GetHeight(), Pixel::RGBA8888, PixelData::FREE);
+
+    sem_post( &mySemaphore );
   }
 
   PixelDataPtr GetPixelData() const
@@ -77,9 +88,19 @@ public:
     return mPixelData ? true : false;
   }
 
+  void WaitForLoading()
+  {
+    if( mPixelData )
+    {
+      return;
+    }
+    sem_wait( &mySemaphore );
+  }
+
   ImageDimensions mSize;
   PixelDataPtr mPixelData;
   const std::string mUrl;
+  sem_t mySemaphore;
 };
 
 } // internal
@@ -101,7 +122,12 @@ inline const Internal::BitmapLoader& GetImplementation(const Dali::BitmapLoader&
 Dali::BitmapLoader Dali::BitmapLoader::New(std::string const&url, Dali::Uint16Pair size, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode, bool orientationCorrection)
 {
   IntrusivePtr<Internal::BitmapLoader> internal = Internal::BitmapLoader::New(url, size, fittingMode, samplingMode, orientationCorrection);
-  return BitmapLoader( internal.Get() );
+  gBitmapLoader = BitmapLoader(internal.Get());
+  return gBitmapLoader;
+}
+
+BitmapLoader::BitmapLoader()
+{
 }
 
 Dali::BitmapLoader::BitmapLoader(Dali::BitmapLoader const& handle)
@@ -115,6 +141,11 @@ Dali::BitmapLoader::BitmapLoader(Internal::BitmapLoader* internal)
 Dali::BitmapLoader::~BitmapLoader()
 {
 }
+BitmapLoader& BitmapLoader::operator=(const BitmapLoader& rhs)
+{
+  BaseHandle::operator=(rhs);
+  return *this;
+}
 void Dali::BitmapLoader::Load()
 {
   GetImplementation(*this).Load();
@@ -131,5 +162,19 @@ bool Dali::BitmapLoader::IsLoaded()
 {
   return GetImplementation(*this).IsLoaded();
 }
+void Dali::BitmapLoader::WaitForLoading()
+{
+  GetImplementation(*this).WaitForLoading();
+}
+
+BitmapLoader Dali::BitmapLoader::GetLatestCreated()
+{
+  return gBitmapLoader;
+}
+
+void Dali::BitmapLoader::ResetLatestCreated()
+{
+  gBitmapLoader.Reset();
+}
 
 } // Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.h
new file mode 100644 (file)
index 0000000..141903b
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __DALI_TOOLKIT_BITMAP_LOADER_H__
+#define __DALI_TOOLKIT_BITMAP_LOADER_H__
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define __DALI_BITMAP_LOADER_H__
+
+#include <string>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/images/pixel.h>
+#include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/object/base-handle.h>
+#include <dali/devel-api/images/pixel-data.h>
+
+namespace Dali
+{
+namespace Internal
+{
+class BitmapLoader;
+}
+
+class DALI_IMPORT_API BitmapLoader : public BaseHandle
+{
+public:
+
+  static BitmapLoader New( const std::string& url,
+                           ImageDimensions size = ImageDimensions( 0, 0 ),
+                           FittingMode::Type fittingMode = FittingMode::DEFAULT,
+                           SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
+                           bool orientationCorrection = true);
+  BitmapLoader();
+  ~BitmapLoader();
+  BitmapLoader(const BitmapLoader& handle);
+  BitmapLoader& operator=(const BitmapLoader& rhs);
+
+public:
+  void Load();
+  bool IsLoaded();
+  std::string GetUrl() const;
+  PixelDataPtr GetPixelData() const;
+
+  void WaitForLoading();
+  static BitmapLoader GetLatestCreated(); // return the latest created BitmapLoader
+  static void ResetLatestCreated();
+
+public: // Not intended for application developers
+
+  explicit DALI_INTERNAL BitmapLoader(Internal::BitmapLoader*);
+};
+
+} // Dali
+
+#endif /* __DALI_TOOLKIT_BITMAP_LOADER_H__ */
index 3d85457..a7e0b46 100644 (file)
  *
  */
 
+// HEADER
 #include "toolkit-style-monitor.h"
 
+// EXTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/signals/dali-signal.h>
 
index 3dae0c1..f2d3e9c 100644 (file)
@@ -21,7 +21,6 @@
 #include <dali-toolkit/devel-api/builder/builder.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/object/type-registry-helper.h>
 #include <test-button.h>
 #include <test-animation-data.h>
 
index f5a2d96..d524b81 100644 (file)
@@ -483,6 +483,7 @@ int UtcDaliControlRendererGetPropertyMap5(void)
   propertyMap.Insert( "desiredHeight",   30 );
   propertyMap.Insert( "fittingMode",   "FIT_HEIGHT" );
   propertyMap.Insert( "samplingMode",   "BOX_THEN_NEAREST" );
+  propertyMap.Insert( "synchronousLoading",   true );
 
   ControlRenderer imageRenderer = factory.GetControlRenderer(propertyMap);
   DALI_TEST_CHECK( imageRenderer );
@@ -515,6 +516,10 @@ int UtcDaliControlRendererGetPropertyMap5(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<int>() == 30 );
 
+  value = resultMap.Find( "synchronousLoading",   Property::BOOLEAN );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<bool>() == true );
+
   // Get an image renderer with an image handle, and test the default property values
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
   imageRenderer = factory.GetControlRenderer(image);
@@ -544,6 +549,10 @@ int UtcDaliControlRendererGetPropertyMap5(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<int>() == 200 );
 
+  value = resultMap.Find( "synchronousLoading",   Property::BOOLEAN );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<bool>() == false );
+
   END_TEST;
 }
 
index a2009d0..b92e8e7 100644 (file)
@@ -19,7 +19,6 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/flex-container/flex-container.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -43,6 +42,9 @@ const char* const PROPERTY_NAME_FLEX_WRAP = "flexWrap";
 const char* const PROPERTY_NAME_JUSTIFY_CONTENT = "justifyContent";
 const char* const PROPERTY_NAME_ALIGN_ITEMS = "alignItems";
 const char* const PROPERTY_NAME_ALIGN_CONTENT =  "alignContent";
+const char* const CHILD_PROPERTY_NAME_FLEX = "flex";
+const char* const CHILD_PROPERTY_NAME_ALIGN_SELF = "alignSelf";
+const char* const CHILD_PROPERTY_NAME_FLEX_MARGIN =  "flexMargin";
 
 } // namespace
 
@@ -145,6 +147,18 @@ int UtcDaliToolkitFlexContainerSetPropertyP(void)
   FlexContainer flexContainer = FlexContainer::New();
   DALI_TEST_CHECK( flexContainer );
 
+  // Add flex container to the stage
+  Stage::GetCurrent().Add( flexContainer );
+
+  // Create two actors and add them to the container
+  Actor actor1 = Actor::New();
+  Actor actor2 = Actor::New();
+  DALI_TEST_CHECK( actor1 );
+  DALI_TEST_CHECK( actor2 );
+
+  flexContainer.Add(actor1);
+  flexContainer.Add(actor2);
+
   // Check content direction property.
   flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, FlexContainer::RTL );
   DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
@@ -172,3 +186,37 @@ int UtcDaliToolkitFlexContainerSetPropertyP(void)
   END_TEST;
 }
 
+int UtcDaliToolkitFlexContainerSetChildPropertyP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitFlexContainerSetChildPropertyP");
+  FlexContainer flexContainer = FlexContainer::New();
+  DALI_TEST_CHECK( flexContainer );
+
+  // Add flex container to the stage
+  Stage::GetCurrent().Add( flexContainer );
+
+  // Create an actor and add it to the container
+  Actor actor = Actor::New();
+  DALI_TEST_CHECK( actor );
+
+  flexContainer.Add(actor);
+
+  // Check flex child property.
+  actor.SetProperty( FlexContainer::ChildProperty::FLEX, 2.0f );
+  DALI_TEST_EQUALS( actor.GetProperty<float>( FlexContainer::ChildProperty::FLEX ), 2.0f, TEST_LOCATION );
+  DALI_TEST_CHECK( actor.GetPropertyIndex( CHILD_PROPERTY_NAME_FLEX ) == FlexContainer::ChildProperty::FLEX );
+
+  // Check align self child property.
+  actor.SetProperty( FlexContainer::ChildProperty::ALIGN_SELF, FlexContainer::ALIGN_FLEX_END );
+  DALI_TEST_EQUALS( (FlexContainer::Alignment)actor.GetProperty<int>( FlexContainer::ChildProperty::ALIGN_SELF ), FlexContainer::ALIGN_FLEX_END, TEST_LOCATION );
+  DALI_TEST_CHECK( actor.GetPropertyIndex( CHILD_PROPERTY_NAME_ALIGN_SELF ) == FlexContainer::ChildProperty::ALIGN_SELF );
+
+  // Check flex margin child property.
+  actor.SetProperty( FlexContainer::ChildProperty::FLEX_MARGIN, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
+  DALI_TEST_EQUALS( actor.GetProperty<Vector4>( FlexContainer::ChildProperty::FLEX_MARGIN ), Vector4( 10.0f, 10.0f, 10.0f, 10.0f ), TEST_LOCATION );
+  DALI_TEST_CHECK( actor.GetPropertyIndex( CHILD_PROPERTY_NAME_FLEX_MARGIN ) == FlexContainer::ChildProperty::FLEX_MARGIN );
+
+  END_TEST;
+}
+
index 67f054c..5955748 100644 (file)
@@ -18,6 +18,8 @@
 // Need to override adaptor classes for toolkit test harness, so include
 // test harness headers before dali headers.
 #include <dali-toolkit-test-suite-utils.h>
+#include <toolkit-bitmap-loader.h>
+#include <toolkit-event-thread-callback.h>
 
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/devel-api/scripting/scripting.h>
@@ -73,6 +75,11 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 const char* TEST_IMAGE_FILE_NAME =  "gallery_image_01.jpg";
 const char* TEST_IMAGE_FILE_NAME2 =  "gallery_image_02.jpg";
 
+// resolution: 34*34, pixel format: RGBA8888
+static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
+// resolution: 600*600, pixel format: RGB888
+static const char* gImage_600_RGB = TEST_RESOURCE_DIR "/test-image-600.jpg";
+
 void TestImage( ImageView imageView, BufferImage image )
 {
   Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
@@ -356,6 +363,124 @@ int UtcDaliImageViewSetGetProperty03(void)
   END_TEST;
 }
 
+int UtcDaliImageViewAsyncLoadingWithoutAltasing(void)
+{
+  ToolkitTestApplication application;
+
+  // Async loading, no atlasing for big size image
+  ImageView imageView = ImageView::New( gImage_600_RGB );
+
+  // By default, Aysnc loading is used
+  Stage::GetCurrent().Add( imageView );
+  application.SendNotification();
+  application.Render(16);
+  application.Render(16);
+  application.SendNotification();
+
+  // BitmapLoader is not used
+  BitmapLoader loader = BitmapLoader::GetLatestCreated();
+  DALI_TEST_CHECK( !loader );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewAsyncLoadingWithAltasing(void)
+{
+  ToolkitTestApplication application;
+
+  //Async loading, automatic atlasing for small size image
+  TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+  callStack.Reset();
+  callStack.Enable(true);
+
+  ImageView imageView = ImageView::New( gImage_34_RGBA, ImageDimensions( 34, 34 ) );
+
+  // By default, Aysnc loading is used
+  // loading is not started if the actor is offStage
+  BitmapLoader loader = BitmapLoader::GetLatestCreated();
+  DALI_TEST_CHECK( !loader );
+
+  Stage::GetCurrent().Add( imageView );
+  application.SendNotification();
+  application.Render(16);
+  application.Render(16);
+  application.SendNotification();
+
+  // loading started
+  loader = BitmapLoader::GetLatestCreated();
+  DALI_TEST_CHECK( loader );
+
+  // worker thread is created
+  EventThreadCallback* eventTrigger = EventThreadCallback::Get();
+  DALI_TEST_CHECK( eventTrigger );
+
+  loader.WaitForLoading();// waiting until the image to be loaded
+  DALI_TEST_CHECK( loader.IsLoaded() );
+
+  CallbackBase* callback = eventTrigger->GetCallback();
+  CallbackBase::Execute( *callback );
+
+  application.SendNotification();
+  application.Render(16);
+
+  callStack.Enable(false);
+
+  DALI_TEST_CHECK(  callStack.FindMethodAndParams("TexSubImage2D", "0, 0, 34, 34" ) );
+
+
+  END_TEST;
+}
+
+int UtcDaliImageViewSyncLoading(void)
+{
+  ToolkitTestApplication application;
+
+  Property::Map syncLoadingMap;
+  syncLoadingMap[ "synchronousLoading" ] = true;
+
+  // Sync loading, no atlasing for big size image
+  {
+    ImageView imageView = ImageView::New( gImage_600_RGB );
+
+    // Sync loading is used
+    imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+
+    // BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
+    BitmapLoader loader = BitmapLoader::GetLatestCreated();
+    DALI_TEST_CHECK( loader );
+  }
+
+  // Sync loading, automatic atlasing for small size image
+  {
+    BitmapLoader::ResetLatestCreated();
+    TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+    callStack.Reset();
+    callStack.Enable(true);
+
+    ImageView imageView = ImageView::New( );
+    // Sync loading is used
+    syncLoadingMap[ "url" ] = gImage_34_RGBA;
+    syncLoadingMap[ "desiredHeight" ] = 34;
+    syncLoadingMap[ "desiredWidth" ] = 34;
+    imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+
+    // loading is started even if the actor is offStage
+    BitmapLoader loader = BitmapLoader::GetLatestCreated();
+    DALI_TEST_CHECK( loader );
+
+    loader.WaitForLoading();
+
+    DALI_TEST_CHECK( loader.IsLoaded() );
+
+    Stage::GetCurrent().Add( imageView );
+    application.SendNotification();
+    application.Render(16);
+    DALI_TEST_CHECK(  callStack.FindMethodAndParams("TexSubImage2D", "0, 0, 34, 34" ) );
+  }
+
+  END_TEST;
+}
+
 int UtcDaliImageViewSizeWithBackground(void)
 {
   ToolkitTestApplication application;
index 708fa3c..7beeb96 100644 (file)
@@ -686,10 +686,10 @@ int UtcDaliTableViewSetGetProperty(void)
   END_TEST;
 }
 
-int UtcDaliTableViewCustomProperties(void)
+int UtcDaliTableViewChildProperties(void)
 {
   ToolkitTestApplication application;
-  tet_infoline("UtcDaliTableViewCustomProperties");
+  tet_infoline("UtcDaliTableViewChildProperties");
 
   // Create a 10x10 table-view
   TableView tableView = TableView::New(10,10);
@@ -700,7 +700,7 @@ int UtcDaliTableViewCustomProperties(void)
 
   // Create a child actor with the custom properties
   Actor child1 = Actor::New();
-  child1.RegisterProperty( "cellIndex",  Vector2( 3, 4 ), Property::READ_WRITE );
+  child1.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 3, 4 ) );
   tableView.Add( child1 );
   // Check for actors at actual positions.
   DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(3,4)) == child1);
@@ -709,9 +709,9 @@ int UtcDaliTableViewCustomProperties(void)
   Actor child2 = Actor::New();
   float rowSpan = 3.f;
   float columnSpan = 2.f;
-  child2.RegisterProperty( "cellIndex",  Vector2( 6, 1 ), Property::READ_WRITE );
-  child2.RegisterProperty( "rowSpan",  rowSpan, Property::READ_WRITE );
-  child2.RegisterProperty( "columnSpan",  columnSpan, Property::READ_WRITE );
+  child2.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 6, 1 ) );
+  child2.SetProperty( TableView::ChildProperty::ROW_SPAN, rowSpan );
+  child2.SetProperty( TableView::ChildProperty::COLUMN_SPAN, columnSpan );
   tableView.Add( child2 );
   // Check for actors at actual positions.
   for( int i=0; i<rowSpan; i++ )
@@ -725,8 +725,8 @@ int UtcDaliTableViewCustomProperties(void)
   // Create a third child actor with the cell alignment properties
   Actor child3 = Actor::New();
   child3.SetSize( 5.f,5.f );
-  child3.RegisterProperty( "cellHorizontalAlignment",   "center", Property::READ_WRITE );
-  child3.RegisterProperty( "cellVerticalAlignment",   "bottom", Property::READ_WRITE );
+  child3.SetProperty( TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center" );
+  child3.SetProperty( TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT,   "bottom" );
   tableView.Add( child3 );
 
   // store the actor in the first available cell
index 9378648..08f085d 100644 (file)
@@ -51,6 +51,10 @@ const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underlineEnabled";
 const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underlineColor";
 const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underlineHeight";
 const char* const PROPERTY_NAME_ENABLE_MARKUP = "enableMarkup";
+const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL = "enableAutoScroll";
+const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED = "autoScrollSpeed";
+const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS = "autoScrollLoopCount";
+const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP = "autoScrollGap";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
@@ -152,6 +156,10 @@ int UtcDaliToolkitTextLabelGetPropertyP(void)
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_COLOR ) == TextLabel::Property::UNDERLINE_COLOR );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_HEIGHT) == TextLabel::Property::UNDERLINE_HEIGHT );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_MARKUP) == TextLabel::Property::ENABLE_MARKUP );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL ) == TextLabel::Property::ENABLE_AUTO_SCROLL );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED ) == TextLabel::Property::AUTO_SCROLL_SPEED );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS ) == TextLabel::Property::AUTO_SCROLL_LOOP_COUNT );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP ) == TextLabel::Property::AUTO_SCROLL_GAP );
 
   END_TEST;
 }
@@ -218,6 +226,20 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
   DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ) );
 
+  // Check autoscroll properties
+  const int SCROLL_SPEED = 80;
+  const int SCROLL_LOOPS = 4;
+  const float SCROLL_GAP = 50.0f;
+  label.SetProperty( TextLabel::Property::MULTI_LINE, false ); // Autoscroll only supported in single line
+  DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
+  label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+  DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
+  label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, SCROLL_SPEED );
+  DALI_TEST_EQUALS( SCROLL_SPEED, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_SPEED ), TEST_LOCATION );
+  label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, SCROLL_LOOPS );
+  DALI_TEST_EQUALS( SCROLL_LOOPS, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ), TEST_LOCATION );
+  label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, SCROLL_GAP );
+  DALI_TEST_EQUALS( SCROLL_GAP, label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_GAP ), TEST_LOCATION );
   END_TEST;
 }
 
@@ -321,3 +343,32 @@ int UtcDaliToolkitTextLabelVectorBasedP(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextlabelScrollingP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelScrollingP");
+  TextLabel label = TextLabel::New("Some text to scroll");
+  DALI_TEST_CHECK( label );
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  Stage::GetCurrent().Add( label );
+  // Turn on all the effects
+  label.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  label.SetProperty(  TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  label.SetProperty(  TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  label.SetProperty(  TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f);
+
+  try
+  {
+    // Render some text with the shared atlas backend
+    label.SetProperty(  TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    application.SendNotification();
+    application.Render();
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
index f967eb5..75aa867 100644 (file)
@@ -98,7 +98,6 @@ develapicontrolsdir =           $(develapidir)/controls
 develapibloomviewdir =          $(develapicontrolsdir)/bloom-view
 develapibubbleemitterdir =      $(develapicontrolsdir)/bubble-effect
 develapieffectsviewdir =        $(develapicontrolsdir)/effects-view
-develapiflexcontainerdir =      $(develapicontrolsdir)/flex-container
 develapimagnifierdir =          $(develapicontrolsdir)/magnifier
 develapirendererfactorydir =    $(develapicontrolsdir)/renderer-factory
 develapipopupdir =              $(develapicontrolsdir)/popup
@@ -119,7 +118,6 @@ develapibloomview_HEADERS =         $(devel_api_bloom_view_header_files)
 develapibubbleemitter_HEADERS =     $(devel_api_bubble_emitter_header_files)
 develapibuilder_HEADERS =           $(devel_api_builder_header_files)
 develapieffectsview_HEADERS =       $(devel_api_effects_view_header_files)
-develapiflexcontainer_HEADERS =     $(devel_api_flex_container_header_files)
 develapifocusmanager_HEADERS =      $(devel_api_focus_manager_header_files)
 develapiimageatlas_HEADERS =        $(devel_api_image_atlas_header_files)
 develapimagnifier_HEADERS =         $(devel_api_magnifier_header_files)
@@ -141,6 +139,7 @@ publicapiaccessibilitymanagerdir = $(publicapidir)/accessibility-manager
 publicapialignmentdir =            $(publicapicontrolsdir)/alignment
 publicapibuttonsdir =              $(publicapicontrolsdir)/buttons
 publicapidefaultcontrolsdir =      $(publicapicontrolsdir)/default-controls
+publicapiflexcontainerdir =        $(publicapicontrolsdir)/flex-container
 publicapigaussianblurviewdir =     $(publicapicontrolsdir)/gaussian-blur-view
 publicapiimageviewdir =            $(publicapicontrolsdir)/image-view
 publicapimodel3dviewdir =          $(publicapicontrolsdir)/model3d-view
@@ -162,6 +161,7 @@ publicapiaccessibilitymanager_HEADERS = $(public_api_accessibility_manager_heade
 publicapialignment_HEADERS =            $(public_api_alignment_header_files)
 publicapibuttons_HEADERS =              $(public_api_buttons_header_files)
 publicapidefaultcontrols_HEADERS =      $(public_api_default_controls_header_files)
+publicapiflexcontainer_HEADERS =        $(public_api_flex_container_header_files)
 publicapigaussianblurview_HEADERS =     $(public_api_gaussian_blur_view_header_files)
 publicapiimageview_HEADERS =            $(public_api_image_view_header_files)
 publicapiitemview_HEADERS =             $(public_api_item_view_header_files)
index 36484f1..637d534 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
+#include <dali-toolkit/public-api/controls/flex-container/flex-container.h>
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
index f28fa71..e6b7576 100755 (executable)
@@ -7,7 +7,6 @@ devel_api_src_files = \
   $(devel_api_src_dir)/controls/bloom-view/bloom-view.cpp \
   $(devel_api_src_dir)/controls/bubble-effect/bubble-emitter.cpp \
   $(devel_api_src_dir)/controls/effects-view/effects-view.cpp \
-  $(devel_api_src_dir)/controls/flex-container/flex-container.cpp \
   $(devel_api_src_dir)/controls/magnifier/magnifier.cpp \
   $(devel_api_src_dir)/controls/popup/confirmation-popup.cpp \
   $(devel_api_src_dir)/controls/popup/popup.cpp \
@@ -47,9 +46,6 @@ devel_api_builder_header_files = \
 devel_api_effects_view_header_files = \
   $(devel_api_src_dir)/controls/effects-view/effects-view.h
 
-devel_api_flex_container_header_files = \
-  $(devel_api_src_dir)/controls/flex-container/flex-container.h
-
 devel_api_magnifier_header_files = \
   $(devel_api_src_dir)/controls/magnifier/magnifier.h
 
index a3eac2c..0212161 100644 (file)
@@ -1392,27 +1392,28 @@ Toolkit::AccessibilityManager::FocusedActorActivatedSignalType& AccessibilityMan
 
 bool AccessibilityManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
-  Dali::BaseHandle handle( object );
-
   bool connected( true );
   AccessibilityManager* manager = dynamic_cast<AccessibilityManager*>( object );
 
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
-  {
-    manager->FocusChangedSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
-  {
-    manager->FocusOvershotSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
+  if( manager )
   {
-    manager->FocusedActorActivatedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
+    if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
+    {
+      manager->FocusChangedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
+    {
+      manager->FocusOvershotSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
+    {
+      manager->FocusedActorActivatedSignal().Connect( tracker, functor );
+    }
+    else
+    {
+      // signalName does not match any signal
+      connected = false;
+    }
   }
 
   return connected;
index dc0ab41..4c018aa 100644 (file)
@@ -23,6 +23,7 @@
 #include <list>
 #include <map>
 #include <dali/public-api/common/stage.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/property-map.h>
index f080ba3..ab8ff5c 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 
 namespace Dali
index ab3a9c9..5d5e22c 100644 (file)
@@ -26,7 +26,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/devel-api/rendering/renderer.h>
 
index 6d5ef93..69d0026 100644 (file)
@@ -18,6 +18,8 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/devel-api/rendering/renderer.h>
index 6df5fcf..3af81bb 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
index 9a47206..2190016 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/scripting/scripting.h>
 
index d65b8fd..d0d019e 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
index 00e1271..675709b 100644 (file)
@@ -22,7 +22,7 @@
 #include <sstream>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
@@ -31,18 +31,6 @@ using namespace Dali;
 
 namespace
 {
-/*
- * Custom properties for how to lay out the actor.
- *
- * When an actor is add to the flex container, the following custom properties of the actor
- * are checked to decide how to lay out the actor inside the flex container.
- *
- * These non-animatable properties should be registered to the child which would be added
- * to the flex container, and once added their values can not be changed.
- */
-const char * const FLEX_PROPERTY_NAME("flex");
-const char * const ALIGN_SELF_PROPERTY_NAME("alignSelf");
-const char * const FLEX_MARGIN_PROPERTY_NAME("flexMargin");
 
 #if defined(DEBUG_ENABLED)
 // debugging support, very useful when new features are added or bugs are hunted down
@@ -93,12 +81,15 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::FlexContainer, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer, "contentDirection",   INTEGER, CONTENT_DIRECTION )
-DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer, "flexDirection",      INTEGER, FLEX_DIRECTION    )
-DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer, "flexWrap",           INTEGER, FLEX_WRAP         )
-DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer, "justifyContent",     INTEGER, JUSTIFY_CONTENT   )
-DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer, "alignItems",         INTEGER, ALIGN_ITEMS       )
-DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer, "alignContent",       INTEGER, ALIGN_CONTENT     )
+DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer,        "contentDirection",  INTEGER,  CONTENT_DIRECTION )
+DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer,        "flexDirection",     INTEGER,  FLEX_DIRECTION    )
+DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer,        "flexWrap",          INTEGER,  FLEX_WRAP         )
+DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer,        "justifyContent",    INTEGER,  JUSTIFY_CONTENT   )
+DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer,        "alignItems",        INTEGER,  ALIGN_ITEMS       )
+DALI_PROPERTY_REGISTRATION( Toolkit, FlexContainer,        "alignContent",      INTEGER,  ALIGN_CONTENT     )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, FlexContainer,  "flex",              FLOAT,    FLEX              )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, FlexContainer,  "alignSelf",         INTEGER,  ALIGN_SELF        )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, FlexContainer,  "flexMargin",        VECTOR4,  FLEX_MARGIN       )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -605,18 +596,19 @@ void FlexContainer::ComputeLayout()
       childNode->style.maxDimensions[CSS_WIDTH] = childActor.GetMaximumSize().x;
       childNode->style.maxDimensions[CSS_HEIGHT] = childActor.GetMaximumSize().y;
 
-      // Test custom properties on the child
-      if( childActor.GetPropertyIndex( FLEX_PROPERTY_NAME ) != Property::INVALID_INDEX )
+      // Check child properties on the child for how to layout it.
+      // These properties should be dynamically registered to the child which
+      // would be added to FlexContainer.
+
+      if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX ) != Property::NONE )
       {
-        childNode->style.flex = childActor.GetProperty( childActor.GetPropertyIndex(FLEX_PROPERTY_NAME) ).Get<float>();
+        childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get<float>();
       }
 
-      Property::Index alignSelfPropertyIndex = childActor.GetPropertyIndex( ALIGN_SELF_PROPERTY_NAME );
-      if( alignSelfPropertyIndex != Property::INVALID_INDEX )
+      Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO );
+      if( childActor.GetPropertyType( Toolkit::FlexContainer::FlexContainer::ChildProperty::ALIGN_SELF ) != Property::NONE )
       {
-        Property::Value alignSelfPropertyValue = childActor.GetProperty( alignSelfPropertyIndex );
-
-        Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO );
+        Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF );
         if( alignSelfPropertyValue.GetType() == Property::INTEGER )
         {
           alignSelf = static_cast<Toolkit::FlexContainer::Alignment>( alignSelfPropertyValue.Get< int >() );
@@ -629,12 +621,12 @@ void FlexContainer::ComputeLayout()
                                                                           ALIGN_SELF_STRING_TABLE_COUNT,
                                                                           alignSelf );
         }
-        childNode->style.align_self = static_cast<css_align_t>(alignSelf);
       }
+      childNode->style.align_self = static_cast<css_align_t>(alignSelf);
 
-      if( childActor.GetPropertyIndex( FLEX_MARGIN_PROPERTY_NAME ) != Property::INVALID_INDEX )
+      if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ) != Property::NONE )
       {
-        Vector4 flexMargin = childActor.GetProperty( childActor.GetPropertyIndex(FLEX_MARGIN_PROPERTY_NAME) ).Get<Vector4>();
+        Vector4 flexMargin = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ).Get<Vector4>();
         childNode->style.margin[CSS_LEFT] = flexMargin.x;
         childNode->style.margin[CSS_TOP] = flexMargin.y;
         childNode->style.margin[CSS_RIGHT] = flexMargin.z;
index 17ea2b6..2005f9c 100644 (file)
@@ -23,7 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/devel-api/controls/flex-container/flex-container.h>
+#include <dali-toolkit/public-api/controls/flex-container/flex-container.h>
 extern "C"
 {
 #include "layout.h"
index 6081c0b..89851d4 100644 (file)
@@ -26,7 +26,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/debug.h>
 
index 5843804..03229f9 100644 (file)
@@ -6,7 +6,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
@@ -44,8 +44,7 @@ DALI_TYPE_REGISTRATION_END()
 using namespace Dali;
 
 ImageView::ImageView()
-: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
-  mPremultipledAlphaEnabled( false )
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
 {
 }
 
@@ -305,10 +304,10 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr
 
       case Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA:
       {
-        bool IsPre;
-        if( value.Get( IsPre ) )
+        bool isPre;
+        if( value.Get( isPre ) )
         {
-          GetImpl(imageView).EnablePreMultipliedAlpha( IsPre );
+          GetImpl(imageView).EnablePreMultipliedAlpha( isPre );
         }
         break;
       }
index c598c26..fcc0c63 100644 (file)
@@ -164,8 +164,6 @@ private:
   std::string      mUrl;          ///< the url for the image if the image came from a URL, empty otherwise
   Image            mImage;        ///< the Image if the image came from a Image, null otherwise
   Property::Map    mPropertyMap;  ///< the Property::Map if the image came from a Property::Map, empty otherwise
-
-  bool             mPremultipledAlphaEnabled; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
 };
 
 } // namespace Internal
index dfc7e1b..af2fe10 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
index 0f64ac0..f3e7fb2 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraint-source.h>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/file-loader.h>
index 593eac5..290cdf2 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 namespace Dali
 {
index 84e9854..25393e9 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 //INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
index 5104216..9e2e7bb 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index b521cff..43758cb 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <cstring>
 
 namespace Dali
index de35289..935ac86 100755 (executable)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/devel-api/adaptor-framework/physical-keyboard.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/animation/constraints.h>
index c09f86f..3fd6a74 100644 (file)
@@ -119,7 +119,7 @@ void ColorRenderer::InitializeRenderer()
   Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
   if( !geometry )
   {
-    geometry =  RendererFactoryCache::CreateQuadGeometry();
+    geometry =  Geometry::QUAD();
     mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
   }
 
index 2428715..5092075 100644 (file)
@@ -39,7 +39,8 @@ struct Internal::ControlRenderer::Impl
   {
     IS_ON_STAGE = 1,
     IS_FROM_CACHE = 1 << 1,
-    IS_PREMULTIPLIED_ALPHA = 1 << 2
+    IS_PREMULTIPLIED_ALPHA = 1 << 2,
+    IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3
   };
 
   struct CustomShader
index 42d9634..2009f8a 100644 (file)
@@ -137,7 +137,15 @@ void ControlRenderer::SetOffStage( Actor& actor )
 
 void ControlRenderer::EnablePreMultipliedAlpha( bool preMultipled )
 {
-  mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
+  if(preMultipled)
+  {
+    mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
+  }
+  else
+  {
+    mImpl->mFlags &= ~Impl::IS_PREMULTIPLIED_ALPHA;
+  }
+
   if( mImpl->mRenderer )
   {
     mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, preMultipled);
index 6b35829..c150497 100644 (file)
@@ -311,7 +311,7 @@ void GradientRenderer::InitializeRenderer()
   Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
   if( !geometry )
   {
-    geometry =  RendererFactoryCache::CreateQuadGeometry();
+    geometry =  Geometry::QUAD();
     mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
   }
 
index d0c6c91..af155f7 100644 (file)
@@ -22,6 +22,8 @@
 #include <cstring> // for strncasecmp
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/images/native-image.h>
+#include <dali/devel-api/images/atlas.h>
+#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL HEADER
@@ -51,6 +53,7 @@ const char * const IMAGE_FITTING_MODE( "fittingMode" );
 const char * const IMAGE_SAMPLING_MODE( "samplingMode" );
 const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
 const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
+const char * const SYNCHRONOUS_LOADING( "synchronousLoading" );
 
 // fitting modes
 const char * const SHRINK_TO_FIT("SHRINK_TO_FIT");
@@ -113,7 +116,7 @@ Geometry CreateGeometry( RendererFactoryCache& factoryCache, ImageDimensions gri
     geometry = factoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
     if( !geometry )
     {
-      geometry =  RendererFactoryCache::CreateQuadGeometry();
+      geometry =  Geometry::QUAD();
       factoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
     }
   }
@@ -248,6 +251,29 @@ void ImageRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap
     }
 
     mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
+
+  }
+
+  Property::Value* syncLoading = propertyMap.Find( SYNCHRONOUS_LOADING );
+  if( syncLoading )
+  {
+    bool sync;
+    syncLoading->Get( sync );
+    if( sync )
+    {
+      mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+    }
+    else
+    {
+      mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+    }
+  }
+
+  // if sync loading is required, the loading should start immediately when new image url is set or the actor is off stage
+  // ( for on-stage actor with image url unchanged, resource loading is already finished)
+  if( ( !mImpl->mRenderer || imageURLValue) && IsSynchronousResourceLoading() )
+  {
+    DoSynchronousResourceLoading();
   }
 
   // remove old renderer if exit
@@ -354,10 +380,7 @@ Renderer ImageRenderer::CreateRenderer() const
     }
   }
 
-  TextureSet textureSet = TextureSet::New();
-
   Renderer renderer = Renderer::New( geometry, shader );
-  renderer.SetTextures( textureSet );
 
   return renderer;
 }
@@ -378,20 +401,13 @@ Renderer ImageRenderer::CreateNativeImageRenderer() const
   else
   {
     geometry = CreateGeometry( mFactoryCache, mImpl->mCustomShader->mGridSize );
-    if( mImpl->mCustomShader->mVertexShader.empty() && mImpl->mCustomShader->mFragmentShader.empty() )
+    shader  = Shader::New( mImpl->mCustomShader->mVertexShader.empty() ? VERTEX_SHADER : mImpl->mCustomShader->mVertexShader,
+                           mNativeFragmentShaderCode,
+                           mImpl->mCustomShader->mHints );
+    if( mImpl->mCustomShader->mVertexShader.empty() )
     {
-      shader  = Shader::New( VERTEX_SHADER, mNativeFragmentShaderCode );
-    }
-    else
-    {
-      shader  = Shader::New( mImpl->mCustomShader->mVertexShader.empty() ? VERTEX_SHADER : mImpl->mCustomShader->mVertexShader,
-                             mNativeFragmentShaderCode,
-                             mImpl->mCustomShader->mHints );
-      if( mImpl->mCustomShader->mVertexShader.empty() )
-      {
-        shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
-        shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
-      }
+      shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
+      shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
     }
   }
 
@@ -402,6 +418,82 @@ Renderer ImageRenderer::CreateNativeImageRenderer() const
   return renderer;
 }
 
+
+bool ImageRenderer::IsSynchronousResourceLoading() const
+{
+  return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+}
+
+void ImageRenderer::DoSynchronousResourceLoading()
+{
+  if( !mImageUrl.empty() )
+  {
+    BitmapLoader loader = BitmapLoader::New( mImageUrl, mDesiredSize, mFittingMode, mSamplingMode );
+    loader.Load();
+    mPixels = loader.GetPixelData();
+  }
+}
+
+Image ImageRenderer::LoadImage( const std::string& url, bool synchronousLoading )
+{
+  if( synchronousLoading )
+  {
+    if( !mPixels )
+    {
+      // use broken image
+      return RendererFactory::GetBrokenRendererImage();
+    }
+    Atlas image = Atlas::New( mPixels->GetWidth(), mPixels->GetHeight(), mPixels->GetPixelFormat() );
+    image.Upload( mPixels, 0, 0 );
+    return image;
+  }
+  else
+  {
+    ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
+    resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+    return resourceImage;
+  }
+}
+
+TextureSet ImageRenderer::CreateTextureSet( Vector4& textureRect, const std::string& url, bool synchronousLoading )
+{
+  TextureSet textureSet;
+  textureRect = FULL_TEXTURE_RECT;
+  if( synchronousLoading )
+  {
+    if( !mPixels )
+    {
+      // use broken image
+      textureSet = TextureSet::New();
+      textureSet.SetImage( 0u, RendererFactory::GetBrokenRendererImage() );
+    }
+    else
+    {
+      textureSet = mAtlasManager.Add(textureRect, mPixels );
+      if( !textureSet ) // big image, no atlasing
+      {
+        Atlas image = Atlas::New( mPixels->GetWidth(), mPixels->GetHeight(), mPixels->GetPixelFormat() );
+        image.Upload( mPixels, 0, 0 );
+        textureSet = TextureSet::New();
+        textureSet.SetImage( 0u, image );
+      }
+    }
+  }
+  else
+  {
+    textureSet = mAtlasManager.Add(textureRect, url, mDesiredSize, mFittingMode, mSamplingMode );
+    if( !textureSet ) // big image, no atlasing
+    {
+      ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
+      resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+      textureSet = TextureSet::New();
+      textureSet.SetImage( 0u, resourceImage );
+    }
+  }
+
+  return textureSet;
+}
+
 void ImageRenderer::InitializeRenderer( const std::string& imageUrl )
 {
   if( imageUrl.empty() )
@@ -420,25 +512,15 @@ void ImageRenderer::InitializeRenderer( const std::string& imageUrl )
     if( !mImpl->mRenderer )
     {
       Vector4 atlasRect;
-      TextureSet textureSet = mAtlasManager.Add(atlasRect, imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
-      if( textureSet )
+      TextureSet textureSet = CreateTextureSet(atlasRect, imageUrl, IsSynchronousResourceLoading() );
+      Geometry geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
+      Shader shader( GetImageShader(mFactoryCache) );
+      mImpl->mRenderer = Renderer::New( geometry, shader );
+      mImpl->mRenderer.SetTextures( textureSet );
+      if( atlasRect != FULL_TEXTURE_RECT )
       {
-        Geometry geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
-        Shader shader( GetImageShader(mFactoryCache) );
-        mImpl->mRenderer = Renderer::New( geometry, shader );
-        mImpl->mRenderer.SetTextures( textureSet );
         mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
       }
-      else // big image, atlasing is not applied
-      {
-        mImpl->mRenderer = CreateRenderer();
-
-        ResourceImage image = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
-        image.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
-        TextureSet textureSet = mImpl->mRenderer.GetTextures();
-        textureSet.SetImage( 0u, image );
-      }
-
       mFactoryCache.SaveRenderer( imageUrl, mImpl->mRenderer );
     }
 
@@ -450,9 +532,8 @@ void ImageRenderer::InitializeRenderer( const std::string& imageUrl )
 
     mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
     mImpl->mRenderer = CreateRenderer();
-    ResourceImage resourceImage = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
-    resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
-    ApplyImageToSampler( resourceImage );
+    Image image = LoadImage( imageUrl, IsSynchronousResourceLoading() );
+    ApplyImageToSampler( image );
   }
 }
 
@@ -502,6 +583,9 @@ void ImageRenderer::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( RENDERER_TYPE, IMAGE_RENDERER );
+
+  bool sync = IsSynchronousResourceLoading();
+  map.Insert( SYNCHRONOUS_LOADING, sync );
   if( !mImageUrl.empty() )
   {
     map.Insert( IMAGE_URL_NAME, mImageUrl );
@@ -618,6 +702,11 @@ void ImageRenderer::SetImage( Actor& actor, const std::string& imageUrl, ImageDi
     mSamplingMode = samplingMode;
     mImage.Reset();
 
+    if( IsSynchronousResourceLoading() )
+    {
+      DoSynchronousResourceLoading();
+    }
+
     if( mImpl->mRenderer )
     {
       if( GetIsFromCache() ) // if renderer is from cache, remove the old one
@@ -641,8 +730,7 @@ void ImageRenderer::SetImage( Actor& actor, const std::string& imageUrl, ImageDi
       }
       else // if renderer is not from cache, reuse the same renderer and only change the texture
       {
-        ResourceImage image = Dali::ResourceImage::New( imageUrl, mDesiredSize, mFittingMode, mSamplingMode );
-        image.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+        Image image = LoadImage( imageUrl, IsSynchronousResourceLoading() );
         ApplyImageToSampler( image );
       }
     }
@@ -733,10 +821,12 @@ void ImageRenderer::ApplyImageToSampler( const Image& image )
   if( image )
   {
     TextureSet textureSet = mImpl->mRenderer.GetTextures();
-    if( textureSet )
+    if( !textureSet )
     {
-      textureSet.SetImage( 0u, image );
+      textureSet = TextureSet::New();
+      mImpl->mRenderer.SetTextures( textureSet );
     }
+    textureSet.SetImage( 0u, image );
   }
 }
 
@@ -795,7 +885,6 @@ void ImageRenderer::SetNativeFragmentShaderCode( Dali::NativeImage& nativeImage
   {
     mNativeFragmentShaderCode.replace( mNativeFragmentShaderCode.find( DEFAULT_SAMPLER_TYPENAME ), strlen( DEFAULT_SAMPLER_TYPENAME ), customSamplerTypename );
   }
-
 }
 
 } // namespace Internal
index da7e100..c63a073 100644 (file)
@@ -46,13 +46,14 @@ typedef IntrusivePtr< ImageRenderer > ImageRendererPtr;
  *
  * The following properties are optional
  *
- * | %Property Name          | Type             |
- * |-------------------------|------------------|
+ * | %Property Name     | Type             |
+ * |--------------------|------------------|
  * | url                | STRING           |
  * | fittingMode        | STRING           |
  * | samplingMode       | STRING           |
  * | desiredWidth       | INT              |
  * | desiredHeight      | INT              |
+ * | synchronousLoading | BOOLEAN          |
  *
  * where imageFittingMode should be one of the following fitting modes:
  *   "SHRINK_TO_FIT"
@@ -145,7 +146,7 @@ public:
    * The renderer will load the Image asynchronously when the associated actor is put on stage, and destroy the image when it is off stage
    *
    * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
-   * @param[in] imageUrl The URL to to image resource to use
+   * @param[in] imageUrl The URL of the image resource to use
    * @param[in] size The width and height to fit the loaded image to.
    * @param[in] fittingMode The FittingMode of the resource to load
    * @param[in] samplingMode The SamplingMode of the resource to load
@@ -202,6 +203,32 @@ private:
   Renderer CreateNativeImageRenderer() const;
 
   /**
+   * @brief Query whether resources requires to be loaded synchronously.
+   * @return Returns true if synchronoud resource loading is required, false otherwise.
+   */
+  bool IsSynchronousResourceLoading() const;
+
+  /**
+   * @brief Do the synchronous resource loading
+   */
+  void DoSynchronousResourceLoading();
+
+  /**
+   * Load the image.
+   * @param[in] url The URL of the image resource to use.
+   * @param[in] synchronousLoading If true, the resource is loaded synchronously, otherwise asynchronously.
+   */
+  Image LoadImage( const std::string& url, bool synchronousLoading );
+
+  /**
+   * Load the image and create a texture set to hold the texture, with automatic atlasing applied.
+   * @param [out] textureRect The texture area of the resource image in the atlas.
+   * @param[in] url The URL of the image resource to use.
+   * @param[in] synchronousLoading If true, the resource is loaded synchronously, otherwise asynchronously.
+   */
+  TextureSet CreateTextureSet( Vector4& textureRect, const std::string& url, bool synchronousLoading );
+
+  /**
    * Callback function of image resource loading succeed
    * @param[in] image The Image content that we attempted to load from mImageUrl
    */
@@ -226,6 +253,7 @@ private:
 private:
   Image mImage;
   ImageAtlasManager& mAtlasManager;
+  PixelDataPtr mPixels;
 
   std::string mImageUrl;
   Dali::ImageDimensions mDesiredSize;
index 4fd7424..3db2282 100644 (file)
@@ -153,32 +153,6 @@ Renderer RendererFactoryCache::GetDebugRenderer()
   return mDebugRenderer;
 }
 
-Geometry RendererFactoryCache::CreateQuadGeometry()
-{
-  const float halfWidth = 0.5f;
-  const float halfHeight = 0.5f;
-  struct QuadVertex { Vector2 position;};
-  QuadVertex quadVertexData[4] =
-  {
-      { Vector2(-halfWidth, -halfHeight) },
-      { Vector2(-halfWidth, halfHeight)  },
-      { Vector2( halfWidth, -halfHeight) },
-      { Vector2( halfWidth, halfHeight)  }
-  };
-
-  Property::Map quadVertexFormat;
-  quadVertexFormat["aPosition"] = Property::VECTOR2;
-  PropertyBuffer quadVertices = PropertyBuffer::New( quadVertexFormat );
-  quadVertices.SetData( quadVertexData, 4 );
-
-  // Create the geometry object
-  Geometry geometry = Geometry::New();
-  geometry.AddVertexBuffer( quadVertices );
-  geometry.SetGeometryType( Geometry::TRIANGLE_STRIP );
-
-  return geometry;
-}
-
 SvgRasterizeThread* RendererFactoryCache::GetSVGRasterizationThread()
 {
   if( !mSvgRasterizeThread )
index f6fd573..8bffd15 100644 (file)
@@ -109,12 +109,6 @@ public:
    */
   void SaveShader( ShaderType type, Shader shader );
 
-  /*
-   * Greate the quad geometry.
-   * Quad geometry is shared by multiple kind of Renderer, so implement it in the factory-cache.
-   */
-  static Geometry CreateQuadGeometry();
-
   /**
    * Create the grid geometry.
    * @param[in] gridSize The size of the grid.
index 8ac1b74..fb62e8c 100644 (file)
  */
 
 // CLASS HEADER
-#include "renderer-factory-impl.h"
+#include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
-// Internal HEADER
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/renderers/border/border-renderer.h>
 #include <dali-toolkit/internal/controls/renderers/color/color-renderer.h>
 #include <dali-toolkit/internal/controls/renderers/debug/debug-renderer.h>
index e52cb15..9643567 100644 (file)
@@ -230,13 +230,25 @@ typedef struct NSVGgradientData
 {
     char id[64];
     char ref[64];
-    char type;
+
+    /**
+     * In the original file, using char type (without signed or unsigned) can be interpreted
+     * as 'unsigned char' in some build environments, like ARM architecture.
+     * To prevent the unexpected behavior, we replace 'char type' with 'signed char type' here.
+     */
+    signed char type;
     union {
         NSVGlinearData linear;
         NSVGradialData radial;
     };
     char spread;
-    char units;
+
+    /**
+     * In the original file, using char type (without signed or unsigned) can be interpreted
+     * as 'unsigned char' in some build environments, like ARM architecture.
+     * To prevent the unexpected behavior, we replace 'char units' with 'signed char units' here.
+     */
+    signed char units;
     float xform[6];
     int nstops;
     NSVGgradientStop* stops;
@@ -643,7 +655,12 @@ static NSVGgradientData* nsvg__findGradientData(NSVGparser* p, const char* id)
     return NULL;
 }
 
-static NSVGgradient* nsvg__createGradient(NSVGparser* p, const char* id, const float* localBounds, char* paintType)
+/**
+ * In the original file, using char type (without signed or unsigned) can be interpreted
+ * as 'unsigned char' in some build environments, like ARM architecture.
+ * To prevent the unexpected behavior, we replace 'char paintType' with 'signed char paintType' here.
+ */
+static NSVGgradient* nsvg__createGradient(NSVGparser* p, const char* id, const float* localBounds, signed char* paintType)
 {
     NSVGattrib* attr = nsvg__getAttr(p);
     NSVGgradientData* data = NULL;
index 608bcd6..2634297 100644 (file)
@@ -113,7 +113,12 @@ typedef struct NSVGgradient {
 } NSVGgradient;
 
 typedef struct NSVGpaint {
-       char type;
+       /**
+        * In the original file, using char type (without signed or unsigned) can be interpreted
+        * as 'unsigned char' in some build environments, like ARM architecture.
+        * To prevent the unexpected behavior, we replace 'char type' with 'signed char type' here.
+        */
+       signed char type;
        union {
                unsigned int color;
                NSVGgradient* gradient;
index 73bfd2c..a3f3bdb 100644 (file)
@@ -68,7 +68,12 @@ typedef struct NSVGmemPage {
 } NSVGmemPage;
 
 typedef struct NSVGcachedPaint {
-    char type;
+    /**
+     * In the original file, using char type (without signed or unsigned) can be interpreted
+     * as 'unsigned char' in some build environments, like ARM architecture.
+     * To prevent the unexpected behavior, we replace 'char type' with 'signed char type' here.
+     */
+    signed char type;
     char spread;
     float xform[6];
     unsigned int colors[256];
@@ -873,7 +878,13 @@ static void nsvg__fillScanline(unsigned char* scanline, int len, int x0, int x1,
 // note: this routine clips fills that extend off the edges... ideally this
 // wouldn't happen, but it could happen if the truetype glyph bounding boxes
 // are wrong, or if the user supplies a too-small bitmap
-static void nsvg__fillActiveEdges(unsigned char* scanline, int len, NSVGactiveEdge* e, int maxWeight, int* xmin, int* xmax, char fillRule)
+
+ /**
+  * In the original file, using char type (without signed or unsigned) can be interpreted
+  * as 'unsigned char' in some build environments, like ARM architecture.
+  * To prevent the unexpected behavior, we replace 'char fillRule' with 'signed char fillRule' here.
+  */
+static void nsvg__fillActiveEdges(unsigned char* scanline, int len, NSVGactiveEdge* e, int maxWeight, int* xmin, int* xmax, signed char fillRule)
 {
     // non-zero winding fill
     int x0 = 0, w = 0;
index d6619d3..f48a5ad 100644 (file)
@@ -96,7 +96,7 @@ void SvgRenderer::DoSetOnStage( Actor& actor )
   Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
   if( !geometry )
   {
-    geometry =  mFactoryCache.CreateQuadGeometry();
+    geometry =  Geometry::QUAD();
     mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
   }
   TextureSet textureSet = TextureSet::New();
index 8d3aa64..f10dfb5 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/property-array.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
-
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -39,12 +38,14 @@ namespace
 {
 
 const char* DEFAULT_INDICATOR_IMAGE_PATH = DALI_IMAGE_DIR "popup_scroll.9.png";
-const float MINIMUM_INDICATOR_HEIGHT(20.0f); // The minimum indicator height for the nine patch border
 const float DEFAULT_SLIDER_DEPTH(1.0f);
 const float DEFAULT_INDICATOR_SHOW_DURATION(0.5f);
 const float DEFAULT_INDICATOR_HIDE_DURATION(0.5f);
 const float DEFAULT_PAN_GESTURE_PROCESS_TIME(16.7f); // 16.7 milliseconds, i.e. one frame
 const float DEFAULT_INDICATOR_FIXED_HEIGHT(80.0f);
+const float DEFAULT_INDICATOR_MINIMUM_HEIGHT(0.0f);
+const float DEFAULT_INDICATOR_START_PADDING(0.0f);
+const float DEFAULT_INDICATOR_END_PADDING(0.0f);
 
 /**
  * Indicator size constraint
@@ -52,7 +53,13 @@ const float DEFAULT_INDICATOR_FIXED_HEIGHT(80.0f);
  */
 struct IndicatorSizeConstraint
 {
-  IndicatorSizeConstraint()
+  /**
+   * @param[in] minimumHeight The minimum height for the indicator
+   * @param[in] padding The sum of the padding at the start & end of the indicator
+   */
+  IndicatorSizeConstraint( float minimumHeight, float padding )
+  : mMinimumHeight( minimumHeight ),
+    mPadding( padding )
   {
   }
 
@@ -62,17 +69,23 @@ struct IndicatorSizeConstraint
    * @param[in] parentSizeProperty The parent size of scroll indicator.
    * @return The new scroll indicator size.
    */
-  void operator()(Vector3& current, const PropertyInputContainer& inputs )
+  void operator()( Vector3& current, const PropertyInputContainer& inputs )
   {
     const Vector3& parentSize = inputs[0]->GetVector3();
     const float contentSize = inputs[1]->GetFloat();
 
-    float height = contentSize > parentSize.height ?
-                   parentSize.height * ( parentSize.height / contentSize ) :
-                   parentSize.height * ( (parentSize.height - contentSize * 0.5f) / parentSize.height);
+    // Take into account padding that may exist at the beginning and end of the indicator.
+    const float parentHeightMinusPadding = parentSize.height - mPadding;
 
-    current.y = std::max(MINIMUM_INDICATOR_HEIGHT, height);
+    float height = contentSize > parentHeightMinusPadding ?
+                   parentHeightMinusPadding * ( parentHeightMinusPadding / contentSize ) :
+                   parentHeightMinusPadding * ( ( parentHeightMinusPadding - contentSize * 0.5f ) / parentHeightMinusPadding );
+
+    current.y = std::max( mMinimumHeight, height );
   }
+
+  float mMinimumHeight;
+  float mPadding;
 };
 
 /**
@@ -82,10 +95,12 @@ struct IndicatorSizeConstraint
 struct IndicatorPositionConstraint
 {
   /**
-   * @param[in] minPosition The minimum limit of scroll position
-   * @param[in] maxPosition the maximum limit of scroll position
+   * @param[in] startPadding The padding at the start of the indicator
+   * @param[in] endPadding The padding at the end of the indicator
    */
-  IndicatorPositionConstraint()
+  IndicatorPositionConstraint( float startPadding, float endPadding )
+  : mStartPadding( startPadding ),
+    mEndPadding( endPadding )
   {
   }
 
@@ -100,13 +115,19 @@ struct IndicatorPositionConstraint
     const Vector3& indicatorSize = inputs[0]->GetVector3();
     const Vector3& parentSize = inputs[1]->GetVector3();
     const float scrollPosition = -inputs[2]->GetFloat();
-    const float minScrollPosition = inputs[3]->GetFloat();
-    const float maxScrollPosition = inputs[4]->GetFloat();
+    const float minimumScrollPosition = inputs[3]->GetFloat();
+    const float maximumScrollPosition = inputs[4]->GetFloat();
 
-    float relativePosition = std::max( 0.0f, std::min( 1.0f, (scrollPosition - minScrollPosition) / (maxScrollPosition - minScrollPosition) ) );
-    current.y = ( parentSize.height - indicatorSize.height ) * relativePosition;
+    // Take into account padding that may exist at the beginning and end of the indicator.
+    const float parentHeightMinusPadding = parentSize.height - ( mStartPadding + mEndPadding );
+
+    float relativePosition = std::max( 0.0f, std::min( 1.0f, ( scrollPosition - minimumScrollPosition ) / ( maximumScrollPosition - minimumScrollPosition ) ) );
+    current.y = mStartPadding + ( parentHeightMinusPadding - indicatorSize.height ) * relativePosition;
     current.z = DEFAULT_SLIDER_DEPTH;
   }
+
+  float mStartPadding;
+  float mEndPadding;
 };
 
 } // unnamed namespace
@@ -139,6 +160,9 @@ DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorFixedHeight",
 DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorShowDuration",             FLOAT,  INDICATOR_SHOW_DURATION   )
 DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHideDuration",             FLOAT,  INDICATOR_HIDE_DURATION   )
 DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervals",           ARRAY,  SCROLL_POSITION_INTERVALS )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorMinimumHeight",            FLOAT,  INDICATOR_MINIMUM_HEIGHT  )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorStartPadding",             FLOAT,  INDICATOR_START_PADDING   )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorEndPadding",               FLOAT,  INDICATOR_END_PADDING     )
 
 DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "panFinished",                       PAN_FINISHED_SIGNAL )
 DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "scrollPositionIntervalReached",     SCROLL_POSITION_INTERVAL_REACHED_SIGNAL )
@@ -165,6 +189,9 @@ ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction)
   mCurrentScrollPosition(0.0f),
   mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
   mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
+  mIndicatorMinimumHeight(DEFAULT_INDICATOR_MINIMUM_HEIGHT),
+  mIndicatorStartPadding(DEFAULT_INDICATOR_START_PADDING),
+  mIndicatorEndPadding(DEFAULT_INDICATOR_END_PADDING),
   mIsPanning(false),
   mIndicatorFirstShow(true)
 {
@@ -265,7 +292,8 @@ void ScrollBar::ApplyConstraints()
     }
     else
     {
-      mIndicatorSizeConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::SIZE, IndicatorSizeConstraint() );
+      mIndicatorSizeConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::SIZE,
+                                                           IndicatorSizeConstraint( mIndicatorMinimumHeight, mIndicatorStartPadding + mIndicatorEndPadding ) );
       mIndicatorSizeConstraint.AddSource( ParentSource( Actor::Property::SIZE ) );
       mIndicatorSizeConstraint.AddSource( Source( scrollableHandle, mPropertyScrollContentSize ) );
       mIndicatorSizeConstraint.Apply();
@@ -276,7 +304,8 @@ void ScrollBar::ApplyConstraints()
       mIndicatorPositionConstraint.Remove();
     }
 
-    mIndicatorPositionConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::POSITION, IndicatorPositionConstraint() );
+    mIndicatorPositionConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::POSITION,
+                                                             IndicatorPositionConstraint( mIndicatorStartPadding, mIndicatorEndPadding ) );
     mIndicatorPositionConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
     mIndicatorPositionConstraint.AddSource( ParentSource( Actor::Property::SIZE ) );
     mIndicatorPositionConstraint.AddSource( Source( scrollableHandle, mPropertyScrollPosition ) );
@@ -409,16 +438,18 @@ void ScrollBar::OnPan( const PanGesture& gesture )
       }
       case Gesture::Continuing:
       {
-        Vector3 delta(gesture.displacement.x, gesture.displacement.y, 0.0f);
-        mGestureDisplacement+=delta;
+        mGestureDisplacement.x += gesture.displacement.x;
+        mGestureDisplacement.y += gesture.displacement.y;
 
-        Vector3 span = Self().GetCurrentSize() - mIndicator.GetCurrentSize();
-        float minScrollPosition = scrollableHandle.GetProperty<float>(mPropertyMinScrollPosition);
-        float maxScrollPosition = scrollableHandle.GetProperty<float>(mPropertyMaxScrollPosition);
+        float minScrollPosition = scrollableHandle.GetProperty<float>( mPropertyMinScrollPosition );
+        float maxScrollPosition = scrollableHandle.GetProperty<float>( mPropertyMaxScrollPosition );
+
+        // The domain size is the internal range
         float domainSize = maxScrollPosition - minScrollPosition;
+        float logicalSize = Self().GetCurrentSize().y - ( mIndicator.GetCurrentSize().y + mIndicatorStartPadding + mIndicatorEndPadding );
 
-        mCurrentScrollPosition = mScrollStart - mGestureDisplacement.y * domainSize / span.y;
-        mCurrentScrollPosition = 0.0f - std::min(maxScrollPosition, std::max(-mCurrentScrollPosition, minScrollPosition));
+        mCurrentScrollPosition = mScrollStart - ( ( mGestureDisplacement.y * domainSize ) / logicalSize );
+        mCurrentScrollPosition = -std::min( maxScrollPosition, std::max( -mCurrentScrollPosition, minScrollPosition ) );
 
         break;
       }
@@ -474,8 +505,11 @@ Toolkit::ScrollBar::Direction ScrollBar::GetScrollDirection() const
 
 void ScrollBar::SetIndicatorHeightPolicy( Toolkit::ScrollBar::IndicatorHeightPolicy policy )
 {
-  mIndicatorHeightPolicy = policy;
-  ApplyConstraints();
+  if( policy != mIndicatorHeightPolicy )
+  {
+    mIndicatorHeightPolicy = policy;
+    ApplyConstraints();
+  }
 }
 
 Toolkit::ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy() const
@@ -627,6 +661,24 @@ void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT:
+      {
+        scrollBarImpl.mIndicatorMinimumHeight = value.Get<float>();
+        scrollBarImpl.ApplyConstraints();
+        break;
+      }
+      case Toolkit::ScrollBar::Property::INDICATOR_START_PADDING:
+      {
+        scrollBarImpl.mIndicatorStartPadding = value.Get<float>();
+        scrollBarImpl.ApplyConstraints();
+        break;
+      }
+      case Toolkit::ScrollBar::Property::INDICATOR_END_PADDING:
+      {
+        scrollBarImpl.mIndicatorEndPadding = value.Get<float>();
+        scrollBarImpl.ApplyConstraints();
+        break;
+      }
     }
   }
 }
@@ -683,6 +735,21 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
+      case Toolkit::ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT:
+      {
+        value = scrollBarImpl.mIndicatorMinimumHeight;
+        break;
+      }
+      case Toolkit::ScrollBar::Property::INDICATOR_START_PADDING:
+      {
+        value = scrollBarImpl.mIndicatorStartPadding;
+        break;
+      }
+      case Toolkit::ScrollBar::Property::INDICATOR_END_PADDING:
+      {
+        value = scrollBarImpl.mIndicatorEndPadding;
+        break;
+      }
     }
   }
   return value;
index ff9e07d..0826ef3 100755 (executable)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_INTERNAL_SCROLL_BAR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -269,28 +269,31 @@ private:
 
   Toolkit::ScrollBar::Direction mDirection;                          ///< The direction of scroll bar (vertical or horizontal)
 
-  WeakHandleBase mScrollableObject;                                      ///< Object to be scrolled
+  WeakHandleBase mScrollableObject;                                  ///< Object to be scrolled
 
   Property::Index mPropertyScrollPosition;                           ///< Index of scroll position property owned by the object to be scrolled
   Property::Index mPropertyMinScrollPosition;                        ///< Index of minimum scroll position property owned by the object to be scrolled
   Property::Index mPropertyMaxScrollPosition;                        ///< Index of maximum scroll position property owned by the object to be scrolled
   Property::Index mPropertyScrollContentSize;                        ///< Index of scroll content size property owned by the object to be scrolled
 
-  float mIndicatorShowDuration;                                     ///< The duration of scroll indicator show animation
-  float mIndicatorHideDuration;                                     ///< The duration of scroll indicator hide animation
+  float mIndicatorShowDuration;                                      ///< The duration of scroll indicator show animation
+  float mIndicatorHideDuration;                                      ///< The duration of scroll indicator hide animation
 
   float mScrollStart;                                                ///< Scroll Start position (start of drag)
   Vector3 mGestureDisplacement;                                      ///< Gesture Displacement.
 
-  float mCurrentScrollPosition;                                     ///< The current scroll position updated by the pan gesture
+  float mCurrentScrollPosition;                                      ///< The current scroll position updated by the pan gesture
 
   Toolkit::ScrollBar::IndicatorHeightPolicy mIndicatorHeightPolicy;  ///< The height policy of scroll indicator (variable or fixed)
-  float mIndicatorFixedHeight;                                      ///< The fixed height of scroll indicator
+  float mIndicatorFixedHeight;                                       ///< The fixed height of scroll indicator
+  float mIndicatorMinimumHeight;                                     ///< The minimum height for a variable size indicator
+  float mIndicatorStartPadding;                                      ///< The padding at the start of the indicator
+  float mIndicatorEndPadding;                                        ///< The padding at the end of the indicator
 
   Timer mContractDelayTimer;                                         ///< Timer guarantee contract delay time.
   Timer mPanProcessTimer;                                            ///< The timer to process the pan gesture after the gesture is started.
 
-  Dali::Vector<float> mScrollPositionIntervals;                     ///< List of values to receive notification for when the current scroll position goes above or below them
+  Dali::Vector<float> mScrollPositionIntervals;                      ///< List of values to receive notification for when the current scroll position goes above or below them
   PropertyNotification mPositionNotification;                        ///< Stores the property notification used for scroll position changes
 
   PanFinishedSignalType mPanFinishedSignal;
@@ -300,8 +303,8 @@ private:
   Constraint mIndicatorSizeConstraint;
   Constraint mScrollPositionInCurrentAxisConstraint;
 
-  bool mIsPanning          : 1;                                      ///< Whether the scroll bar is being panned.
-  bool mIndicatorFirstShow : 1;                                      ///< True if the indicator has never been shown
+  bool mIsPanning                 : 1;                               ///< Whether the scroll bar is being panned.
+  bool mIndicatorFirstShow        : 1;                               ///< True if the indicator has never been shown
 };
 
 } // namespace Internal
index ba2000b..2f13c17 100644 (file)
@@ -28,7 +28,7 @@
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
index 33dbe22..4cc2393 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index 70e5c11..e33c920 100644 (file)
@@ -18,7 +18,7 @@
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
index 28bae71..1191778 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/debug.h>
 
index cbbd166..5cc9b23 100755 (executable)
@@ -24,7 +24,7 @@
 #include <limits>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
index cb70e60..c987ea3 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/rendering/renderer.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
index bac0402..398b7ad 100644 (file)
@@ -22,7 +22,7 @@
 #include <sstream>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
@@ -31,20 +31,6 @@ using namespace Dali;
 
 namespace
 {
-/*
- * Custom properties for where to put the actor.
- *
- * When an actor is add to the tableView through Actor::Add() instead of TableView::AddChild,
- * the following custom properties of the actor are checked to decide the actor position inside the table
- *
- * These non-animatable properties should be registered to the child which would be added to the table
- */
-const char * const CELL_INDEX_PROPERTY_NAME("cellIndex");
-const char * const ROW_SPAN_PROPERTY_NAME("rowSpan");
-const char * const COLUMN_SPAN_PROPERTY_NAME("columnSpan");
-const char * const CELL_HORIZONTAL_ALIGNMENT_PROPERTY_NAME("cellHorizontalAlignment");
-const char * const CELL_VERTICAL_ALIGNMENT_PROPERTY_NAME("cellVerticalAlignment");
-
 /**
  * @brief Should the tableview fit around the given actor
  *
@@ -147,6 +133,11 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "columns",        INTEGER, COLUM
 DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cellPadding",    VECTOR2, CELL_PADDING   )
 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, "cellHorizontalAlignment",  STRING,  CELL_HORIZONTAL_ALIGNMENT )
+DALI_CHILD_PROPERTY_REGISTRATION( Toolkit, TableView, "cellVerticalAlignment",    STRING,  CELL_VERTICAL_ALIGNMENT   )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -978,41 +969,42 @@ void TableView::OnChildAdd( Actor& child )
     return;
   }
 
-  // Test properties on actor
+  // Check child properties on actor to decide its position inside the table
   HorizontalAlignment::Type horizontalAlignment = HorizontalAlignment::LEFT;
   VerticalAlignment::Type verticalAlignment = VerticalAlignment::TOP;
-  if( child.GetPropertyIndex( CELL_HORIZONTAL_ALIGNMENT_PROPERTY_NAME ) != Property::INVALID_INDEX )
+
+  if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ) != Property::NONE )
   {
-    std::string value = child.GetProperty( child.GetPropertyIndex(CELL_HORIZONTAL_ALIGNMENT_PROPERTY_NAME) ).Get<std::string >();
+    std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ).Get<std::string >();
     Scripting::GetEnumeration< HorizontalAlignment::Type >( value.c_str(),
                                                             HORIZONTAL_ALIGNMENT_STRING_TABLE,
                                                             HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
                                                             horizontalAlignment );
   }
-  if( child.GetPropertyIndex( CELL_VERTICAL_ALIGNMENT_PROPERTY_NAME ) != Property::INVALID_INDEX )
+
+  if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ) != Property::NONE )
   {
-    std::string value = child.GetProperty( child.GetPropertyIndex(CELL_VERTICAL_ALIGNMENT_PROPERTY_NAME) ).Get<std::string >();
+    std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ).Get<std::string >();
     Scripting::GetEnumeration< VerticalAlignment::Type >( value.c_str(),
                                                           VERTICAL_ALIGNMENT_STRING_TABLE,
                                                           VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
                                                           verticalAlignment );
   }
 
-
   Toolkit::TableView::CellPosition cellPosition;
-  if( child.GetPropertyIndex(ROW_SPAN_PROPERTY_NAME) != Property::INVALID_INDEX )
+  if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
   {
-    cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( child.GetPropertyIndex(ROW_SPAN_PROPERTY_NAME) ).Get<float>() );
+    cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
   }
 
-  if( child.GetPropertyIndex(COLUMN_SPAN_PROPERTY_NAME) != Property::INVALID_INDEX )
+  if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
   {
-    cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( child.GetPropertyIndex(COLUMN_SPAN_PROPERTY_NAME) ).Get<float>() );
+    cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
   }
 
-  if( child.GetPropertyIndex(CELL_INDEX_PROPERTY_NAME) != Property::INVALID_INDEX )
+  if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
   {
-    Vector2 indices = child.GetProperty( child.GetPropertyIndex(CELL_INDEX_PROPERTY_NAME) ).Get<Vector2 >();
+    Vector2 indices = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_INDEX ).Get<Vector2 >();
     cellPosition.rowIndex = static_cast<unsigned int>( indices.x );
     cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
 
index 660e823..57a66ca 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index efec327..f88dcb7 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index e7bac78..cefe7ad 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -28,6 +28,7 @@
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
 #include <dali-toolkit/internal/text/text-font-style.h>
 #include <dali-toolkit/internal/text/text-view.h>
+#include <dali-toolkit/internal/text/text-definitions.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 
 using Dali::Toolkit::Text::LayoutEngine;
@@ -50,8 +51,8 @@ namespace
 namespace
 {
 
-#if defined(DEBUG_ENABLED)
-  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
+#if defined ( DEBUG_ENABLED )
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_CONTROLS");
 #endif
 
 const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] =
@@ -79,24 +80,30 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend",     INTEGER, RENDERING_BACKEND    )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text",                 STRING,  TEXT                 )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily",           STRING,  FONT_FAMILY          )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle",            STRING,  FONT_STYLE           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize",            FLOAT,   POINT_SIZE           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine",            BOOLEAN, MULTI_LINE           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment",  STRING,  HORIZONTAL_ALIGNMENT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment",    STRING,  VERTICAL_ALIGNMENT   )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textColor",            VECTOR4, TEXT_COLOR           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset",         VECTOR2, SHADOW_OFFSET        )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor",          VECTOR4, SHADOW_COLOR         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled",     BOOLEAN, UNDERLINE_ENABLED    )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor",       VECTOR4, UNDERLINE_COLOR      )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight",      FLOAT,   UNDERLINE_HEIGHT     )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup",         BOOLEAN, ENABLE_MARKUP        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend",     INTEGER, RENDERING_BACKEND      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text",                 STRING,  TEXT                   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily",           STRING,  FONT_FAMILY            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle",            STRING,  FONT_STYLE             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize",            FLOAT,   POINT_SIZE             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine",            BOOLEAN, MULTI_LINE             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment",  STRING,  HORIZONTAL_ALIGNMENT   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment",    STRING,  VERTICAL_ALIGNMENT     )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textColor",            VECTOR4, TEXT_COLOR             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset",         VECTOR2, SHADOW_OFFSET          )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor",          VECTOR4, SHADOW_COLOR           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled",     BOOLEAN, UNDERLINE_ENABLED      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor",       VECTOR4, UNDERLINE_COLOR        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight",      FLOAT,   UNDERLINE_HEIGHT       )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup",         BOOLEAN, ENABLE_MARKUP          )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableAutoScroll",     BOOLEAN, ENABLE_AUTO_SCROLL     )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed",      INTEGER, AUTO_SCROLL_SPEED      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount",  INTEGER, AUTO_SCROLL_LOOP_COUNT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap",        FLOAT,   AUTO_SCROLL_GAP        )
 
 DALI_TYPE_REGISTRATION_END()
 
+
+
 } // namespace
 
 Toolkit::TextLabel TextLabel::New()
@@ -161,7 +168,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         {
           const std::string fontFamily = value.Get< std::string >();
 
-          DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
           impl.mController->SetDefaultFontFamily( fontFamily );
         }
         break;
@@ -312,6 +319,59 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
+      {
+        if( impl.mController )
+        {
+          const bool enableAutoScroll = value.Get<bool>();
+          // If request to auto scroll is the same as current state then do nothing.
+          if ( enableAutoScroll != impl.mController->IsAutoScrollEnabled() )
+          {
+             // If request is disable (false) and auto scrolling is enabled then need to stop it
+             if ( enableAutoScroll == false )
+             {
+               if( impl.mTextScroller )
+               {
+                 impl.mTextScroller->SetLoopCount( 0 ); // Causes the current animation to finish playing (0)
+               }
+             }
+             // If request is enable (true) then start autoscroll as not already running
+             else
+             {
+               impl.mController->GetLayoutEngine().SetTextEllipsisEnabled( false );
+               impl.mController->SetAutoScrollEnabled( enableAutoScroll );
+             }
+          }
+        }
+        break;
+      }
+      case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
+      {
+        if( !impl.mTextScroller )
+        {
+          impl.mTextScroller = Text::TextScroller::New( impl );
+        }
+        impl.mTextScroller->SetSpeed( value.Get<int>() );
+        break;
+      }
+      case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
+      {
+        if( !impl.mTextScroller )
+        {
+          impl.mTextScroller = Text::TextScroller::New( impl );
+        }
+        impl.mTextScroller->SetLoopCount( value.Get<int>() );
+        break;
+      }
+      case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
+      {
+        if( !impl.mTextScroller )
+        {
+          impl.mTextScroller = Text::TextScroller::New( impl );
+        }
+        impl.mTextScroller->SetGap( value.Get<float>() );
+        break;
+      }
     }
   }
 }
@@ -455,6 +515,44 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
+      case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
+      {
+        if( impl.mController )
+        {
+          value = impl.mController->IsAutoScrollEnabled();
+        }
+        break;
+      }
+      case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
+      {
+        TextLabel& impl( GetImpl( label ) );
+        if ( impl.mTextScroller )
+        {
+          value = impl.mTextScroller->GetSpeed();
+        }
+        break;
+      }
+      case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
+      {
+        if( impl.mController )
+        {
+          TextLabel& impl( GetImpl( label ) );
+          if ( impl.mTextScroller )
+          {
+            value = impl.mTextScroller->GetLoopCount();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
+      {
+        TextLabel& impl( GetImpl( label ) );
+        if ( impl.mTextScroller )
+        {
+          value = impl.mTextScroller->GetGap();
+        }
+        break;
+      }
     }
   }
 
@@ -478,7 +576,7 @@ void TextLabel::OnInitialize()
   // Enable the text ellipsis.
   LayoutEngine& engine = mController->GetLayoutEngine();
 
-  engine.SetTextEllipsisEnabled( true );
+  engine.SetTextEllipsisEnabled( true );   // If false then text larger than control will overflow
   engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
 
   self.OnStageSignal().Connect( this, &TextLabel::OnStageConnect );
@@ -530,6 +628,8 @@ float TextLabel::GetHeightForWidth( float width )
 
 void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnRelayout\n" );
+
   if( mController->Relayout( size ) ||
       !mRenderer )
   {
@@ -548,8 +648,11 @@ void TextLabel::RequestTextRelayout()
 
 void TextLabel::RenderText()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::RenderText IsAutoScrollEnabled[%s] [%p]\n", ( mController->IsAutoScrollEnabled())?"true":"false", this );
+
   Actor self = Self();
   Actor renderableActor;
+
   if( mRenderer )
   {
     renderableActor = mRenderer->Render( mController->GetView(), DepthIndex::TEXT );
@@ -568,9 +671,38 @@ void TextLabel::RenderText()
       self.Add( renderableActor );
     }
     mRenderableActor = renderableActor;
+
+    if ( mController->IsAutoScrollEnabled() )
+    {
+      SetUpAutoScrolling();
+    }
   }
 }
 
+void TextLabel::SetUpAutoScrolling()
+{
+  const Size& controlSize = mController->GetView().GetControlSize();
+  const Size offScreenSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
+  const Vector2& alignmentOffset = mController->GetAlignmentOffset();
+  const Text::CharacterDirection direction = mController->GetAutoScrollDirection();
+
+  DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling alignmentOffset[%f,%f] offScreenSize[%f,%f] controlSize[%f,%f]\n",
+                 alignmentOffset.x, alignmentOffset.y, offScreenSize.x,offScreenSize.y , controlSize.x,controlSize.y);
+
+  if ( !mTextScroller )
+  {
+    DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling Creating default TextScoller\n");
+
+    // If speed, loopCount or gap not set via property system then will need to create a TextScroller with defaults
+    mTextScroller = Text::TextScroller::New( *this );
+  }
+  mTextScroller->SetParameters( mRenderableActor, controlSize, offScreenSize, direction, alignmentOffset );
+
+  Actor self = Self();
+  self.Add( mTextScroller->GetScrollingText() );
+  self.Add( mTextScroller->GetSourceCamera() );
+}
+
 void TextLabel::OnStageConnect( Dali::Actor actor )
 {
   if ( mHasBeenStaged )
@@ -606,6 +738,15 @@ void TextLabel::MaxLengthReached()
   // Pure Virtual from TextController Interface, only needed when inputting text
 }
 
+void TextLabel::ScrollingFinished()
+{
+  // Pure Virtual from TextScroller Interface
+  DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::ScrollingFinished\n");
+  mController->SetAutoScrollEnabled( false );
+  mController->GetLayoutEngine().SetTextEllipsisEnabled( true );
+  RequestTextRelayout();
+}
+
 TextLabel::TextLabel()
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
index ae88beb..c2dd485 100644 (file)
@@ -22,7 +22,9 @@
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/text-scroller-interface.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
+#include <dali-toolkit/internal/text/text-scroller.h>
 
 namespace Dali
 {
@@ -36,7 +38,7 @@ namespace Internal
 /**
  * @brief A control which renders a short text string.
  */
-class TextLabel : public Control, public Text::ControlInterface
+class TextLabel : public Control, public Text::ControlInterface, public Text::ScrollerInterface
 {
 public:
 
@@ -117,6 +119,13 @@ private: // From Control
    */
   virtual void MaxLengthReached();
 
+private: // from TextScroller
+
+  /**
+   * @copydoc Text::ScrollerInterface::ScrollingFinished()
+   */
+  virtual void ScrollingFinished();
+
 private: // Implementation
 
   /**
@@ -143,10 +152,16 @@ private:
    */
   void RenderText();
 
+  /**
+   * @brief Set up Autoscrolling
+   */
+  void SetUpAutoScrolling();
+
 private: // Data
 
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
+  Text::TextScrollerPtr mTextScroller;
   Actor mRenderableActor;
   int mRenderingBackend;
   bool mHasBeenStaged:1;
index 1f8302a..1633dc9 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
 #include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index b010199..b87dab2 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
 #include <dali/public-api/object/property-map.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
index 4cb2ec6..46509da 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
index e02dbc1..184f37a 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/internal/feedback/feedback-style.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/object-registry.h>
index cd24d24..d043b79 100644 (file)
@@ -106,6 +106,8 @@ toolkit_src_files = \
    $(toolkit_src_dir)/text/text-controller-impl.cpp \
    $(toolkit_src_dir)/text/text-font-style.cpp \
    $(toolkit_src_dir)/text/text-io.cpp \
+   $(toolkit_src_dir)/text/text-scroller.cpp \
+   $(toolkit_src_dir)/text/text-scroller-interface.cpp \
    $(toolkit_src_dir)/text/text-view.cpp \
    $(toolkit_src_dir)/text/text-view-interface.cpp \
    $(toolkit_src_dir)/text/visual-model-impl.cpp \
index 7466ed2..4605cd7 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/integration-api/debug.h>
 
index 9f5d27a..cdcc8e2 100644 (file)
@@ -228,23 +228,24 @@ void KeyInputFocusManager::OnObjectDestroyed( const Dali::RefObject* object )
 
 bool KeyInputFocusManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
-  Dali::BaseHandle handle( object );
-
   bool connected( true );
   KeyInputFocusManager* manager = dynamic_cast<KeyInputFocusManager*>( object );
 
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED ) )
-  {
-    manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_UNHANDLED_KEY_EVENT ) )
-  {
-    manager->UnhandledKeyEventSignal().Connect( tracker, functor );
-  }
-  else
+  if( manager )
   {
-    // signalName does not match any signal
-    connected = false;
+    if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED ) )
+    {
+      manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_UNHANDLED_KEY_EVENT ) )
+    {
+      manager->UnhandledKeyEventSignal().Connect( tracker, functor );
+    }
+    else
+    {
+      // signalName does not match any signal
+      connected = false;
+    }
   }
 
   return connected;
index a550a11..71baa96 100644 (file)
@@ -20,7 +20,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/singleton-service.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index a5da5a4..ac9110e 100644 (file)
@@ -1242,11 +1242,13 @@ void LayoutEngine::SetLayout( Layout layout )
 
 LayoutEngine::Layout LayoutEngine::GetLayout() const
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GetLayout[%d]\n", mImpl->mLayout);
   return mImpl->mLayout;
 }
 
 void LayoutEngine::SetTextEllipsisEnabled( bool enabled )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "-->LayoutEngine::SetTextEllipsisEnabled[%s]\n", (enabled)?"true":"false" );
   mImpl->mEllipsisEnabled = enabled;
 }
 
index 2db0faa..32ab39b 100644 (file)
@@ -38,7 +38,7 @@ using namespace Dali::Toolkit::Text;
 namespace
 {
 #if defined(DEBUG_ENABLED)
-  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_RENDERING");
 #endif
 
 const float ZERO( 0.0f );
@@ -433,6 +433,9 @@ struct AtlasRenderer::Impl
             renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, depthIndex - 1 );
             containerActor.Add( shadowActor );
             containerActor.Add( actor );
+#if defined(DEBUG_ENABLED)
+            containerActor.SetName("TextContainer");
+#endif
             actor = containerActor;
           }
         }
@@ -504,7 +507,6 @@ struct AtlasRenderer::Impl
     // Keep all of the origins aligned
     actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
     actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-
     actor.SetSize( actorSize );
     actor.RegisterProperty("uOffset", Vector2::ZERO );
     return actor;
@@ -738,6 +740,8 @@ Text::RendererPtr AtlasRenderer::New()
 
 Actor AtlasRenderer::Render( Text::ViewInterface& view, int depth )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "Text::AtlasRenderer::Render()\n" );
+
   UnparentAndReset( mImpl->mActor );
 
   Length numberOfGlyphs = view.GetNumberOfGlyphs();
index ce8a291..5c1ed0c 100644 (file)
@@ -301,7 +301,9 @@ struct Controller::Impl
     mMaximumNumberOfCharacters( 50u ),
     mRecalculateNaturalSize( true ),
     mMarkupProcessorEnabled( false ),
-    mClipboardHideEnabled( true )
+    mClipboardHideEnabled( true ),
+    mAutoScrollEnabled( false ),
+    mAutoScrollDirectionRTL( false )
   {
     mLogicalModel = LogicalModel::New();
     mVisualModel  = VisualModel::New();
@@ -658,7 +660,10 @@ public:
 
   bool mRecalculateNaturalSize:1;          ///< Whether the natural size needs to be recalculated.
   bool mMarkupProcessorEnabled:1;          ///< Whether the mark-up procesor is enabled.
-  bool mClipboardHideEnabled:1;           ///< Whether the ClipboardHide function work or not
+  bool mClipboardHideEnabled:1;            ///< Whether the ClipboardHide function work or not
+  bool mAutoScrollEnabled:1;               ///< Whether auto text scrolling is enabled.
+  CharacterDirection mAutoScrollDirectionRTL:1;  ///< Direction of auto scrolling, true if rtl
+
 };
 
 } // namespace Text
index 3a211e1..268519b 100644 (file)
@@ -132,6 +132,55 @@ bool Controller::IsMarkupProcessorEnabled() const
   return mImpl->mMarkupProcessorEnabled;
 }
 
+void Controller::SetAutoScrollEnabled( bool enable )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled[%s] SingleBox[%s]-> [%p]\n", (enable)?"true":"false", ( mImpl->mLayoutEngine.GetLayout() == LayoutEngine::SINGLE_LINE_BOX)?"true":"false", this );
+
+  if ( mImpl->mLayoutEngine.GetLayout() == LayoutEngine::SINGLE_LINE_BOX )
+  {
+    if ( enable )
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled for SINGLE_LINE_BOX\n" );
+      mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
+                                                               LAYOUT                    |
+                                                               ALIGN                     |
+                                                               UPDATE_ACTUAL_SIZE        |
+                                                               UPDATE_DIRECTION          |
+                                                               REORDER );
+
+    }
+    else
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled Disabling autoscroll\n");
+      mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
+                                                               LAYOUT                    |
+                                                               ALIGN                     |
+                                                               UPDATE_ACTUAL_SIZE        |
+                                                               REORDER );
+    }
+
+    mImpl->mAutoScrollEnabled = enable;
+    mImpl->RequestRelayout();
+  }
+  else
+  {
+    DALI_LOG_WARNING( "Attempted AutoScrolling on a non SINGLE_LINE_BOX, request ignored" );
+    mImpl->mAutoScrollEnabled = false;
+  }
+}
+
+bool Controller::IsAutoScrollEnabled() const
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::IsAutoScrollEnabled[%s]\n", (mImpl->mAutoScrollEnabled)?"true":"false" );
+
+  return mImpl->mAutoScrollEnabled;
+}
+
+CharacterDirection Controller::GetAutoScrollDirection() const
+{
+  return mImpl->mAutoScrollDirectionRTL;
+}
+
 void Controller::SetText( const std::string& text )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" );
@@ -473,7 +522,7 @@ float Controller::GetDefaultPointSize() const
 
 void Controller::UpdateAfterFontChange( const std::string& newDefaultFont )
 {
-  DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange");
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::UpdateAfterFontChange");
 
   if( !mImpl->mFontDefaults->familyDefined ) // If user defined font then should not update when system font changes
   {
@@ -1063,8 +1112,8 @@ Vector3 Controller::GetNaturalSize()
     mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
     mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mLogicalModel->mText.Count();
 
-    // Store the actual control's width.
-    const float actualControlWidth = mImpl->mVisualModel->mControlSize.width;
+    // Store the actual control's size to restore later.
+    const Size actualControlSize = mImpl->mVisualModel->mControlSize;
 
     DoRelayout( Size( MAX_FLOAT, MAX_FLOAT ),
                 static_cast<OperationsMask>( onlyOnceOperations |
@@ -1089,8 +1138,8 @@ Vector3 Controller::GetNaturalSize()
     // Clear the update info. This info will be set the next time the text is updated.
     mImpl->mTextUpdateInfo.Clear();
 
-    // Restore the actual control's width.
-    mImpl->mVisualModel->mControlSize.width = actualControlWidth;
+    // Restore the actual control's size.
+    mImpl->mVisualModel->mControlSize = actualControlSize;
 
     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z );
   }
@@ -1173,7 +1222,7 @@ float Controller::GetHeightForWidth( float width )
 
 bool Controller::Relayout( const Size& size )
 {
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f\n", this, size.width, size.height );
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", this, size.width, size.height, (mImpl->mAutoScrollEnabled)?"true":"false"  );
 
   if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
   {
@@ -1432,6 +1481,8 @@ bool Controller::DoRelayout( const Size& size,
 
   if( NO_OPERATION != ( LAYOUT & operations ) )
   {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::DoRelayout LAYOUT & operations\n");
+
     // Some vectors with data needed to layout and reorder may be void
     // after the first time the text has been laid out.
     // Fill the vectors again.
@@ -1500,8 +1551,14 @@ bool Controller::DoRelayout( const Size& size,
                                                    mImpl->mVisualModel->mLines,
                                                    layoutSize );
 
+
     if( viewUpdated )
     {
+      if ( NO_OPERATION != ( UPDATE_DIRECTION & operations ) )
+      {
+        mImpl->mAutoScrollDirectionRTL = false;
+      }
+
       // Reorder the lines
       if( NO_OPERATION != ( REORDER & operations ) )
       {
@@ -1532,6 +1589,14 @@ bool Controller::DoRelayout( const Size& size,
                                                          requestedNumberOfCharacters,
                                                          glyphPositions );
 
+          if ( ( NO_OPERATION != ( UPDATE_DIRECTION & operations ) ) && ( numberOfLines > 0 ) )
+          {
+            const LineRun* const firstline = mImpl->mVisualModel->mLines.Begin();
+            if ( firstline )
+            {
+              mImpl->mAutoScrollDirectionRTL = firstline->direction;
+            }
+          }
         }
       } // REORDER
 
@@ -1562,7 +1627,11 @@ bool Controller::DoRelayout( const Size& size,
 
     viewUpdated = true;
   }
-
+#if defined(DEBUG_ENABLED)
+  std::string currentText;
+  GetText( currentText );
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::DoRelayout [%p] mImpl->mAutoScrollDirectionRTL[%s] [%s]\n", this, (mImpl->mAutoScrollDirectionRTL)?"true":"false",  currentText.c_str() );
+#endif
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::DoRelayout, view updated %s\n", ( viewUpdated ? "true" : "false" ) );
   return viewUpdated;
 }
index 6a83374..5a96349 100644 (file)
@@ -86,6 +86,7 @@ public:
     REORDER            = 0x0400,
     ALIGN              = 0x0800,
     COLOR              = 0x1000,
+    UPDATE_DIRECTION   = 0x2000,
     ALL_OPERATIONS     = 0xFFFF
   };
 
@@ -149,6 +150,30 @@ public:
   bool IsMarkupProcessorEnabled() const;
 
   /**
+   * @brief Enables/disables the auto text scrolling
+   *
+   * By default is disabled.
+   *
+   * @param[in] enable Whether to enable the auto scrolling
+   */
+  void SetAutoScrollEnabled( bool enable );
+
+  /**
+   * @brief Retrieves whether auto text scrolling is enabled.
+   *
+   * By default is disabled.
+   *
+   * @return @e true if auto scrolling is enabled, otherwise returns @e false.
+   */
+  bool IsAutoScrollEnabled() const;
+
+  /**
+   * @brief Get direction of the text from the first line of text,
+   * @return bool rtl (right to left) is true
+   */
+  CharacterDirection GetAutoScrollDirection() const;
+
+  /**
    * @brief Replaces any text previously set.
    *
    * @note This will be converted into UTF-32 when stored in the text model.
diff --git a/dali-toolkit/internal/text/text-scroller-interface.cpp b/dali-toolkit/internal/text/text-scroller-interface.cpp
new file mode 100644 (file)
index 0000000..ee85ef9
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/text-scroller-interface.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+ScrollerInterface::ScrollerInterface()
+{
+}
+
+ScrollerInterface::~ScrollerInterface()
+{
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/text/text-scroller-interface.h b/dali-toolkit/internal/text/text-scroller-interface.h
new file mode 100644 (file)
index 0000000..31a0819
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef __DALI_TOOLKIT_TEXT_SCROLLER_INTERFACE_H__
+#define __DALI_TOOLKIT_TEXT_SCROLLER_INTERFACE_H__
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+class Actor;
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief An interface used by the text-controls which implement auto-scrolling
+ */
+class ScrollerInterface
+{
+public:
+
+  /**
+   * @brief Constructor.
+   */
+  ScrollerInterface();
+
+  /**
+   * @brief Virtual destructor.
+   */
+  virtual ~ScrollerInterface();
+
+  /**
+   * @brief Called when the scrolling finishes
+   */
+  virtual void ScrollingFinished() = 0;
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_SCROLLER_INTERFACE_H__
diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp
new file mode 100644 (file)
index 0000000..a8180fc
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/text-scroller.h>
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/rendering/geometry.h>
+#include <dali/devel-api/rendering/renderer.h>
+#include <dali/devel-api/rendering/sampler.h>
+#include <dali/devel-api/rendering/shader.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/images/frame-buffer-image.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/text-scroller-interface.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace
+{
+
+#if defined ( DEBUG_ENABLED )
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_SCROLLING");
+#endif
+
+const int MINIMUM_SCROLL_SPEED = 1; // Speed should be set by Property system.
+
+const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  varying highp vec2 vTexCoord;\n
+  varying highp float vRatio;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  uniform mediump float uDelta;\n
+  uniform mediump vec2 uTextureSize;
+  uniform mediump float uGap;\n
+  uniform mediump float uRtl;\n
+  \n
+  void main()\n
+  {\n
+    {\n
+      mediump vec4 vertexPosition = vec4(aPosition*uSize.xy, 0.0, 1.0);\n
+      float smallTextPadding = max(uSize.x - uTextureSize.x, 0. );\n
+      float gap = max( uGap, smallTextPadding );\n
+      vTexCoord.x = ( uDelta + ( uRtl * ( uTextureSize.x - uSize.x ) )  + ( aPosition.x * uSize.x ) )/ ( uTextureSize.x+gap );\n
+      vTexCoord.y = aPosition.y;\n
+      vRatio = uTextureSize.x / ( uTextureSize.x + gap );\n
+      gl_Position = uMvpMatrix * vertexPosition;\n
+    }\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vTexCoord;\n
+  varying highp float vRatio;\n
+  uniform sampler2D sTexture;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec2 texCoord;\n
+    texCoord.y = vTexCoord.y;\n
+    texCoord.x = fract( vTexCoord.x ) / vRatio;\n
+    if ( texCoord.x > 1.0 )\n
+      discard;\n
+    \n
+    gl_FragColor = texture2D( sTexture, texCoord );\n
+  }\n
+);
+
+/**
+ * @brief Create and set up a camera for the render task to use
+ *
+ * @param[in] sizeOfTarget size of the source camera to look at
+ * @param[out] offscreenCamera custom camera
+ */
+void CreateCameraActor( const Size& sizeOfTarget, CameraActor& offscreenCamera )
+{
+  offscreenCamera = CameraActor::New();
+  offscreenCamera.SetOrthographicProjection( sizeOfTarget );
+  offscreenCamera.SetInvertYAxis( true );
+}
+
+/**
+ * @brief Create a render task
+ *
+ * @param[in] sourceActor actor to be used as source
+ * @param[in] cameraActor camera looking at source
+ * @param[in] offscreenTarget resulting image from render task
+ * @param[out] renderTask render task that has been setup
+ */
+void CreateRenderTask( Actor sourceActor, CameraActor cameraActor , FrameBufferImage offscreenTarget, RenderTask& renderTask )
+{
+  Stage stage = Stage::GetCurrent();
+  RenderTaskList taskList = stage.GetRenderTaskList();
+  renderTask = taskList.CreateTask();
+  renderTask.SetSourceActor( sourceActor );
+  renderTask.SetExclusive( true );
+  renderTask.SetInputEnabled( false );
+  renderTask.SetClearEnabled( true );
+  renderTask.SetCameraActor( cameraActor );
+  renderTask.SetTargetFrameBuffer( offscreenTarget );
+  renderTask.SetClearColor( Color::TRANSPARENT );
+  renderTask.SetCullMode( false );
+}
+
+/**
+ * @brief Create quad geometry for the mesh
+ *
+ * @param[out] geometry quad geometry that can be used for a mesh
+ */
+void CreateGeometry( Geometry& geometry )
+{
+  struct QuadVertex { Vector2 position;  };
+
+  QuadVertex quadVertexData[4] =
+  {
+      { Vector2( 0.0f, 0.0f) },
+      { Vector2( 1.0f, 0.0f) },
+      { Vector2( 0.0f, 1.0f) },
+      { Vector2( 1.0f, 1.0f) },
+  };
+
+  const unsigned short indices[6] =
+  {
+     3,1,0,0,2,3
+  };
+
+  Property::Map quadVertexFormat;
+  quadVertexFormat["aPosition"] = Property::VECTOR2;
+  PropertyBuffer quadVertices = PropertyBuffer::New( quadVertexFormat );
+  quadVertices.SetData(quadVertexData, 4 );
+
+  geometry = Geometry::New();
+  geometry.AddVertexBuffer( quadVertices );
+  geometry.SetIndexBuffer( indices, sizeof(indices)/sizeof(indices[0]) );
+}
+
+
+/**
+ * @brief Create a renderer
+ *
+ * @param[in] frameBufferImage texture to be used
+ * @param[out] renderer mesh renderer using the supplied texture
+ */
+void CreateRenderer( FrameBufferImage frameBufferImage, Dali::Renderer& renderer )
+{
+  Shader shader = Shader::New( VERTEX_SHADER_SCROLL , FRAGMENT_SHADER, Shader::HINT_NONE );
+
+  Sampler sampler = Sampler::New();
+  sampler.SetFilterMode(FilterMode::NEAREST, FilterMode::NEAREST );
+
+  TextureSet textureSet = TextureSet::New();
+  textureSet.SetImage( 0u, frameBufferImage );
+  textureSet.SetSampler( 0u, sampler );
+
+  Geometry meshGeometry;
+  CreateGeometry( meshGeometry );
+
+  renderer = Renderer::New( meshGeometry, shader );
+  renderer.SetTextures( textureSet );
+}
+
+} // namespace
+
+namespace Text
+{
+
+TextScrollerPtr TextScroller::New( ScrollerInterface& scrollerInterface )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::New\n" );
+
+  TextScrollerPtr textScroller( new TextScroller( scrollerInterface) );
+  return textScroller;
+}
+
+void TextScroller::SetGap( int gap )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetGap gap[%d]\n", gap );
+  mWrapGap = gap;
+}
+
+int TextScroller::GetGap() const
+{
+  return mWrapGap;
+}
+
+void TextScroller::SetSpeed( int scrollSpeed )
+{
+  mScrollSpeed = std::max( MINIMUM_SCROLL_SPEED, scrollSpeed );
+}
+
+int TextScroller::GetSpeed() const
+{
+  return mScrollSpeed;
+}
+
+void TextScroller::SetLoopCount( int loopCount )
+{
+  if ( loopCount > 0 )
+  {
+    mLoopCount = loopCount;
+  }
+
+  if (  mScrollAnimation && mScrollAnimation.GetState() == Animation::PLAYING )
+  {
+    if ( loopCount == 0 ) // Request to stop looping
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetLoopCount Single loop forced\n" );
+      mScrollAnimation.SetLoopCount( 1 ); // As animation already playing this allows the current animation to finish instead of trying to stop mid-way
+    }
+  }
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetLoopCount [%d] Status[%s]\n", mLoopCount, (loopCount)?"looping":"stop" );
+}
+
+int TextScroller::GetLoopCount() const
+{
+  return mLoopCount;
+}
+
+Actor TextScroller::GetSourceCamera() const
+{
+  return mOffscreenCameraActor;
+}
+
+Actor TextScroller::GetScrollingText() const
+{
+  return mScrollingTextActor;
+}
+
+TextScroller::TextScroller( ScrollerInterface& scrollerInterface ) : mScrollerInterface( scrollerInterface ),
+                            mScrollDeltaIndex( Property::INVALID_INDEX ),
+                            mScrollSpeed( MINIMUM_SCROLL_SPEED ),
+                            mLoopCount( 1 ),
+                            mWrapGap( 0 )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n" );
+}
+
+TextScroller::~TextScroller()
+{
+  CleanUp();
+}
+
+void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, const Vector2 alignmentOffset )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters controlSize[%f,%f] offscreenSize[%f,%f] direction[%d] alignmentOffset[%f,%f]\n",
+                 controlSize.x, controlSize.y, offScreenSize.x, offScreenSize.y, direction, alignmentOffset.x, alignmentOffset.y );
+
+  FrameBufferImage offscreenRenderTargetForText = FrameBufferImage::New( offScreenSize.width, offScreenSize.height, Pixel::RGBA8888, Dali::Image::UNUSED );
+  Renderer renderer;
+
+  CreateCameraActor( offScreenSize, mOffscreenCameraActor );
+  CreateRenderer( offscreenRenderTargetForText, renderer );
+  CreateRenderTask( sourceActor, mOffscreenCameraActor, offscreenRenderTargetForText, mRenderTask );
+
+  // Reposition camera to match alignment of target, RTL text has direction=true
+  if ( direction )
+  {
+    mOffscreenCameraActor.SetX( alignmentOffset.x + offScreenSize.width*0.5f );
+  }
+  else
+  {
+    mOffscreenCameraActor.SetX( offScreenSize.width * 0.5f );
+  }
+
+  mOffscreenCameraActor.SetY( offScreenSize.height * 0.5f );
+
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%d]\n", mWrapGap )
+
+  mScrollingTextActor = Actor::New();
+  mScrollingTextActor.AddRenderer( renderer );
+  mScrollingTextActor.RegisterProperty( "uTextureSize", offScreenSize );
+  mScrollingTextActor.RegisterProperty( "uRtl", ((direction)?1.0f:0.0f) );
+  mScrollingTextActor.RegisterProperty( "uGap", mWrapGap );
+  mScrollingTextActor.SetSize( controlSize.width, std::min( offScreenSize.height, controlSize.height ) );
+  mScrollDeltaIndex = mScrollingTextActor.RegisterProperty( "uDelta", 0.0f );
+
+  float scrollAmount = std::max( offScreenSize.width + mWrapGap, controlSize.width );
+  float scrollDuration =  scrollAmount / mScrollSpeed;
+
+  if ( direction  )
+  {
+     scrollAmount = -scrollAmount; // reverse direction of scrollung
+  }
+
+  StartScrolling( scrollAmount, scrollDuration, mLoopCount );
+}
+
+void TextScroller::AutoScrollAnimationFinished( Dali::Animation& animation )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::AutoScrollAnimationFinished\n" );
+  CleanUp();
+  mScrollerInterface.ScrollingFinished();
+}
+
+void TextScroller::StartScrolling( float scrollAmount, float scrollDuration, int loopCount )
+{
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::StartScrolling scrollAmount[%f] scrollDuration[%f], loop[%d] speed[%d]\n", scrollAmount, scrollDuration, loopCount, mScrollSpeed );
+
+  mScrollAnimation = Animation::New( scrollDuration );
+  mScrollAnimation.AnimateTo( Property( mScrollingTextActor, mScrollDeltaIndex ), scrollAmount );
+  mScrollAnimation.SetEndAction( Animation::Discard );
+  mScrollAnimation.SetLoopCount( loopCount );
+  mScrollAnimation.FinishedSignal().Connect( this, &TextScroller::AutoScrollAnimationFinished );
+  mScrollAnimation.Play();
+}
+
+void TextScroller::CleanUp()
+{
+  if ( Stage::IsInstalled() )
+  {
+    Stage stage = Stage::GetCurrent();
+    RenderTaskList taskList = stage.GetRenderTaskList();
+    UnparentAndReset( mScrollingTextActor );
+    UnparentAndReset( mOffscreenCameraActor );
+    taskList.RemoveTask( mRenderTask );
+  }
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/text/text-scroller.h b/dali-toolkit/internal/text/text-scroller.h
new file mode 100644 (file)
index 0000000..d4f92b9
--- /dev/null
@@ -0,0 +1,177 @@
+#ifndef __DALI_TOOLKIT_TEXT_SCROLLER_H__
+#define __DALI_TOOLKIT_TEXT_SCROLLER_H__
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/render-tasks/render-task.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/text-definitions.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+class TextScroller;
+class ScrollerInterface;
+
+typedef IntrusivePtr<TextScroller> TextScrollerPtr;
+
+/**
+ * @brief A helper class for scrolling text
+ */
+class TextScroller : public RefObject, public ConnectionTracker
+{
+public:
+
+  /**
+   * @brief Text Scrolling helper, used to automatically scroll text, SetParameters should be called before scrolling is needed.
+   * CleanUp removes the Scrolling actors from stage whilst keeping the Scroller object alive and preserving Speed, Gap and Loop count.
+   *
+   * @param[in] scrollerInterface scroller interface
+   */
+  static TextScrollerPtr New( ScrollerInterface& scrollerInterface );
+
+  /**
+   * @brief Set parameters relating to source required for scrolling
+   *
+   * @param[in] sourceActor source actor to be scrolled
+   * @param[in] controlSize size of the control to scroll within
+   * @param[in] offScreenSize size of the sourceActor
+   * @param[in] direction text direction true for right to left text
+   * @param[in] alignmentOffset alignment of source text
+   *
+   */
+  void SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, const Vector2 alignmentOffset );
+
+  /**
+   * @brief Set the gap distance to elapse before the text wraps around
+   * @param[in] gap distance to elapse
+   */
+  void SetGap( int gap );
+
+  /**
+   * @brief Get the distance before scrolling wraps
+   * @return gap distance to elapse
+   */
+  int GetGap() const;
+
+  /**
+   * @brief Set speed the text should scroll
+   * @param[in] scrollSpeed pixels per second
+   */
+  void SetSpeed( int scrollSpeed );
+
+  /**
+   * @brief Get the speed of text scrolling
+   * @return speed in pixels per second
+   */
+  int GetSpeed() const;
+
+  /**
+   * @brief Set the number of times the text scrolling should loop, can stop current scrolling by passing in 0;
+   * @param[in] loopCount number of times the scrolled text should loop, 0 to stop scrolling
+   */
+  void SetLoopCount( int loopCount );
+
+  /**
+   * @brief Get the number of loops
+   * @return int number of loops
+   */
+  int GetLoopCount() const;
+
+  /**
+   * @brief Get the camera used to look at source, should be added to the parent of target actor.
+   * @return camera Actor
+   */
+  Actor GetSourceCamera() const;
+
+  /**
+   * @brief Get the resulting scrolling text actor, add to target actor which will show scrolling text
+   * @return mesh Actor
+   */
+  Actor GetScrollingText() const;
+
+private: // Implementation
+
+  /**
+   * Constructor
+   */
+  TextScroller( ScrollerInterface& scrollerInterface );
+
+  /**
+   * Destructor
+   */
+  ~TextScroller();
+
+  // Undefined
+  TextScroller( const TextScroller& handle );
+
+  // Undefined
+  TextScroller& operator=( const TextScroller& handle );
+
+  /**
+   * @brief Callback for end of animation
+   * @param[in] animation Animation handle
+   */
+  void AutoScrollAnimationFinished( Dali::Animation& animation );
+
+  /**
+   * @brief variables required to set up scrolling animation
+   * @param[in] scrollAmount distance to animate text for the given duration
+   * @param[in] scrollDuration duration of aninmation
+   * @param[in] loopCount number of times to loop the scrolling text
+   */
+  void StartScrolling( float scrollAmount, float scrollDuration, int loopCount );
+
+  /**
+   * @brief When scrolling ended, the actors are cleaned up so no longer staged.
+   */
+  void CleanUp();
+
+private:
+
+  RenderTask         mRenderTask;               // Renders full text to a FrameBuffer which is then scrolled.
+  CameraActor        mOffscreenCameraActor;     // Camera used by render task
+  Actor              mScrollingTextActor;       // Actor used to show scrolling text
+  ScrollerInterface& mScrollerInterface;        // Interface implemented by control that requires scrolling
+  Property::Index    mScrollDeltaIndex;         // Property used by shader to represent distance to scroll
+  Animation          mScrollAnimation;          // Animation used to update the mScrollDeltaIndex
+
+  int mScrollSpeed;            ///< Speed which text should automatically scroll at
+  int mLoopCount;              ///< Number of time the text should scroll
+  int mWrapGap;                ///< Gap before text wraps around when scrolling
+
+}; // TextScroller class
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_SCROLLER_H__
+
index f5f1c49..eaa191d 100644 (file)
@@ -36,7 +36,7 @@ namespace Text
 struct GlyphRun;
 
 /**
- * @brief Abstract interface to provide the information necessary displaying text.
+ * @brief Abstract interface to provide the information necessary to display text.
  *
  * This includes:
  * - The font & glyph IDs needed to get bitmaps etc. from TextAbstraction
@@ -60,7 +60,7 @@ public:
   /**
    * @brief Retrieves the target size of the UI control.
    *
-   * @return The text's size.
+   * @return The control's size.
    */
   virtual const Vector2& GetControlSize() const = 0;
 
index 88e3930..7c1accb 100644 (file)
@@ -332,7 +332,6 @@ public:
 
   bool                   mUnderlineEnabled:1;   ///< Underline enabled flag
   bool                   mUnderlineColorSet:1;  ///< Has the underline color been explicitly set?
-
 };
 
 } // namespace Text
index 10ffbff..3026d9c 100644 (file)
@@ -105,8 +105,7 @@ void CubeTransitionCrossEffect::OnStartTransition( Vector2 panPosition, Vector2
     }
   }
 
-  const Vector2& size = Self().GetCurrentSize().GetVectorXY();
-  Vector2 halfSize = size * 0.5f;
+  const Vector2 halfSize = Self().GetCurrentSize().GetVectorXY() * 0.5f;
   //the centre to "explode" the tiles outwards from
   Vector3 centre( halfSize.x, halfSize.y, -1.0f / mDisplacementSpreadFactor );
 
@@ -130,7 +129,7 @@ void CubeTransitionCrossEffect::OnStartTransition( Vector2 panPosition, Vector2
 
 void CubeTransitionCrossEffect::SetupAnimation( unsigned int actorIndex, unsigned int x, unsigned int y, float angle, const Vector3 axis, const Vector3& displacementCentre )
 {
-  const Vector2& size = Self().GetCurrentSize().GetVectorXY();
+  const Vector2 size = Self().GetCurrentSize().GetVectorXY();
   Vector2 halfSize = size * 0.5f;
 
   //the position of the centre of the front face tile
index 1cee6e1..6d904b5 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 #include <dali/integration-api/debug.h>
 
@@ -84,33 +84,6 @@ Actor CreateTile( const Vector4& samplerRect )
   return tile;
 }
 
-
-Geometry CreateQuadGeometry()
-{
-  const float halfWidth = 0.5f;
-  const float halfHeight = 0.5f;
-  struct QuadVertex { Vector2 position;};
-  QuadVertex quadVertexData[4] =
-  {
-      { Vector2(-halfWidth, -halfHeight) },
-      { Vector2( halfWidth, -halfHeight) },
-      { Vector2(-halfWidth, halfHeight)  },
-      { Vector2( halfWidth, halfHeight)  }
-  };
-
-  Property::Map quadVertexFormat;
-  quadVertexFormat["aPosition"] = Property::VECTOR2;
-  PropertyBuffer quadVertices = PropertyBuffer::New( quadVertexFormat );
-  quadVertices.SetData( quadVertexData, 4 );
-
-  // Create the geometry object
-  Geometry geometry = Geometry::New();
-  geometry.AddVertexBuffer( quadVertices );
-  geometry.SetGeometryType( Geometry::TRIANGLE_STRIP );
-
-  return geometry;
-}
-
 }
 
 const Vector4 CubeTransitionEffect::FULL_BRIGHTNESS( 1.0f, 1.0f, 1.0f, 1.0f );
@@ -272,7 +245,7 @@ void CubeTransitionEffect::OnStageConnection( int depth )
 {
   Control::OnStageConnection( depth );
 
-  Geometry geometry = CreateQuadGeometry();
+  Geometry geometry = Geometry::QUAD();
   Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
 
   TextureSet textureSet = TextureSet::New();
index d4ce91d..525a61e 100644 (file)
@@ -109,7 +109,7 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p
 
 void  CubeTransitionWaveEffect::CalculateSaddleSurfaceParameters( Vector2 position, Vector2 displacement )
 {
-  const Vector2& size = Self().GetCurrentSize().GetVectorXY();
+  const Vector2 size = Self().GetCurrentSize().GetVectorXY();
   // the line passes through 'position' and has the direction of 'displacement'
   float coefA, coefB, coefC; //line equation: Ax+By+C=0;
   coefA = displacement.y;
index 33acab9..ef276bb 100644 (file)
@@ -26,7 +26,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
-#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/devel-api/rendering/renderer.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/devel-api/controls/flex-container/flex-container.h>
+#include <dali-toolkit/public-api/controls/flex-container/flex-container.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/flex-container/flex-container-impl.h>
@@ -92,12 +92,13 @@ class FlexContainer;
  * "name":"icon",
  * "type":"ImageView",
  * "image":"image.png",
- *   "customProperties": {
- *     "flex":1,                        // property to make the item to receive the specified proportion of the free space in the container. If all items in the container use this pattern, their sizes will be proportional to the specified flex factor.
- *     "alignSelf":"flexStart",         // property to specify how the item will align along the cross axis, if set, this overides the default alignment for all items in the container
- *     "flexMargin":[10, 10, 10, 10]    // property to specify the space around the item, if not set, default value is [0, 0, 0, 0]
+ *   "properties": {
+ *     "flex":1,                        // property to make the item to receive the specified proportion of the free space in the container.
+ *     "alignSelf":"flexStart",         // property to specify how the item will align along the cross axis.
+ *     "flexMargin":[10, 10, 10, 10]    // property to specify the space around the item.
  *   }
  * @endcode
+ * @SINCE_1_1.35
  */
 
 class DALI_IMPORT_API FlexContainer : public Control
@@ -107,122 +108,161 @@ public:
   /**
    * @brief The direction of the main axis in the flex container. This determines
    * the direction that flex items are laid out in the flex container.
+   * @SINCE_1_1.35
    */
   enum FlexDirection
   {
-    COLUMN,                  ///< The flexible items are displayed vertically as a column
-    COLUMN_REVERSE,          ///< The flexible items are displayed vertically as a column, but in reverse order
-    ROW,                     ///< The flexible items are displayed horizontally as a row
-    ROW_REVERSE              ///< The flexible items are displayed horizontally as a row, but in reverse order
+    COLUMN,                  ///< The flexible items are displayed vertically as a column @SINCE_1_1.35
+    COLUMN_REVERSE,          ///< The flexible items are displayed vertically as a column, but in reverse order @SINCE_1_1.35
+    ROW,                     ///< The flexible items are displayed horizontally as a row @SINCE_1_1.35
+    ROW_REVERSE              ///< The flexible items are displayed horizontally as a row, but in reverse order @SINCE_1_1.35
   };
 
   /**
    * @brief The primary direction in which content is ordered in the flex container
    * and on which sides the “start” and “end” are.
+   * @SINCE_1_1.35
    */
   enum ContentDirection
   {
-    INHERIT,                 ///< Inherits the same direction from the parent
-    LTR,                     ///< From left to right
-    RTL                      ///< From right to left
+    INHERIT,                 ///< Inherits the same direction from the parent @SINCE_1_1.35
+    LTR,                     ///< From left to right @SINCE_1_1.35
+    RTL                      ///< From right to left @SINCE_1_1.35
   };
 
   /**
    * @brief Alignment of the flex items when the items do not use all available
    * space on the main-axis.
+   * @SINCE_1_1.35
    */
   enum Justification
   {
-    JUSTIFY_FLEX_START,      ///< Items are positioned at the beginning of the container
-    JUSTIFY_CENTER,          ///< Items are positioned at the center of the container
-    JUSTIFY_FLEX_END,        ///< Items are positioned at the end of the container
-    JUSTIFY_SPACE_BETWEEN,   ///< Items are positioned with equal space between the lines
-    JUSTIFY_SPACE_AROUND     ///< Items are positioned with equal space before, between, and after the lines
+    JUSTIFY_FLEX_START,      ///< Items are positioned at the beginning of the container @SINCE_1_1.35
+    JUSTIFY_CENTER,          ///< Items are positioned at the center of the container @SINCE_1_1.35
+    JUSTIFY_FLEX_END,        ///< Items are positioned at the end of the container @SINCE_1_1.35
+    JUSTIFY_SPACE_BETWEEN,   ///< Items are positioned with equal space between the lines @SINCE_1_1.35
+    JUSTIFY_SPACE_AROUND     ///< Items are positioned with equal space before, between, and after the lines @SINCE_1_1.35
   };
 
   /**
    * @brief Alignment of the flex items or lines when the items or lines do not
    * use all available space on the cross-axis.
+   * @SINCE_1_1.35
    */
   enum Alignment
   {
-    ALIGN_AUTO,              ///< Inherits the same alignment from the parent (only valid for "alignSelf" property)
-    ALIGN_FLEX_START,        ///< At the beginning of the container
-    ALIGN_CENTER,            ///< At the center of the container
-    ALIGN_FLEX_END,          ///< At the end of the container
-    ALIGN_STRETCH            ///< Stretch to fit the container
+    ALIGN_AUTO,              ///< Inherits the same alignment from the parent (only valid for "alignSelf" property) @SINCE_1_1.35
+    ALIGN_FLEX_START,        ///< At the beginning of the container @SINCE_1_1.35
+    ALIGN_CENTER,            ///< At the center of the container @SINCE_1_1.35
+    ALIGN_FLEX_END,          ///< At the end of the container @SINCE_1_1.35
+    ALIGN_STRETCH            ///< Stretch to fit the container @SINCE_1_1.35
   };
 
   /**
    * @brief The wrap type of the flex container when there is no enough room for
    * all the items on one flex line.
+   * @SINCE_1_1.35
    */
   enum WrapType
   {
-    NO_WRAP,                 ///< Flex items laid out in single line (shrunk to fit the flex container along the main axis)
-    WRAP                     ///< Flex items laid out in multiple lines if needed
+    NO_WRAP,                 ///< Flex items laid out in single line (shrunk to fit the flex container along the main axis) @SINCE_1_1.35
+    WRAP                     ///< Flex items laid out in multiple lines if needed @SINCE_1_1.35
   };
 
 public:
 
   /**
    * @brief The start and end property ranges for this control.
+   * @SINCE_1_1.35
    */
   enum PropertyRange
   {
-    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
+    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,               ///< @SINCE_1_1.35
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,                           ///< Reserve property indices @SINCE_1_1.35
+
+    CHILD_PROPERTY_START_INDEX = CHILD_PROPERTY_REGISTRATION_START_INDEX,         ///< @SINCE_1_1.35
+    CHILD_PROPERTY_END_INDEX =   CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000   ///< Reserve child property indices @SINCE_1_1.35
   };
 
   /**
    * @brief An enumeration of properties belonging to the FlexContainer class.
+   * @SINCE_1_1.35
    */
   struct Property
   {
     enum
     {
-      CONTENT_DIRECTION = PROPERTY_START_INDEX, ///< name "contentDirection",   The primary direction in which content is ordered,                                                 @see FlexContainer::ContentDirection,  type INTEGER
-      FLEX_DIRECTION,                           ///< name "flexDirection",      The direction of the main-axis which determines the direction that flex items are laid out,        @see FlexContainer::FlexDirection,     type INTEGER
-      FLEX_WRAP,                                ///< name "flexWrap",           Whether the flex items should wrap or not if there is no enough room for them on one flex line,    @see FlexContainer::WrapType,          type INTEGER
-      JUSTIFY_CONTENT,                          ///< name "justifyContent",     The alignment of flex items when the items do not use all available space on the main-axis,        @see FlexContainer::Justification,     type INTEGER
-      ALIGN_ITEMS,                              ///< name "alignItems",         The alignment of flex items when the items do not use all available space on the cross-axis,       @see FlexContainer::Alignment,         type INTEGER
-      ALIGN_CONTENT                             ///< name "alignContent",       Similar to "alignItems", but it aligns flex lines, so only works when there are multiple lines,    @see FlexContainer::Alignment,         type INTEGER
+      // Event side properties
+      CONTENT_DIRECTION = PROPERTY_START_INDEX, ///< name "contentDirection",   The primary direction in which content is ordered,                                                 @see FlexContainer::ContentDirection,  type INTEGER @SINCE_1_1.35
+      FLEX_DIRECTION,                           ///< name "flexDirection",      The direction of the main-axis which determines the direction that flex items are laid out,        @see FlexContainer::FlexDirection,     type INTEGER @SINCE_1_1.35
+      FLEX_WRAP,                                ///< name "flexWrap",           Whether the flex items should wrap or not if there is no enough room for them on one flex line,    @see FlexContainer::WrapType,          type INTEGER @SINCE_1_1.35
+      JUSTIFY_CONTENT,                          ///< name "justifyContent",     The alignment of flex items when the items do not use all available space on the main-axis,        @see FlexContainer::Justification,     type INTEGER @SINCE_1_1.35
+      ALIGN_ITEMS,                              ///< name "alignItems",         The alignment of flex items when the items do not use all available space on the cross-axis,       @see FlexContainer::Alignment,         type INTEGER @SINCE_1_1.35
+      ALIGN_CONTENT                             ///< name "alignContent",       Similar to "alignItems", but it aligns flex lines, so only works when there are multiple lines,    @see FlexContainer::Alignment,         type INTEGER @SINCE_1_1.35
     };
   };
 
   /**
-   * Create a FlexContainer handle; this can be initialised with FlexContainer::New()
+   * @brief An enumeration of child properties belonging to the FlexContainer class.
+   * @SINCE_1_1.35
+   */
+  struct ChildProperty
+  {
+    enum
+    {
+      // Event side child properties
+      FLEX = CHILD_PROPERTY_START_INDEX,        ///< name "flex",               The proportion of the free space in the container the flex item will receive. If all items in the container set this property, their sizes will be proportional to the specified flex factor,  type FLOAT @SINCE_1_1.35
+      ALIGN_SELF,                               ///< name "alignSelf",          The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container,                          @see FlexContainer::Alignment,     type INTEGER @SINCE_1_1.35
+      FLEX_MARGIN                               ///< name "flexMargin",         The space around the flex item,                                                                                                                                                                type VECTOR4 @SINCE_1_1.35
+    };
+  };
+
+  /**
+   * @brief Create a FlexContainer handle; this can be initialised with FlexContainer::New()
    * Calling member functions with an uninitialised handle is not allowed.
+   * @SINCE_1_1.35
    */
   FlexContainer();
 
   /**
-   * Copy constructor. Creates another handle that points to the same real object
-   * @param handle to copy from
+   * @brief Copy constructor. Creates another handle that points to the same real object
+   * @SINCE_1_1.35
+   *
+   * @param[in] handle The handle to copy from
    */
   FlexContainer( const FlexContainer& handle );
 
   /**
-   * Assignment operator. Changes this handle to point to another real object
+   * @brief Assignment operator. Changes this handle to point to another real object
+   * @SINCE_1_1.35
    */
   FlexContainer& operator=( const FlexContainer& handle );
 
   /**
    * @brief Destructor
    *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   * @details This is non-virtual since derived Handle types must not contain data or virtual methods.
+   *
+   * @SINCE_1_1.35
    */
   ~FlexContainer();
 
   /**
-   * Create the FlexContainer control.
+   * @brief Create the FlexContainer control.
+   * @SINCE_1_1.35
+   *
    * @return A handle to the FlexContainer control.
    */
   static FlexContainer New();
 
   /**
-   * Downcast an Object handle to FlexContainer. If handle points to a FlexContainer the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
+   * @brief Downcast an Object handle to FlexContainer.
+   *
+   * @details If handle points to a FlexContainer the downcast produces
+   * valid handle. If not the returned handle is left uninitialized.
+   *
+   * @SINCE_1_1.35
+   *
    * @param[in] handle Handle to an object
    * @return handle to a FlexContainer or an uninitialized handle
    */
@@ -233,6 +273,7 @@ public: // Not intended for application developers
 
   /**
    * @brief Creates a handle using the Toolkit::Internal implementation.
+   * @SINCE_1_1.35
    *
    * @param[in] implementation The Control implementation.
    */
@@ -240,6 +281,7 @@ public: // Not intended for application developers
 
   /**
    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
+   * @SINCE_1_1.35
    *
    * @param[in] internal A pointer to the internal CustomActor.
    */
index 14e3427..bc401f1 100644 (file)
@@ -94,12 +94,13 @@ public:
        */
       PRE_MULTIPLIED_ALPHA,
 
+
       // Animatable properties
 
       /**
        * @brief name "pixelArea", type Vector4
        * @details Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].
-       * @SINCE_1_0.18
+       * @SINCE_1_1.18
        */
       PIXEL_AREA = ANIMATABLE_PROPERTY_START_INDEX,
     };
index 5610934..f8cbfea 100755 (executable)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_BAR_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -73,12 +73,60 @@ public:
   {
     enum
     {
-      SCROLL_DIRECTION = PROPERTY_START_INDEX, ///< name "scrollDirection",          @see SetScrollDirection(),        type std::string @SINCE_1_0.0
-      INDICATOR_HEIGHT_POLICY,                 ///< name "indicatorHeightPolicy",    @see SetIndicatorHeightPolicy(),  type std::string @SINCE_1_0.0
-      INDICATOR_FIXED_HEIGHT,                  ///< name "indicatorFixedHeight",     @see SetIndicatorFixedHeight(),   type float @SINCE_1_0.0
-      INDICATOR_SHOW_DURATION,                 ///< name "indicatorShowDuration",    @see SetIndicatorShowDuration(),  type float @SINCE_1_0.0
-      INDICATOR_HIDE_DURATION,                 ///< name "indicatorHideDuration",    @see SetIndicatorHideDuration(),  type float @SINCE_1_0.0
-      SCROLL_POSITION_INTERVALS                ///< name "scrollPositionIntervals",  @see SetScrollPositionIntervals() type Property::Array @SINCE_1_0.0
+      /**
+       * @brief name "scrollDirection", type std::string
+       * @see SetScrollDirection()
+       * @SINCE_1_0.0
+       */
+      SCROLL_DIRECTION = PROPERTY_START_INDEX,
+      /**
+       * @brief name "indicatorHeightPolicy", type std::string
+       * @see SetIndicatorHeightPolicy()
+       * @SINCE_1_0.0
+       */
+      INDICATOR_HEIGHT_POLICY,
+      /**
+       * @brief name "indicatorFixedHeight", type float
+       * @see SetIndicatorFixedHeight()
+       * @SINCE_1_0.0
+       */
+      INDICATOR_FIXED_HEIGHT,
+      /**
+       * @brief name "indicatorShowDuration", type float
+       * @see SetIndicatorShowDuration()
+       * @SINCE_1_0.0
+       */
+      INDICATOR_SHOW_DURATION,
+      /**
+       * @brief name "indicatorHideDuration", type float
+       * @see SetIndicatorHideDuration()
+       * @SINCE_1_0.0
+       */
+      INDICATOR_HIDE_DURATION,
+      /**
+       * @brief name "scrollPositionIntervals", type Property::Array
+       * @see SetScrollPositionIntervals()
+       * @SINCE_1_0.0
+       */
+      SCROLL_POSITION_INTERVALS,
+      /**
+       * @brief name "indicatorMinimumHeight", type float
+       * The minimum height for a variable size indicator.
+       * @SINCE_1_1.36
+       */
+      INDICATOR_MINIMUM_HEIGHT,
+      /**
+       * @brief name "indicatorStartPadding", type float
+       * The padding at the start of the indicator. For example, the top if scrollDirection is Vertical.
+       * @SINCE_1_1.36
+       */
+      INDICATOR_START_PADDING,
+      /**
+       * @brief name "indicatorEndPadding", type float
+       * The padding at the end of the indicator. For example, the bottom if scrollDirection is Vertical.
+       * @SINCE_1_1.36
+       */
+      INDICATOR_END_PADDING
     };
   };
 
index 94257ee..e3f17b7 100644 (file)
@@ -94,7 +94,10 @@ public:
   enum PropertyRange
   {
     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
-    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices @SINCE_1_0.0
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,             ///< Reserve property indices @SINCE_1_0.0
+
+    CHILD_PROPERTY_START_INDEX = CHILD_PROPERTY_REGISTRATION_START_INDEX,         ///< @SINCE_1_1.36
+    CHILD_PROPERTY_END_INDEX =   CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000   ///< Reserve child property indices @SINCE_1_1.36
   };
 
   /**
@@ -136,6 +139,22 @@ public:
   };
 
   /**
+   * @brief An enumeration of child properties belonging to the TableView class.
+   * @SINCE_1_1.36
+   */
+  struct ChildProperty
+  {
+    enum
+    {
+      CELL_INDEX = CHILD_PROPERTY_START_INDEX,  ///< name "cellIndex",                The top-left cell this child occupies, if not set, the first available cell is used,           type VECTOR2 @SINCE_1_1.36
+      ROW_SPAN,                                 ///< name "rowSpan",                  The number of rows this child occupies, if not set, default value is 1,                        type FLOAT @SINCE_1_1.36
+      COLUMN_SPAN,                              ///< name "columnSpan",               The number of columns this child occupies, if not set, default value is 1,                     type FLOAT @SINCE_1_1.36
+      CELL_HORIZONTAL_ALIGNMENT,                ///< name "cellHorizontalAlignment",  The horizontal alignment of this child inside the cells, if not set, default value is 'left',  type STRING @SINCE_1_1.36
+      CELL_VERTICAL_ALIGNMENT                   ///< name "cellVerticalAlignment",    The vertical alignment of this child inside the cells, if not set, default value is 'top',     type STRING @SINCE_1_1.36
+    };
+  };
+
+  /**
    * @brief Describes how the size of a row / column been set
    * @SINCE_1_0.0
    */
index 317918e..33e95f1 100644 (file)
@@ -40,6 +40,30 @@ class TextLabel;
  * @brief A control which renders a short text string.
  *
  * Text labels are lightweight, non-editable and do not respond to user input.
+ *
+ * @section TextLabelProperties Properties
+ * |%Property enum                    |String name          |Type          |Writable|Animatable|
+ * |----------------------------------|---------------------|--------------|--------|----------|
+ * | Property::RENDERING_BACKEND      | renderingBackend    |  INTEGER     | O      | X        |
+ * | Property::TEXT                   | text                |  STRING      | O      | X        |
+ * | Property::FONT_FAMILY            | fontFamily          |  STRING      | O      | X        |
+ * | Property::FONT_STYLE             | fontStyle           |  STRING      | O      | X        |
+ * | Property::POINT_SIZE             | pointSize           |  FLOAT       | O      | X        |
+ * | Property::MULTI_LINE             | multiLine           |  BOOLEAN     | O      | X        |
+ * | Property::HORIZONTAL_ALIGNMENT   | horizontalAlignment |  STRING      | O      | X        |
+ * | Property::VERTICAL_ALIGNMENT     | verticalAlignment   |  STRING      | O      | X        |
+ * | Property::TEXT_COLOR             | textColor           |  VECTOR4     | O      | X        |
+ * | Property::SHADOW_OFFSET          | shadowOffset        |  VECTOR2     | O      | X        |
+ * | Property::SHADOW_COLOR           | shadowColor         |  VECTOR4     | O      | X        |
+ * | Property::UNDERLINE_ENABLED      | underlineEnabled    |  BOOLEAN     | O      | X        |
+ * | Property::UNDERLINE_COLOR        | underlineColor      |  VECTOR4     | O      | X        |
+ * | Property::UNDERLINE_HEIGHT       | underlineHeight     |  FLOAT       | O      | X        |
+ * | Property::ENABLE_MARKUP          | enableMarkup        |  BOOLEAN     | O      | X        |
+ * | Property::ENABLE_AUTO_SCROLL     | enableAutoScroll    |  BOOLEAN     | O      | X        |
+ * | Property::AUTO_SCROLL_SPEED      | autoScrollSpeed     |  INTEGER     | O      | X        |
+ * | Property::AUTO_SCROLL_LOOP_COUNT | autoScrollLoopCount |  INTEGER     | O      | X        |
+ * | Property::AUTO_SCROLL_GAP        | autoScrollGap       |  INTEGER     | O      | X        |
+ *
  * @SINCE_1_0.0
  */
 class DALI_IMPORT_API TextLabel : public Control
@@ -64,21 +88,138 @@ public:
   {
     enum
     {
-      RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "renderingBackend",     The type or rendering e.g. bitmap-based,          type INT @SINCE_1_0.0
-      TEXT,                                     ///< name "text",                 The text to display in UTF-8 format,              type STRING @SINCE_1_0.0
-      FONT_FAMILY,                              ///< name "fontFamily",           The requested font family,                        type STRING @SINCE_1_0.0
-      FONT_STYLE,                               ///< name "fontStyle",            The requested font style,                         type STRING @SINCE_1_0.0
-      POINT_SIZE,                               ///< name "pointSize",            The size of font in points,                       type FLOAT @SINCE_1_0.0
-      MULTI_LINE,                               ///< name "multiLine",            The single-line or multi-line layout option,      type BOOLEAN @SINCE_1_0.0
-      HORIZONTAL_ALIGNMENT,                     ///< name "horizontalAlignment",  The line horizontal alignment,                    type STRING,  values "BEGIN", "CENTER", "END" @SINCE_1_0.0
-      VERTICAL_ALIGNMENT,                       ///< name "verticalAlignment",    The line vertical alignment,                      type STRING,  values "TOP",   "CENTER", "BOTTOM" @SINCE_1_0.0
-      TEXT_COLOR,                               ///< name "textColor",            The text color,                                   type VECTOR4 @SINCE_1_0.0
-      SHADOW_OFFSET,                            ///< name "shadowOffset",         The drop shadow offset 0 indicates no shadow,     type VECTOR2 @SINCE_1_0.0
-      SHADOW_COLOR,                             ///< name "shadowColor",          The color of a drop shadow,                       type VECTOR4 @SINCE_1_0.0
-      UNDERLINE_ENABLED,                        ///< name "underlineEnabled",     The underline enabled flag,                       type BOOLEAN @SINCE_1_0.0
-      UNDERLINE_COLOR,                          ///< name "underlineColor",       The color of the underline,                       type VECTOR4 @SINCE_1_0.0
-      UNDERLINE_HEIGHT,                         ///< name "underlineHeight",      Overrides the underline height from font metrics, type FLOAT @SINCE_1_0.0
-      ENABLE_MARKUP                             ///< name "enableMarkup",         Whether the mark-up processing is enabled.        type BOOLEAN @SINCE_1_0.0
+      /**
+       * @brief The type of rendering e.g. bitmap-based
+       * @details name "renderingBackend", type INT, default RENDERING_SHARED_ATLAS
+       * @SINCE_1_0.0
+       */
+      RENDERING_BACKEND = PROPERTY_START_INDEX,
+
+      /**
+       * @brief The text to display in UTF-8 format,
+       * @details name "text", type STRING
+       * @SINCE_1_0.0
+       */
+      TEXT,
+
+      /**
+       * @brief The requested font family to use,
+       * @details name "fontFamily", type STRING
+       * @SINCE_1_0.0
+       */
+      FONT_FAMILY,
+
+      /**
+       * @brief The requested font style to use,
+       * @details name "fontStyle", type STRING
+       * @SINCE_1_0.0
+       */
+      FONT_STYLE,
+
+      /**
+       * @brief The size of font in points
+       * @details name "pointSize", type FLOAT
+       * @SINCE_1_0.0
+       */
+      POINT_SIZE,
+
+      /**
+       * @brief The single-line or multi-line layout option
+       * @details name "multiLine", type FLOAT, default SINGLE_LINE_BOX
+       * @SINCE_1_0.0
+       */
+      MULTI_LINE,
+
+      /**
+       * @brief The line horizontal alignment
+       * @details name "horizontalAlignment", type STRING,  values "BEGIN", "CENTER", "END", default BEGIN
+       * @SINCE_1_0.0
+       */
+      HORIZONTAL_ALIGNMENT,
+
+      /**
+       * @brief The line vertical alignment
+       * @details name "verticalAlignment", type STRING,  values "TOP",   "CENTER", "BOTTOM" @SINCE_1_0.0, default TOP
+       * @SINCE_1_0.0
+       */
+      VERTICAL_ALIGNMENT,
+
+      /**
+       * @brief The color of the text
+       * @details name "textColor", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      TEXT_COLOR,
+
+      /**
+       * @brief The drop shadow offset 0 indicates no shadow
+       * @details name "shadowOffset", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      SHADOW_OFFSET,
+
+      /**
+       * @brief The color of a drop shadow
+       * @details name "shadowColor", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      SHADOW_COLOR,
+
+      /**
+       * @brief The underline enabled flag
+       * @details name "underlineEnabled", type BOOLEAN
+       * @SINCE_1_0.0
+       */
+      UNDERLINE_ENABLED,
+
+      /**
+       * @brief The color of the underline
+       * @details name "underlineColor", type VECTOR4
+       * @SINCE_1_0.0
+       */
+      UNDERLINE_COLOR,
+
+      /**
+       * @brief Overrides the underline height from font metrics
+       * @details name "underlineHeight", type FLOAT
+       * @SINCE_1_0.0
+       */
+      UNDERLINE_HEIGHT,
+
+      /**
+       * @brief  Whether the mark-up processing is enabled
+       * @details name "enableMarkup", type BOOLEAN
+       * @SINCE_1_0.0
+       */
+      ENABLE_MARKUP,
+
+      /**
+       * @brief  Start or stop auto scrolling,
+       * @details name "enableMarkup", type BOOLEAN, default is false
+       * @SINCE_1_1.35
+       */
+      ENABLE_AUTO_SCROLL,
+
+      /**
+       * @brief  Start or stop auto scrolling,
+       * @details name "autoScrollSpeed", type INT, default in style sheet
+       * @SINCE_1_1.35
+       */
+      AUTO_SCROLL_SPEED,
+
+      /**
+       * @brief  Number of complete loops when scrolling enabled
+       * @details name "autoScrollLoopCount", type INT, default in style sheet
+       * @SINCE_1_1.35
+       */
+      AUTO_SCROLL_LOOP_COUNT,
+
+      /**
+       * @brief  Gap before before scrolling wraps
+       * @details name "autoScrollGap", type INT, default in style sheet but can be overridden to prevent same text being show at start and end.
+       * @SINCE_1_1.35
+       */
+      AUTO_SCROLL_GAP
     };
   };
 
index 7bead86..1f381d9 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 34;
+const unsigned int TOOLKIT_MICRO_VERSION = 36;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 16d923f..a7b1a02 100755 (executable)
@@ -9,6 +9,7 @@ public_api_src_files = \
   $(public_api_src_dir)/controls/buttons/push-button.cpp \
   $(public_api_src_dir)/controls/buttons/radio-button.cpp \
   $(public_api_src_dir)/controls/default-controls/solid-color-actor.cpp \
+  $(public_api_src_dir)/controls/flex-container/flex-container.cpp \
   $(public_api_src_dir)/controls/image-view/image-view.cpp \
   $(public_api_src_dir)/controls/model3d-view/model3d-view.cpp \
   $(public_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.cpp \
@@ -58,6 +59,9 @@ public_api_default_controls_header_files = \
 public_api_model3d_view_header_files = \
   $(public_api_src_dir)/controls/model3d-view/model3d-view.h
 
+public_api_flex_container_header_files = \
+  $(public_api_src_dir)/controls/flex-container/flex-container.h
+
 public_api_gaussian_blur_view_header_files = \
   $(public_api_src_dir)/controls/gaussian-blur-view/gaussian-blur-view.h
 
index 4ecc335..725a71a 100644 (file)
   {
     "textlabel":
     {
-      "pointSize":18
+      "pointSize":18,
+      "enableAutoScroll":false,
+      "autoScrollLoopCount":2,
+      "autoScrollGap":50,
+      "autoScrollSpeed":80
     },
 
     "textlabelFontSize0":
index ffe9326..3297e51 100644 (file)
   {
     "textlabel":
     {
-      "pointSize":18
+      "pointSize":18,
+      "enableAutoScroll":false,
+      "autoScrollLoopCount":2,
+      "autoScrollGap":50,
+      "autoScrollSpeed":80
     },
 
     "textlabelFontSize0":
diff --git a/docs/content/images/text-controls/AutoScroll.gif b/docs/content/images/text-controls/AutoScroll.gif
new file mode 100644 (file)
index 0000000..663cd3b
Binary files /dev/null and b/docs/content/images/text-controls/AutoScroll.gif differ
index 8aacc9d..960d77b 100644 (file)
@@ -39,7 +39,7 @@
    + [Relative To Constraint](@ref constraints-relative-to)
   + [Multi-threading Notes](@ref animation-multi-threading-notes)
   + [Shader Animation](@ref animation-shader)
 + [Styling](@ref styling)
+ + [Styling](@ref styling)
 
 ### Resources
  + [Resource Image](@ref resource-image)
index 43d6419..1033b5f 100644 (file)
@@ -79,7 +79,7 @@ DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
 - The parameter to DALI_PROPERTY_TABLE_END should match the start index of the property enumeration.
 
 <br>
-<h2 class="pg">How to implement a property within Dali-toolkit:</h2>
+<h2 class="pg">How to implement a property within Dali-toolkit controls and application-side custom controls:</h2>
 
 Macros are used to define properties for the following reasons:
 
@@ -153,6 +153,10 @@ Note that the “PropertyRange” contents “PROPERTY_START_INDEX” & "ANIMATA
 
 Source file: <b>image-view-impl.cpp</b>, within an unnamed namespace:
 
+@code
+#include <dali/public-api/object/type-registry-helper.h>
+@endcode
+
 @clip{"image-view-impl.cpp",DALI_TYPE_REGISTRATION_BEGIN,DALI_TYPE_REGISTRATION_END}
 
 <b>Notes:</b>
@@ -161,6 +165,9 @@ Source file: <b>image-view-impl.cpp</b>, within an unnamed namespace:
 - Properties should be in the same order as in the enum.
 - Signals and actions are registered likewise in that order.
 - Properties type-registered using these macros will have their order checked at compile time. If you get an indexing compile error, check the order matches the enum order.
+    The error will look like this: " error: invalid application of 'sizeof' to incomplete type 'Dali::CompileTimeAssertBool<false>' "
+- If using the Pimpl design pattern when creating a custom control from within an application, the Handle (public) and Object (internal) classes should have the same name. They can be separated by different namespaces.
+    This requirement is actually due to how the type-registry in DALi looks up properties.
 
 <br>
 <hr>
@@ -182,7 +189,8 @@ shows the index range of the different properties in place.
 |:----------------------|:--------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------:|
 | Default               | Properties defined within DALi Core, e.g. Dali::Actor, Dali::ShaderEffect default properties etc. | \link Dali::DEFAULT_OBJECT_PROPERTY_START_INDEX DEFAULT_OBJECT_PROPERTY_START_INDEX\endlink                | \link Dali::DEFAULT_PROPERTY_MAX_COUNT DEFAULT_PROPERTY_MAX_COUNT\endlink (9999999)                                                |
 | Registered            | Properties registered using Dali::PropertyRegistration                                            | \link Dali::PROPERTY_REGISTRATION_START_INDEX PROPERTY_REGISTRATION_START_INDEX\endlink (10000000)         | \link Dali::PROPERTY_REGISTRATION_MAX_INDEX PROPERTY_REGISTRATION_MAX_INDEX\endlink (19999999)                                     |
-| Registered Animatable | Animatable properties registered using Dali::PropertyRegistration                                 | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX\endlink (20000000) | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX\endlink (29999999) |
+| Registered Animatable | Animatable properties registered using Dali::AnimatablePropertyRegistration                       | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX\endlink (20000000) | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX\endlink (29999999) |
+| Registered Child      | Child properties (which parent supports in its children) registered using Dali::ChildPropertyRegistration   | \link Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX\endlink (20000000) | \link Dali::CHILD_PROPERTY_REGISTRATION_MAX_INDEX CHILD_PROPERTY_REGISTRATION_MAX_INDEX\endlink (49999999) |
 | Control               | Property range reserved by Dali::Toolkit::Control                                                 | \link Dali::Toolkit::Control::CONTROL_PROPERTY_START_INDEX CONTROL_PROPERTY_START_INDEX\endlink (10000000) | \link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX CONTROL_PROPERTY_END_INDEX\endlink (10001000)                             |
 | Derived Control       | Property range for control deriving directly from Dali::Toolkit::Control                          | 10001001                                                                                                   | \link Dali::PROPERTY_REGISTRATION_MAX_INDEX PROPERTY_REGISTRATION_MAX_INDEX\endlink (19999999)                                     |
 | Custom                | Custom properties added to instance using Dali::Handle::RegisterProperty                          | \link Dali::PROPERTY_CUSTOM_START_INDEX PROPERTY_CUSTOM_START_INDEX\endlink (50000000)                     | Onwards...                                                                                                                         |
index 8acacaa..09392c8 100644 (file)
@@ -249,23 +249,23 @@ flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::FLEX_DIRECTIO
 
 // Create flex items and set the proportion
 Dali::Toolkit::Control item1 = Dali::Toolkit::Control::New();
-item1.RegisterProperty( "flex", 1.0f, Dali::Property::READ_WRITE );
+item1.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 1.0f );
 flexContainer.Add( item1 );
 
 Dali::Toolkit::Control item2 = Dali::Toolkit::Control::New();
-item2.RegisterProperty( "flex", 3.0f, Dali::Property::READ_WRITE );
+item2.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 3.0f );
 flexContainer.Add( item2 );
 
 Dali::Toolkit::Control item3 = Dali::Toolkit::Control::New();
-item3.RegisterProperty( "flex", 1.0f, Dali::Property::READ_WRITE );
+item3.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 1.0f );
 flexContainer.Add( item3 );
 
 Dali::Toolkit::Control item4 = Dali::Toolkit::Control::New();
-item4.RegisterProperty( "flex", 2.0f, Dali::Property::READ_WRITE );
+item4.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 2.0f );
 flexContainer.Add( item4 );
 
 Dali::Toolkit::Control item5 = Dali::Toolkit::Control::New();
-item5.RegisterProperty( "flex", 1.0f, Dali::Property::READ_WRITE );
+item5.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 1.0f );
 flexContainer.Add( item5 );
 
 ~~~
@@ -281,23 +281,23 @@ flexContainer.flexDirection = "row";
 
 // Create flex items and set the proportion
 var item1 = new dali.Control();
-item1.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE);
+item1.flex = 1.0;
 flexContainer.add(item1);
 
 var item2 = new dali.Control();
-item2.registerCustomProperty("flex", 3.0, dali.PROPERTY_READ_WRITE);
+item2.flex = 3.0;
 flexContainer.add(item2);
 
 var item3 = new dali.Control();
-item3.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE);
+item3.flex = 1.0;
 flexContainer.add(item3);
 
 var item4 = new dali.Control();
-item4.registerCustomProperty("flex", 2.0, dali.PROPERTY_READ_WRITE);
+item4.flex = 2.0;
 flexContainer.add(item4);
 
 var item5 = new dali.Control();
-item5.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE);
+item5.flex = 1.0;
 flexContainer.add(item5);
 
 ~~~
@@ -338,14 +338,14 @@ flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::ALIGN_ITEMS,
 
 // Create flex items and add them to the flex container
 Dali::Toolkit::Control item1 = Dali::Toolkit::Control::New();
-item1.RegisterProperty( "alignSelf", Dali::Toolkit::FlexContainer::ALIGN_CENTER, Dali::Property::READ_WRITE ); // Align item1 at the center of the container
+item1.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::ALIGN_SELF, Dali::Toolkit::FlexContainer::ALIGN_CENTER ); // Align item1 at the center of the container
 flexContainer.Add( item1 );
 
 Dali::Toolkit::Control item2 = Dali::Toolkit::Control::New();
 flexContainer.Add( item2 ); // item2 is aligned at the beginning of ther container
 
 Dali::Toolkit::Control item3 = Dali::Toolkit::Control::New();
-item3.RegisterProperty( "alignSelf", Dali::Toolkit::FlexContainer::ALIGN_FLEX_END, Dali::Property::READ_WRITE ); // Align item3 at the bottom of the container
+item3.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::ALIGN_SELF, Dali::Toolkit::FlexContainer::ALIGN_FLEX_END ); // Align item3 at the bottom of the container
 flexContainer.Add( item3 );
 
 Dali::Toolkit::Control item4 = Dali::Toolkit::Control::New();
@@ -367,14 +367,14 @@ flexContainer.alignItems = "flexStart";
 
 // Create flex items and add them to the flex container
 var item1 = new dali.Control();
-item1.registerCustomProperty("alignSelf", "center", dali.PROPERTY_READ_WRITE); // Align item1 at the center of the container
+item1.alignSelf = "center"; // Align item1 at the center of the container
 flexContainer.add(item1);
 
 var item2 = new dali.Control();
 flexContainer.add(item2); // item2 is aligned at the beginning of ther container
 
 var item3 = new dali.Control();
-item1.registerCustomProperty("alignSelf", "flexEnd", dali.PROPERTY_READ_WRITE); // Align item3 at the bottom of the container
+item1.alignSelf = "flexEnd"; // Align item3 at the bottom of the container
 flexContainer.add(item3);
 
 var item4 = new dali.Control();
@@ -411,7 +411,7 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 Dali::Toolkit::Control item = Dali::Toolkit::Control::New();
 
 // Add the margin around the item
-item.RegisterProperty( "flexMargin", Vector4(10.0f, 10.0f, 10.0f, 10.0f), Dali::Property::READ_WRITE );
+item.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN, Vector4(10.0f, 10.0f, 10.0f, 10.0f) );
 
 // Add the item to the container
 flexContainer.Add( item );
@@ -427,7 +427,7 @@ var flexContainer = new dali.Control("FlexContainer");
 var item = new dali.Control();
 
 // Add the margin around the item
-item.registerCustomProperty("flexMargin", [10.0, 10.0, 10.0, 10.0], dali.PROPERTY_READ_WRITE);
+item.flexMargin = [10.0, 10.0, 10.0, 10.0];
 
 // Add the item to the container
 flexContainer.add(item);
@@ -526,7 +526,7 @@ This can be achieved by setting the flex property.
 
 toolBar.SetProperty( Dali::Toolkit::FlexContainer::Property::FLEX_DIRECTION, Dali::Toolkit::FlexContainer::ROW ); // display toolbar items horizontally
 toolBar.SetProperty( Dali::Toolkit::FlexContainer::Property::ALIGN_ITEMS, Dali::Toolkit::FlexContainer::ALIGN_CENTER ); // align toolbar items vertically center
-toolBar.RegisterProperty( "flex", 0.1f, Dali::Property::READ_WRITE ); // 10 percent of available space in the cross axis
+toolBar.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 0.1f ); // 10 percent of available space in the cross axis
 ~~~
 
 ~~~{.js}
@@ -534,7 +534,7 @@ toolBar.RegisterProperty( "flex", 0.1f, Dali::Property::READ_WRITE ); // 10 perc
 
 toolBar.flexDirection = "row"; // display toolbar items horizontally
 toolBar.alignItems = "center"; // align toolbar items vertically center
-toolBar.registerCustomProperty("flex", 0.1, dali.PROPERTY_READ_WRITE); // 10 percent of available space in the cross axis
+toolBar.flex = 0.1; // 10 percent of available space in the cross axis
 ~~~
  
 Then we create another flex container as the content area to display the image, and it will be displayed in the bottom of the main container.
@@ -550,7 +550,7 @@ content.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
 content.SetProperty( Dali::Toolkit::FlexContainer::Property::FLEX_DIRECTION, Dali::Toolkit::FlexContainer::ROW ); // display items horizontally
 content.SetProperty( Dali::Toolkit::FlexContainer::Property::JUSTIFY_CONTENT, Dali::Toolkit::FlexContainer::JUSTIFY_CENTER ); // align items horizontally center
 content.SetProperty( Dali::Toolkit::FlexContainer::Property::ALIGN_ITEMS, Dali::Toolkit::FlexContainer::ALIGN_CENTER ); // align items vertically center
-content.RegisterProperty( "flex", 0.9f, Dali::Property::READ_WRITE ); // 90 percent of available space in the cross axis
+content.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 0.9f ); // 90 percent of available space in the cross axis
 
 // Add it to the main container
 flexContainer.Add( content );
@@ -566,7 +566,7 @@ content.anchorPoint = dali.TOP_LEFT;
 content.flexDirection = "row";
 content.alignItems = "center"; // align items vertically center
 content.justifyContent = "center"; // align items horizontally center
-content.registerCustomProperty("flex", 0.9, dali.PROPERTY_READ_WRITE); // 90 percent of available space in the cross axis
+content.flex = 0.9; // 90 percent of available space in the cross axis
 
 // Add it to the main container
 flexContainer.add(content);
@@ -584,7 +584,7 @@ Dali::Toolkit::PushButton prevButton = Dali::Toolkit::PushButton::New();
 prevButton.SetParentOrigin( Dali::ParentOrigin::TOP_LEFT );
 prevButton.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
 prevButton.SetMinimumSize( Dali::Vector2( 100.0f, 60.0f ) ); // this is the minimum size the button should keep
-prevButton.RegisterProperty( "flexMargin", Dali::Vector4(10.0f, 10.0f, 10.0f, 10.0f), Dali::Property::READ_WRITE ); // set 10 pixel margin around the button
+prevButton.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN, Dali::Vector4(10.0f, 10.0f, 10.0f, 10.0f) ); // set 10 pixel margin around the button
 toolBar.Add( prevButton );
 
 // Set the button text
@@ -600,8 +600,8 @@ title.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
 title.SetResizePolicy( Dali::ResizePolicy::USE_NATURAL_SIZE, Dali::Dimension::ALL_DIMENSIONS );
 title.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
 title.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
-title.RegisterProperty( "flex", 1.0f, Dali::Property::READ_WRITE ); // take all the available space left apart from the two buttons
-title.RegisterProperty( "flexMargin", Dali::Vector4(10.0f, 10.0f, 10.0f, 10.0f), Dali::Property::READ_WRITE ); // set 10 pixel margin around the title
+title.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 1.0f ); // take all the available space left apart from the two buttons
+title.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN, Dali::Vector4(10.0f, 10.0f, 10.0f, 10.0f) ); // set 10 pixel margin around the title
 toolBar.Add( title );
 
 // Add a button to the right of the toolbar
@@ -609,7 +609,7 @@ Dali::Toolkit::PushButton nextButton = Dali::Toolkit::PushButton::New();
 nextButton.SetParentOrigin( Dali::ParentOrigin::TOP_LEFT );
 nextButton.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
 nextButton.SetMinimumSize( Dali::Vector2( 100.0f, 60.0f ) ); // this is the minimum size the button should keep
-nextButton.RegisterProperty( "flexMargin", Dali::Vector4(10.0f, 10.0f, 10.0f, 10.0f), Dali::Property::READ_WRITE ); // set 10 pixel margin around the button
+nextButton.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN, Dali::Vector4(10.0f, 10.0f, 10.0f, 10.0f) ); // set 10 pixel margin around the button
 toolBar.Add( nextButton );
 
 // Set the button text
@@ -627,7 +627,7 @@ prevButton.parentOrigin = dali.TOP_LEFT;
 prevButton.anchorPoint = dali.TOP_LEFT;
 prevButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
 prevButton.labelText = "Prev";
-prevButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+prevButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
 
 toolBar.add( prevButton );
 
@@ -640,8 +640,8 @@ title.heightResizePolicy = "USE_NATURAL_SIZE";
 title.horizontalAlignment = "CENTER";
 title.verticalAlignment = "CENTER";
 title.text = "Gallery";
-title.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE); // take all the available space left apart from the two buttons
-title.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the title
+title.flex = 1.0; // take all the available space left apart from the two buttons
+title.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the title
 
 toolBar.add( title );
 
@@ -652,7 +652,7 @@ nextButton.parentOrigin = dali.TOP_LEFT;
 nextButton.anchorPoint = dali.TOP_LEFT;
 nextButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
 nextButton.labelText = "Next";
-nextButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+nextButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
 
 toolBar.add( nextButton );
 ~~~
diff --git a/docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md b/docs/content/shared-javascript-and-cpp-documentation/text-auto-scrolling.md
new file mode 100644 (file)
index 0000000..ba7270d
--- /dev/null
@@ -0,0 +1,63 @@
+<!--
+/**-->
+
+# Text auto scrolling {#text-auto-scrolling}
+
+## Overview
+
+Auto TextLabel scrolling enables the text to scroll within the control, it can be used if text exceeds the boundary of the control hence showing the full content.
+It will also scroll text that is smaller than the control and ensure the same bit of text is not visible at the same time, this gap can be configured to be larger.
+
+If the number of loops (repetitions) is not set then once triggered to start it will scroll until requested to stop.
+If loop count is set to 3 for example it will scroll the text 3 times.
+
+![ ](../assets/img/text-controls/AutoScroll.gif)
+![ ](AutoScroll.gif)
+
+### Usage
+
+At version 1.1.35 auto scrolling is only supported in single line, mutliline text will not scroll and Text should be BEGIN aligned.
+
+The ENABLE_AUTO_SCROLL property should be set to TRUE to enable scrolling.
+
+The scroll speed, gap and loop count can be set in the stylesheet or provided by Dali::Handle::SetProperty. See the description of each below.
+
+Once enabled it will start scrolling until the loop count is completed or the ENABLE_AUTO_SCROLL set to false, setting ENABLE_AUTO_SCROLL to false will let the
+text complete it's current scrolling loop then stop.
+
+## The additional properties below can be set to customise the scrolling behaviour
+
+#### AUTO_SCROLL_SPEED
+
+This controls the speed of the scrolling, the speed should be provided as pixels/second.
+
+#### AUTO_SCROLL_LOOP_COUNT
+
+This specifies how many times the text will complete a full scroll cycle.
+If not set then it will keep scrolling until ENABLE_AUTO_SCROLL is set to false.
+
+Setting ENABLE_AUTO_SCROLL to false will stop scrolling whilst still maintaining the original loop count value for when it is next started.
+
+#### AUTO_SCROLL_GAP
+
+This specifies the amount of whitespace to display before the scrolling text is shown again.
+
+This will be increased if the given value is not large enough to prevent the same bit of text being visible at two locations in the control.
+
+Provide the distance in pixels.
+
+### Scroll Direction
+
+The scroll direction is choosen automatically with the following rules:
+
+If the text is single-lined it will scroll left when the text is Left to Right (LTR) or scroll right if text is Right to Left (RTL).
+
+If the text is multi-lined it will scroll upwards. ( Not supported at 1.1.35 )
+
+### Text Label Scrolling Properties
+
+The properties used by TextLabel for Auto Scrolling are listed [here](@ref TextLabelProperties)
+
+@class TextLabel_Scrolling
+
+*/
index 5247e92..ae03364 100644 (file)
@@ -316,27 +316,16 @@ label1.underlineHeight = 1;
 ![ ](../assets/img/text-controls/TextWith1pxUnderline.png)
 ![ ](TextWith1pxUnderline.png)
 
-### Text Label Properties
+### Auto Scrolling
+
+![ ](../assets/img/text-controls/AutoScroll.gif)
+![ ](AutoScroll.gif)
 
- Name (JavaScript)   |  Name (C++)          |  Type        | Writable     | Animatable
----------------------|----------------------|--------------|--------------|-----------
- renderingBackend    | RENDERING_BACKEND    |  INTEGER     | O            | X
- text                | TEXT                 |  STRING      | O            | X
- fontFamily          | FONT_FAMILY          |  STRING      | O            | X
- fontStyle           | FONT_STYLE           |  STRING      | O            | X
- pointSize           | POINT_SIZE           |  FLOAT       | O            | X
- multiLine           | MULTI_LINE           |  BOOLEAN     | O            | X
- horizontalAlignment | HORIZONTAL_ALIGNMENT |  STRING      | O            | X
- verticalAlignment   | VERTICAL_ALIGNMENT   |  STRING      | O            | X
- textColor           | TEXT_COLOR           |  VECTOR4     | O            | X
- shadowOffset        | SHADOW_OFFSET        |  VECTOR2     | O            | X
- shadowColor         | SHADOW_COLOR         |  VECTOR4     | O            | X
- underlineEnabled    | UNDERLINE_ENABLED    |  BOOLEAN     | O            | X
- underlineColor      | UNDERLINE_COLOR      |  VECTOR4     | O            | X
- underlineHeight     | UNDERLINE_HEIGHT     |  FLOAT       | O            | X
- enableMarkup        | ENABLE_MARKUP        |  BOOLEAN     | O            | X
+The \link text-auto-scrolling Auto text scrolling \endlink section details how to scroll text automatically.
 
+### Text Label Properties
 
+The properties used by TextLabel are listed [here](@ref TextLabelProperties)
 
 @class TextLabel
 
index 81964d9..467d2a2 100644 (file)
@@ -48,7 +48,7 @@ daliApp.init = function() {
   toolBar.backgroundColor = dali.COLOR_CYAN;
   toolBar.flexDirection = "row"; // display toolbar items horizontally
   toolBar.alignItems = "center"; // align toolbar items vertically center
-  toolBar.registerCustomProperty("flex", 0.1, dali.PROPERTY_READ_WRITE); // 10 percent of available space in the cross axis
+  toolBar.flex = 0.1; // 10 percent of available space in the cross axis
 
   flexContainer.add(toolBar);
 
@@ -59,7 +59,7 @@ daliApp.init = function() {
   content.flexDirection = "row";
   content.alignItems = "center"; // align items vertically center
   content.justifyContent = "center"; // align items horizontally center
-  content.registerCustomProperty("flex", 0.9, dali.PROPERTY_READ_WRITE); // 90 percent of available space in the cross axis
+  content.flex = 0.9; // 90 percent of available space in the cross axis
 
   flexContainer.add(content);
 
@@ -70,7 +70,7 @@ daliApp.init = function() {
   prevButton.anchorPoint = dali.TOP_LEFT;
   prevButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
   prevButton.labelText = "Prev";
-  prevButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+  prevButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
 
   toolBar.add( prevButton );
 
@@ -84,8 +84,8 @@ daliApp.init = function() {
   title.verticalAlignment = "CENTER";
   title.text = "Gallery";
   title.pointSize = 28;
-  title.registerCustomProperty("flex", 1.0, dali.PROPERTY_READ_WRITE); // take all the available space left apart from the two buttons
-  title.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the title
+  title.flex = 1.0; // take all the available space left apart from the two buttons
+  title.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the title
 
   toolBar.add( title );
 
@@ -96,7 +96,7 @@ daliApp.init = function() {
   nextButton.anchorPoint = dali.TOP_LEFT;
   nextButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
   nextButton.labelText = "Next";
-  nextButton.registerCustomProperty("flexMargin", [10, 10, 10, 10], dali.PROPERTY_READ_WRITE); // set 10 pixel margin around the button
+  nextButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
 
   toolBar.add( nextButton );
 
index d558701..1195129 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.34
+Version:    1.1.36
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
@@ -87,7 +87,14 @@ 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=%{dali_toolkit_profile} --with-style=%{dali_style_folder} --enable-i18n=yes
+
+%configure --enable-profile=%{dali_toolkit_profile} \
+           --with-style=%{dali_style_folder} \
+%if 0%{?enable_debug}
+           --enable-debug \
+%endif
+           --enable-i18n=yes
+
 make %{?jobs:-j%jobs}
 
 ##############################
index 0c993d4..9255574 100644 (file)
@@ -18,6 +18,9 @@
 // CLASS HEADER
 #include "module-loader.h"
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
+
 // INTERNAL INCLUDES
 #include <v8-utils.h>
 
index be1739d..fed77ce 100644 (file)
@@ -179,8 +179,14 @@ void HandleWrapper::PropertySet( v8::Local<v8::String> propertyName,
   }
   else
   {
-    std::string error="Invalid property Set for "+name + "\n";
-    DALI_SCRIPT_EXCEPTION( isolate, error );
+    // Trying to set the value for a property that is not registered yet.
+    std::stringstream msg;
+    msg << "Trying to set the value of an unregistered property: ";
+    msg << name;
+    DALI_SCRIPT_WARNING( msg.str().c_str() );
+
+    // Register the custom property automatically.
+    handle.RegisterProperty( name, PropertyValueWrapper::ExtractPropertyValue( isolate, javaScriptValue), Property::READ_WRITE );
   }
 }
 
index 8469d7f..b160642 100644 (file)
@@ -785,6 +785,62 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i
   return daliPropertyValue;
 }
 
+Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* isolate, v8::Local< v8::Value> v8Value)
+{
+  v8::HandleScope handleScope( isolate);
+
+  Dali::Property::Value daliPropertyValue;
+
+  // Check if it's a javascript Array
+  Dali::Property::Value array = VectorOrMatrixFromV8Array( isolate, v8Value );
+
+  if( V8Utils::IsBooleanPrimitiveOrObject( v8Value ) )
+  {
+    daliPropertyValue = Dali::Property::Value( V8Utils::GetBooleanValue( isolate, v8Value));
+  }
+  else if( V8Utils::IsNumberPrimitiveOrObject( v8Value )  )
+  {
+    daliPropertyValue = Dali::Property::Value( V8Utils::GetNumberValue( isolate, v8Value) );
+  }
+  else if( v8Value->IsInt32() )
+  {
+    daliPropertyValue = Dali::Property::Value(  v8Value->Int32Value()  ) ;
+  }
+  else if( V8Utils::IsStringPrimitiveOrObject( v8Value) )
+  {
+    daliPropertyValue = Dali::Property::Value( V8Utils::GetStringValue( isolate, v8Value) );
+  }
+  else if( array.GetType() == Dali::Property::VECTOR2
+         || array.GetType() == Dali::Property::VECTOR3
+         || array.GetType() == Dali::Property::VECTOR4 )
+  {
+    daliPropertyValue = array;
+  }
+  else if( array.GetType() == Dali::Property::MATRIX )
+  {
+    Dali::Matrix mat = array.Get<Dali::Matrix>();
+    daliPropertyValue = mat;
+  }
+  else if( array.GetType() == Dali::Property::MATRIX3 )
+  {
+    Dali::Matrix3 mat = array.Get<Dali::Matrix3>();
+    daliPropertyValue = mat;
+  }
+  else if( array.GetType() == Dali::Property::ARRAY )
+  {
+    daliPropertyValue = ArrayFromV8Array( isolate, v8Value );
+  }
+  else if( v8Value->IsObject() )
+  {
+    // Assume this is a property map
+    v8::Local<v8::Object> object = v8::Handle<v8::Object>::Cast(v8Value);
+    Dali::Property::Map propertyMap = V8Utils::GetPropertyMapFromObject(isolate, object);
+    daliPropertyValue = Dali::Property::Value( propertyMap );
+  }
+
+  return daliPropertyValue;
+}
+
 void PropertyValueWrapper::NewRotation( const v8::FunctionCallbackInfo< v8::Value >& args)
 {
   v8::Isolate* isolate = args.GetIsolate();
index 8cb2dac..05a3e38 100644 (file)
@@ -90,6 +90,12 @@ public:
   static Dali::Property::Value ExtractPropertyValue( v8::Isolate* isolate, v8::Local< v8::Value> v8Value, Dali::Property::Type type);
 
   /**
+   * Extract a property value from a javascript object
+   * @return property value
+   */
+  static Dali::Property::Value ExtractPropertyValue( v8::Isolate* isolate, v8::Local< v8::Value> v8Value);
+
+  /**
    * @brief Extract a vector or a matrix from a JavaScript array
    * @return property value ( vector or matrix)
    */
index b77d458..193836d 100644 (file)
@@ -378,8 +378,6 @@ std::string PropertyNameToJavaScriptName(const std::string& hyphenatedName)
   return ret;
 }
 
-
-
 void ScriptError( const char* function, v8::Isolate* isolate, std::string errorString )
 {
   v8::EscapableHandleScope scope( isolate);
@@ -393,6 +391,12 @@ void ScriptError( const char* function, v8::Isolate* isolate, std::string errorS
   isolate->ThrowException( v8::String::NewFromUtf8( isolate, errorMsg.c_str()) );
 }
 
+void ScriptWarning( const char* function, std::string warningString )
+{
+  std::string warningMsg = std::string(function) + std::string("(), ") + warningString;
+  DALI_LOG_WARNING("%s \n", warningMsg.c_str() );
+}
+
 bool IsBooleanPrimitiveOrObject( const v8::Local<v8::Value>& value )
 {
   return ( value->IsBoolean() || value->IsBooleanObject());
@@ -504,6 +508,13 @@ Property::Value GetPropertyValueFromObject( bool& found, v8::Isolate* isolate, c
     v8::Local<v8::Int32> v = value->ToInt32();
     return Dali::Property::Value(static_cast<int>(v->Value()));
   }
+  else if( value->IsString() )
+  {
+    found = true;
+    std::string valueString = V8Utils::v8StringToStdString( value );
+    return Dali::Property::Value(valueString);
+  }
+
   return daliPropertyValue;
 
 }
index 5a86f39..63ff2c6 100644 (file)
@@ -50,6 +50,7 @@ enum
 };
 
 #define DALI_SCRIPT_EXCEPTION( isolate, message ) V8Utils::ScriptError( __FUNCTION__ , isolate, message );
+#define DALI_SCRIPT_WARNING( message ) V8Utils::ScriptWarning( __FUNCTION__ , message );
 
 namespace V8Utils
 {
@@ -146,6 +147,11 @@ std::string GetJavaScriptFunctionName(  const char* functionName );
 void ScriptError( const char* function, v8::Isolate* isolate, std::string errorString );
 
 /**
+ * Script warning
+ */
+void ScriptWarning( const char* function, std::string warningString );
+
+/**
  * @return in the value is a boolean primitive or a boolean object
  */
 bool IsBooleanPrimitiveOrObject( const v8::Local<v8::Value>& value );