[dali_1.1.36] Merge branch 'devel/master' 96/71896/1
authorRichard Huang <r.huang@samsung.com>
Fri, 27 May 2016 11:21:50 +0000 (12:21 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 27 May 2016 11:21:50 +0000 (12:21 +0100)
Change-Id: I6a67d3a02dd57479adfc9fc26f6083c0b1c0e36b

59 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/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/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
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/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/control-renderer-data-impl.h
dali-toolkit/internal/controls/renderers/control-renderer-impl.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-impl.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-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/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp
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/dali-toolkit-version.cpp
docs/content/main.md
docs/content/programming-guide/properties.h
docs/content/shared-javascript-and-cpp-documentation/flex-container.md
node-addon/examples/flex-container.js
packaging/dali-toolkit.spec

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 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 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 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 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 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 88724e0..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>
@@ -600,29 +600,38 @@ void FlexContainer::ComputeLayout()
       // These properties should be dynamically registered to the child which
       // would be added to FlexContainer.
 
-      childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get<float>();
-
-      Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO );
-      Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF );
-      if( alignSelfPropertyValue.GetType() == Property::INTEGER )
+      if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX ) != Property::NONE )
       {
-        alignSelf = static_cast<Toolkit::FlexContainer::Alignment>( alignSelfPropertyValue.Get< int >() );
+        childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get<float>();
       }
-      else if( alignSelfPropertyValue.GetType() == Property::STRING )
+
+      Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO );
+      if( childActor.GetPropertyType( Toolkit::FlexContainer::FlexContainer::ChildProperty::ALIGN_SELF ) != Property::NONE )
       {
-        std::string value = alignSelfPropertyValue.Get<std::string>();
-        Scripting::GetEnumeration< Toolkit::FlexContainer::Alignment >( value.c_str(),
-                                                                        ALIGN_SELF_STRING_TABLE,
-                                                                        ALIGN_SELF_STRING_TABLE_COUNT,
-                                                                        alignSelf );
+        Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF );
+        if( alignSelfPropertyValue.GetType() == Property::INTEGER )
+        {
+          alignSelf = static_cast<Toolkit::FlexContainer::Alignment>( alignSelfPropertyValue.Get< int >() );
+        }
+        else if( alignSelfPropertyValue.GetType() == Property::STRING )
+        {
+          std::string value = alignSelfPropertyValue.Get<std::string>();
+          Scripting::GetEnumeration< Toolkit::FlexContainer::Alignment >( value.c_str(),
+                                                                          ALIGN_SELF_STRING_TABLE,
+                                                                          ALIGN_SELF_STRING_TABLE_COUNT,
+                                                                          alignSelf );
+        }
       }
       childNode->style.align_self = static_cast<css_align_t>(alignSelf);
 
-      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;
-      childNode->style.margin[CSS_BOTTOM] = flexMargin.w;
+      if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ) != Property::NONE )
+      {
+        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;
+        childNode->style.margin[CSS_BOTTOM] = flexMargin.w;
+      }
     }
 
     // Calculate the layout
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 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 90dd616..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");
@@ -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 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 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 32afaf0..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
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 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 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 3a31a49..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>
 
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>
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 5f42b15..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 = 35;
+const unsigned int TOOLKIT_MICRO_VERSION = 36;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
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 056ea1e..09392c8 100644 (file)
@@ -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);
 
 ~~~
@@ -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();
@@ -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);
@@ -534,7 +534,7 @@ toolBar.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 0.1f );
 
 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.
@@ -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);
@@ -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 );
 ~~~
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 c80971f..1195129 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.35
+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}
 
 ##############################