Merge "Implemented n-patch rendering for NPatchRenderer." into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 13 Oct 2015 14:03:57 +0000 (07:03 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 13 Oct 2015 14:03:57 +0000 (07:03 -0700)
93 files changed:
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-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/renderer-factory-cache.cpp
dali-toolkit/internal/controls/renderers/renderer-factory-cache.h
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/images/cursor_handler_drop_center.png [moved from dali-toolkit/images/cursor_handler_drop_center.png with 100% similarity]
dali-toolkit/styles/480x800/images/selection_handle_drop_left.png [moved from dali-toolkit/images/selection_handle_drop_left.png with 100% similarity]
dali-toolkit/styles/480x800/images/selection_handle_drop_right.png [moved from dali-toolkit/images/selection_handle_drop_right.png with 100% similarity]
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/images/cursor_handler_drop_center.png [new file with mode: 0644]
dali-toolkit/styles/720x1280/images/selection_handle_drop_left.png [new file with mode: 0644]
dali-toolkit/styles/720x1280/images/selection_handle_drop_right.png [new file with mode: 0644]
dali-toolkit/styles/file.list
dali-toolkit/styles/images-common/00_popup_bg.9.png [moved from dali-toolkit/images/00_popup_bg.9.png with 100% similarity]
dali-toolkit/styles/images-common/00_popup_bg.png [moved from dali-toolkit/images/00_popup_bg.png with 100% similarity]
dali-toolkit/styles/images-common/00_popup_bottom_bg.png [moved from dali-toolkit/images/00_popup_bottom_bg.png with 100% similarity]
dali-toolkit/styles/images-common/00_popup_bubble_bg.png [moved from dali-toolkit/images/00_popup_bubble_bg.png with 100% similarity]
dali-toolkit/styles/images-common/00_popup_bubble_tail_bottom.png [moved from dali-toolkit/images/00_popup_bubble_tail_bottom.png with 100% similarity]
dali-toolkit/styles/images-common/00_popup_button_bg.png [moved from dali-toolkit/images/00_popup_button_bg.png with 100% similarity]
dali-toolkit/styles/images-common/00_popup_button_pressed.png [moved from dali-toolkit/images/00_popup_button_pressed.png with 100% similarity]
dali-toolkit/styles/images-common/B16-8_TTS_focus.png [moved from dali-toolkit/images/B16-8_TTS_focus.png with 100% similarity]
dali-toolkit/styles/images-common/button-disabled.9.png [moved from dali-toolkit/images/button-disabled.9.png with 100% similarity]
dali-toolkit/styles/images-common/button-down-disabled.9.png [moved from dali-toolkit/images/button-down-disabled.9.png with 100% similarity]
dali-toolkit/styles/images-common/button-down.9.png [moved from dali-toolkit/images/button-down.9.png with 100% similarity]
dali-toolkit/styles/images-common/button-up.9.png [moved from dali-toolkit/images/button-up.9.png with 100% similarity]
dali-toolkit/styles/images-common/checkbox-selected-diabled.png [moved from dali-toolkit/images/checkbox-selected-diabled.png with 100% similarity]
dali-toolkit/styles/images-common/checkbox-selected.png [moved from dali-toolkit/images/checkbox-selected.png with 100% similarity]
dali-toolkit/styles/images-common/checkbox-unselected-disabled.png [moved from dali-toolkit/images/checkbox-unselected-disabled.png with 100% similarity]
dali-toolkit/styles/images-common/checkbox-unselected.png [moved from dali-toolkit/images/checkbox-unselected.png with 100% similarity]
dali-toolkit/styles/images-common/copy_paste_icon_clipboard.png [moved from dali-toolkit/images/copy_paste_icon_clipboard.png with 100% similarity]
dali-toolkit/styles/images-common/copy_paste_icon_copy.png [moved from dali-toolkit/images/copy_paste_icon_copy.png with 100% similarity]
dali-toolkit/styles/images-common/copy_paste_icon_cut.png [moved from dali-toolkit/images/copy_paste_icon_cut.png with 100% similarity]
dali-toolkit/styles/images-common/copy_paste_icon_paste.png [moved from dali-toolkit/images/copy_paste_icon_paste.png with 100% similarity]
dali-toolkit/styles/images-common/copy_paste_icon_select.png [moved from dali-toolkit/images/copy_paste_icon_select.png with 100% similarity]
dali-toolkit/styles/images-common/copy_paste_icon_select_all.png [moved from dali-toolkit/images/copy_paste_icon_select_all.png with 100% similarity]
dali-toolkit/styles/images-common/cursor_handler_ball_center.png [moved from dali-toolkit/images/cursor_handler_ball_center.png with 100% similarity]
dali-toolkit/styles/images-common/file.list [moved from dali-toolkit/images/file.list with 100% similarity]
dali-toolkit/styles/images-common/insertpoint-icon-pressed.png [moved from dali-toolkit/images/insertpoint-icon-pressed.png with 100% similarity]
dali-toolkit/styles/images-common/insertpoint-icon.png [moved from dali-toolkit/images/insertpoint-icon.png with 100% similarity]
dali-toolkit/styles/images-common/keyboard_focus.png [moved from dali-toolkit/images/keyboard_focus.png with 100% similarity]
dali-toolkit/styles/images-common/magnifier.png [moved from dali-toolkit/images/magnifier.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bg.png [moved from dali-toolkit/images/popup_bg.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_bg.#.png [moved from dali-toolkit/images/popup_bubble_bg.#.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_bg_ef.#.png [moved from dali-toolkit/images/popup_bubble_bg_ef.#.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_bg_line.#.png [moved from dali-toolkit/images/popup_bubble_bg_line.#.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_tail_bottom.png [moved from dali-toolkit/images/popup_bubble_tail_bottom.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_tail_bottom_ef.png [moved from dali-toolkit/images/popup_bubble_tail_bottom_ef.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_tail_bottom_line.png [moved from dali-toolkit/images/popup_bubble_tail_bottom_line.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_tail_top.png [moved from dali-toolkit/images/popup_bubble_tail_top.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_tail_top_ef.png [moved from dali-toolkit/images/popup_bubble_tail_top_ef.png with 100% similarity]
dali-toolkit/styles/images-common/popup_bubble_tail_top_line.png [moved from dali-toolkit/images/popup_bubble_tail_top_line.png with 100% similarity]
dali-toolkit/styles/images-common/popup_scroll.png [moved from dali-toolkit/images/popup_scroll.png with 100% similarity]
dali-toolkit/styles/images-common/popup_tail_down.png [moved from dali-toolkit/images/popup_tail_down.png with 100% similarity]
dali-toolkit/styles/images-common/popup_tail_left.png [moved from dali-toolkit/images/popup_tail_left.png with 100% similarity]
dali-toolkit/styles/images-common/popup_tail_right.png [moved from dali-toolkit/images/popup_tail_right.png with 100% similarity]
dali-toolkit/styles/images-common/popup_tail_up.png [moved from dali-toolkit/images/popup_tail_up.png with 100% similarity]
dali-toolkit/styles/images-common/radio-button-selected-disabled.png [moved from dali-toolkit/images/radio-button-selected-disabled.png with 100% similarity]
dali-toolkit/styles/images-common/radio-button-selected.png [moved from dali-toolkit/images/radio-button-selected.png with 100% similarity]
dali-toolkit/styles/images-common/radio-button-unselected-disabled.png [moved from dali-toolkit/images/radio-button-unselected-disabled.png with 100% similarity]
dali-toolkit/styles/images-common/radio-button-unselected.png [moved from dali-toolkit/images/radio-button-unselected.png with 100% similarity]
dali-toolkit/styles/images-common/selection-popup-bg.9.png [moved from dali-toolkit/images/selection-popup-bg.9.png with 100% similarity]
dali-toolkit/styles/images-common/selection_handle_ball_left.png [moved from dali-toolkit/images/selection_handle_ball_left.png with 100% similarity]
dali-toolkit/styles/images-common/selection_handle_ball_right.png [moved from dali-toolkit/images/selection_handle_ball_right.png with 100% similarity]
dali-toolkit/styles/images-common/selection_marker_left.png [moved from dali-toolkit/images/selection_marker_left.png with 100% similarity]
dali-toolkit/styles/images-common/selection_marker_right.png [moved from dali-toolkit/images/selection_marker_right.png with 100% similarity]
dali-toolkit/styles/images-common/slider-popup-arrow.png [moved from dali-toolkit/images/slider-popup-arrow.png with 100% similarity]
dali-toolkit/styles/images-common/slider-popup.9.png [moved from dali-toolkit/images/slider-popup.9.png with 100% similarity]
dali-toolkit/styles/images-common/slider-popup.png [moved from dali-toolkit/images/slider-popup.png with 100% similarity]
dali-toolkit/styles/images-common/slider-skin-handle.png [moved from dali-toolkit/images/slider-skin-handle.png with 100% similarity]
dali-toolkit/styles/images-common/slider-skin-progress.9.png [moved from dali-toolkit/images/slider-skin-progress.9.png with 100% similarity]
dali-toolkit/styles/images-common/slider-skin-progress.png [moved from dali-toolkit/images/slider-skin-progress.png with 100% similarity]
dali-toolkit/styles/images-common/slider-skin.9.png [moved from dali-toolkit/images/slider-skin.9.png with 100% similarity]
dali-toolkit/styles/images-common/slider-skin.png [moved from dali-toolkit/images/slider-skin.png with 100% similarity]
dali-toolkit/styles/images-common/text-input-selection-handle-left-press.png [moved from dali-toolkit/images/text-input-selection-handle-left-press.png with 100% similarity]
dali-toolkit/styles/images-common/text-input-selection-handle-left.png [moved from dali-toolkit/images/text-input-selection-handle-left.png with 100% similarity]
dali-toolkit/styles/images-common/text-input-selection-handle-right-press.png [moved from dali-toolkit/images/text-input-selection-handle-right-press.png with 100% similarity]
dali-toolkit/styles/images-common/text-input-selection-handle-right.png [moved from dali-toolkit/images/text-input-selection-handle-right.png with 100% similarity]
docs/content/main.md
docs/content/programming-guide/styling.h [new file with mode: 0644]
packaging/dali-toolkit.spec

index b85524d..2c49895 100644 (file)
@@ -704,11 +704,11 @@ int UtcDaliItemViewReplaceItemsP(void)
 
   for( unsigned int i = 0u; i < 10; ++i )
   {
-    Actor child = view.GetChildAt( i );
+    Actor child = view.GetItem( i );
     Actor newActor = Actor::New();
     newActor.SetName("Replaced");
 
-    replaceList.push_back( Item( view.GetItemId(child), newActor ) );
+    replaceList.push_back( Item( i, newActor ) );
   }
 
   if( !replaceList.empty() )
index cf3e163..dd631c6 100644 (file)
@@ -882,6 +882,7 @@ int UtcDaliToolkitScrollViewScrollSensitive(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
+  scrollView.SetOvershootEnabled(true);
   Stage::GetCurrent().Add( scrollView );
   Vector2 stageSize = Stage::GetCurrent().GetSize();
   scrollView.SetSize(stageSize);
@@ -1093,6 +1094,7 @@ int UtcDaliToolkitScrollViewOvershoot(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
+  scrollView.SetOvershootEnabled(true);
   Stage::GetCurrent().Add( scrollView );
   Vector2 stageSize = Stage::GetCurrent().GetSize();
   scrollView.SetSize(stageSize);
index 75d8ca4..50bd34e 100644 (file)
 
 # Build the Dali Toolkit library
 
-toolkit_images_dir = ../../../dali-toolkit/images
+toolkit_images_dir = ../../../dali-toolkit/styles/images-common
 toolkit_sounds_dir = ../../../dali-toolkit/sounds
 toolkit_src_dir    = ../../../dali-toolkit/internal
 public_api_src_dir = ../../../dali-toolkit/public-api
 devel_api_src_dir  = ../../../dali-toolkit/devel-api
 
 toolkit_styles_dir = $(STYLE_DIR)
+toolkit_style_images_dir = $(STYLE_DIR)/images
 
-include ../../../dali-toolkit/images/file.list
 include ../../../dali-toolkit/sounds/file.list
 include ../../../dali-toolkit/styles/file.list
+include ../../../dali-toolkit/styles/images-common/file.list
 include ../../../dali-toolkit/internal/file.list
 include ../../../dali-toolkit/public-api/file.list
 include ../../../dali-toolkit/devel-api/file.list
@@ -52,12 +53,16 @@ libdali_toolkit_la_SOURCES = \
 dalistyledir = ${dataReadOnlyDir}/toolkit/styles/
 dalistyle_DATA = ${dali_toolkit_style_files}
 
+dalistyleimagesdir = ${dataReadOnlyDir}/toolkit/styles/images/
+dalistyleimages_DATA = ${dali_toolkit_style_images}
+
 libdali_toolkit_la_DEPENDENCIES =
 
 libdali_toolkit_la_CXXFLAGS = -DDALI_COMPILATION \
                       -DDALI_IMAGE_DIR="\"${daliimagedir}\"" \
                       -DDALI_SOUND_DIR="\"${dalisounddir}\"" \
                       -DDALI_STYLE_DIR="\"${dalistyledir}\"" \
+                      -DDALI_STYLE_IMAGE_DIR="\"${dalistyleimagesdir}\"" \
                       -DDALI_DATA_READ_ONLY_DIR="\"${dataReadOnlyDir}\"" \
                       -Werror -Wall \
                       -I../../../ \
index 4ea4aee..11b92f6 100644 (file)
@@ -1363,6 +1363,7 @@ Builder::Builder()
   defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ]  = DALI_IMAGE_DIR;
   defaultDirs[ TOKEN_STRING(DALI_SOUND_DIR) ]  = DALI_SOUND_DIR;
   defaultDirs[ TOKEN_STRING(DALI_STYLE_DIR) ] = DALI_STYLE_DIR;
+  defaultDirs[ TOKEN_STRING(DALI_STYLE_IMAGE_DIR) ] = DALI_STYLE_IMAGE_DIR;
 
   AddConstants( defaultDirs );
 }
index 5da6110..ddbb242 100644 (file)
@@ -326,32 +326,6 @@ void GaussianBlurView::OnInitialize()
 }
 
 
-/**
- * ZrelativeToYconstraint
- *
- * f(current, property, scale) = Vector3(current.x, current.y, property.y * scale)
- */
-struct ZrelativeToYconstraint
-{
-  ZrelativeToYconstraint( float scale )
-    : mScale( scale )
-  {}
-
-  Vector3 operator()(const Vector3&    current,
-                     const PropertyInput& property)
-  {
-    Vector3 v;
-
-    v.x = current.x;
-    v.y = current.y;
-    v.z = property.GetVector3().y * mScale;
-
-    return v;
-  }
-
-  float mScale;
-};
-
 void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
index c080be2..c616669 100644 (file)
@@ -48,7 +48,6 @@ struct Internal::ControlRenderer::Impl
   };
 
   std::string mCachedRendererKey;  ///< The key to use for caching of the renderer. If it is empty then no caching will occur
-  RendererFactoryCache::CachedRendererPtr mCachedRenderer; ///< The current cached renderer from the Factory Cache. mCachedRenderer == null whilst this control render is offstage
   Renderer mRenderer;
 
   CustomShader* mCustomShader;
index 18374e1..990182c 100644 (file)
@@ -133,19 +133,15 @@ void ControlRenderer::SetCachedRendererKey( const std::string& cachedRendererKey
   }
   else
   {
-    //remove the cached renderer from the cache if we and the cache are the only things that hold a reference to it
-    if( mImpl->mCachedRenderer && mImpl->mCachedRenderer->ReferenceCount() == 2 )
-    {
-      mFactoryCache.RemoveRenderer( mImpl->mCachedRenderer->mKey );
-    }
-    mImpl->mCachedRenderer.Reset();
+    //clean the renderer from the cache since it may no longer be in use
+    mFactoryCache.CleanRendererCache( mImpl->mCachedRendererKey );
 
     //add the new renderer
     mImpl->mCachedRendererKey = cachedRendererKey;
     if( !mImpl->mCachedRendererKey.empty() && !mImpl->mCustomShader )
     {
       DALI_ASSERT_DEBUG( mImpl->mRenderer && "The control render is on stage but it doesn't have a valid renderer.");
-      mImpl->mCachedRenderer = mFactoryCache.SaveRenderer( mImpl->mCachedRendererKey, mImpl->mRenderer );
+      mFactoryCache.SaveRenderer( mImpl->mCachedRendererKey, mImpl->mRenderer );
     }
   }
 }
@@ -154,16 +150,11 @@ void ControlRenderer::SetOnStage( Actor& actor )
 {
   if( !mImpl->mCachedRendererKey.empty() && !mImpl->mCustomShader )
   {
-    mImpl->mCachedRenderer = mFactoryCache.GetRenderer( mImpl->mCachedRendererKey );
-    if( !mImpl->mCachedRenderer || !mImpl->mCachedRenderer->mRenderer )
+    mImpl->mRenderer = mFactoryCache.GetRenderer( mImpl->mCachedRendererKey );
+    if( !mImpl->mRenderer )
     {
       InitializeRenderer( mImpl->mRenderer );
-      mImpl->mCachedRenderer = mFactoryCache.SaveRenderer( mImpl->mCachedRendererKey, mImpl->mRenderer );
-    }
-
-    if( mImpl->mCachedRenderer && mImpl->mCachedRenderer->mRenderer )
-    {
-      mImpl->mRenderer = mImpl->mCachedRenderer->mRenderer;
+      mFactoryCache.SaveRenderer( mImpl->mCachedRendererKey, mImpl->mRenderer );
     }
   }
 
@@ -184,17 +175,12 @@ void ControlRenderer::SetOffStage( Actor& actor )
   if( mImpl->mIsOnStage )
   {
     DoSetOffStage( actor );
-
-    //remove the cached renderer from the cache if we and the cache are the only things that hold a reference to it
-    if( mImpl->mCachedRenderer && mImpl->mCachedRenderer->ReferenceCount() == 2 )
-    {
-      mFactoryCache.RemoveRenderer( mImpl->mCachedRenderer->mKey );
-    }
-    mImpl->mCachedRenderer.Reset();
-
     actor.RemoveRenderer( mImpl->mRenderer );
     mImpl->mRenderer.Reset();
 
+    //clean the renderer from the cache since it may no longer be in use
+    mFactoryCache.CleanRendererCache( mImpl->mCachedRendererKey );
+
     mImpl->mIsOnStage = false;
   }
 }
index a22f541..c7b53b6 100644 (file)
@@ -73,7 +73,7 @@ int RendererFactoryCache::FindRenderer( const std::string& key ) const
     if( it != mRendererHashes.End() )
     {
       int index = it - mRendererHashes.Begin();
-      const CachedRendererPtr& cachedRenderer = mRenderers[ index ];
+      const CachedRenderer* cachedRenderer = mRenderers[ index ];
 
       if( cachedRenderer && cachedRenderer->mKey == key )
       {
@@ -90,47 +90,51 @@ int RendererFactoryCache::FindRenderer( const std::string& key ) const
   return -1;
 }
 
-RendererFactoryCache::CachedRendererPtr RendererFactoryCache::GetRenderer( const std::string& key ) const
+Renderer RendererFactoryCache::GetRenderer( const std::string& key ) const
 {
   int index = FindRenderer( key );
   if( index != -1 )
   {
-    return mRenderers[ index ];
+    return mRenderers[ index ]->mRenderer.GetHandle();
   }
   else
   {
-    return CachedRendererPtr();
+    return Renderer();
   }
 }
 
-RendererFactoryCache::CachedRendererPtr RendererFactoryCache::SaveRenderer( const std::string& key, Renderer& renderer )
+void RendererFactoryCache::SaveRenderer( const std::string& key, Renderer& renderer )
 {
   int hash = Dali::CalculateHash( key );
-  CachedRendererPtr newCachedRenderer = new CachedRenderer( key, renderer );
+  const CachedRenderer* cachedRenderer = new CachedRenderer( key, renderer );
 
-  CachedRenderers::iterator it = std::find(mRenderers.begin(), mRenderers.end(), CachedRendererPtr() );
-  if( it != mRenderers.end() )
+  CachedRenderers::Iterator it = std::find( mRenderers.Begin(), mRenderers.End(), static_cast< CachedRenderer* >( NULL ) );
+  if( it != mRenderers.End() )
   {
-    *it = newCachedRenderer;
-    int index = it - mRenderers.begin();
+    *it = cachedRenderer;
+    int index = it - mRenderers.Begin();
     mRendererHashes[ index ] = hash;
   }
   else
   {
     mRendererHashes.PushBack( hash );
-    mRenderers.push_back( newCachedRenderer );
+    mRenderers.PushBack( cachedRenderer );
   }
-
-  return newCachedRenderer;
 }
 
-void RendererFactoryCache::RemoveRenderer( const std::string& key )
+void RendererFactoryCache::CleanRendererCache( const std::string& key )
 {
   int index = FindRenderer( key );
   if( index != -1 )
   {
-    mRendererHashes[ index ] = Dali::CalculateHash( "" );
-    mRenderers[ index ].Reset();
+    const CachedRenderer*& cachedRenderer = mRenderers[ index ];
+    if( !cachedRenderer->mRenderer.GetHandle() )
+    {
+      mRendererHashes[ index ] = Dali::INITIAL_HASH_VALUE;
+
+      delete cachedRenderer;
+      cachedRenderer = NULL;
+    }
   }
 }
 
index f546c85..947fd47 100644 (file)
@@ -24,6 +24,9 @@
 #include <dali/devel-api/rendering/geometry.h>
 #include <dali/devel-api/rendering/shader.h>
 #include <dali/devel-api/rendering/renderer.h>
+#include <dali/devel-api/common/owner-container.h>
+#include <dali/devel-api/object/weak-handle.h>
+
 
 namespace Dali
 {
@@ -110,25 +113,13 @@ public:
   static Geometry CreateQuadGeometry();
 
 public:
-  struct CachedRenderer : RefObject
-  {
-    std::string mKey;
-    Renderer mRenderer;
-
-    CachedRenderer( const std::string& key, const Renderer& renderer )
-    : mKey( key ),
-      mRenderer( renderer )
-    {}
-  };
-
-  typedef IntrusivePtr< CachedRenderer > CachedRendererPtr;
 
   /**
    * @brief Request renderer from the url
    *
-   * @return The cached renderer if exist in the cache. Otherwise null is returned.
+   * @return The cached renderer if exist in the cache. Otherwise an empty handle is returned.
    */
-  CachedRendererPtr GetRenderer( const std::string& key ) const;
+  Renderer GetRenderer( const std::string& key ) const;
 
   /**
    * @brief Cache the renderer based on the given key.
@@ -138,17 +129,15 @@ public:
    *
    * @param[in] key The key to use for caching
    * @param[in] renderer The Renderer to be cached
-   *
-   * @return The cached renderer stored in the cache
    */
-  CachedRendererPtr SaveRenderer( const std::string& key, Renderer& renderer );
+  void SaveRenderer( const std::string& key, Renderer& renderer );
 
   /**
-   * @brief Removes the renderer from the cache based on the given key
+   * @brief Cleans the renderer cache by removing the renderer from the cache based on the given key if there are no longer any references to it
    *
    * @param[in] key The key used for caching
    */
-  void RemoveRenderer( const std::string& key );
+  void CleanRendererCache( const std::string& key );
 
 protected:
 
@@ -168,8 +157,19 @@ protected:
   RendererFactoryCache& operator=(const RendererFactoryCache& rhs);
 
 private:
+  struct CachedRenderer
+  {
+    std::string mKey;
+    WeakHandle< Renderer > mRenderer;
+
+    CachedRenderer( const std::string& key, Renderer& renderer )
+    : mKey( key ),
+      mRenderer( renderer)
+    {}
+  };
+
   typedef Dali::Vector< std::size_t > HashVector;
-  typedef std::vector< CachedRendererPtr > CachedRenderers;
+  typedef Dali::OwnerContainer< const CachedRenderer* > CachedRenderers;
 
   /**
    * @brief Finds the first index into the cached renderers from the url
index 89eb96e..9969f77 100644 (file)
@@ -39,7 +39,14 @@ namespace Internal
 namespace
 {
 // Bouncing effect is presented by stacked three layers with same color and opacity
-const Vector3 LAYER_HEIGHTS( 1.f, 27.f/42.f, 13.f/42.f);
+const float LAYER_HEIGHTS[5] =
+{
+  1.f,
+  26.f * 4.f/ 130.f,
+  26.f * 3.f / 130.f,
+  26.f * 2.f / 130.f,
+  26.f / 130.f
+};
 
 #define MAKE_SHADER(A)#A
 
@@ -77,33 +84,43 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex )
     Vector3 position2;
   };
   // 4 vertices 2 triangles per layer. The depth interval between each layer is 0.01
-  VertexPosition vertexData[12] = {
-    //bottom layer
+  VertexPosition vertexData[20] = {
+    // bottom layer
     { Vector3( -0.5f, -0.5f, 0.f ),  Vector3( -0.5f, -0.5f, 0.f )  },
     { Vector3( 0.5f, -0.5f, 0.f ),   Vector3( 0.5f, -0.5f, 0.f )   },
     { Vector3( -0.5f, -0.5f, 0.f ),  Vector3( -0.5f, -0.5f + LAYER_HEIGHTS[0], 0.f ) },
     { Vector3( 0.5f, -0.5f, 0.f ),   Vector3( 0.5f, -0.5f+ LAYER_HEIGHTS[0], 0.f )   },
-    // middle layer
+    // mid-bottom layer
     { Vector3( -0.5f, -0.5f, 0.01f ),  Vector3( -0.5f, -0.5f, 0.01f )  },
     { Vector3( 0.5f, -0.5f, 0.01f ),   Vector3( 0.5f, -0.5f, 0.01f )   },
     { Vector3( -0.5f, -0.5f, 0.01f ),  Vector3( -0.5f, -0.5f + LAYER_HEIGHTS[1], 0.01f ) },
     { Vector3( 0.5f, -0.5f, 0.01f ),   Vector3( 0.5f, -0.5f+ LAYER_HEIGHTS[1], 0.01f )   },
-    // top layer
+    // middle layer
     { Vector3( -0.5f, -0.5f, 0.02f ),  Vector3( -0.5f, -0.5f, 0.02f )  },
     { Vector3( 0.5f, -0.5f, 0.02f ),   Vector3( 0.5f, -0.5f, 0.02f )   },
     { Vector3( -0.5f, -0.5f, 0.02f ),  Vector3( -0.5f, -0.5f + LAYER_HEIGHTS[2], 0.02f ) },
-    { Vector3( 0.5f, -0.5f, 0.02f ),   Vector3( 0.5f, -0.5f+ LAYER_HEIGHTS[2], 0.02f )   }
+    { Vector3( 0.5f, -0.5f, 0.02f ),   Vector3( 0.5f, -0.5f+ LAYER_HEIGHTS[2], 0.02f )   },
+    // mid-top layer
+    { Vector3( -0.5f, -0.5f, 0.03f ),  Vector3( -0.5f, -0.5f, 0.03f )  },
+    { Vector3( 0.5f, -0.5f, 0.03f ),   Vector3( 0.5f, -0.5f, 0.03f )   },
+    { Vector3( -0.5f, -0.5f, 0.03f ),  Vector3( -0.5f, -0.5f + LAYER_HEIGHTS[3], 0.03f ) },
+    { Vector3( 0.5f, -0.5f, 0.03f ),   Vector3( 0.5f, -0.5f+ LAYER_HEIGHTS[3], 0.03f )   },
+    // top layer
+    { Vector3( -0.5f, -0.5f, 0.04f ),  Vector3( -0.5f, -0.5f, 0.04f )  },
+    { Vector3( 0.5f, -0.5f, 0.04f ),   Vector3( 0.5f, -0.5f, 0.04f )   },
+    { Vector3( -0.5f, -0.5f, 0.04f ),  Vector3( -0.5f, -0.5f + LAYER_HEIGHTS[4], 0.04f ) },
+    { Vector3( 0.5f, -0.5f, 0.04f ),   Vector3( 0.5f, -0.5f+ LAYER_HEIGHTS[4], 0.04f )   }
   };
   Property::Map vertexFormat;
   vertexFormat["aPosition1"] = Property::VECTOR3;
   vertexFormat["aPosition2"] = Property::VECTOR3;
-  PropertyBuffer vertices = PropertyBuffer::New( vertexFormat, 12u );
+  PropertyBuffer vertices = PropertyBuffer::New( vertexFormat, 20u );
   vertices.SetData( vertexData );
 
-  unsigned int indexData[18] = { 0,3,1,0,2,3,4,7,5,4,6,7,8,11,9,8,10,11 };
+  unsigned int indexData[30] = { 0,3,1,0,2,3,4,7,5,4,6,7,8,11,9,8,10,11,12,15,13,12,14,15,16,19,17,16,18,19};
   Property::Map indexFormat;
   indexFormat["indices"] = Property::INTEGER;
-  PropertyBuffer indices = PropertyBuffer::New( indexFormat, 18u );
+  PropertyBuffer indices = PropertyBuffer::New( indexFormat, 30u );
   indices.SetData( indexData );
 
   Geometry meshGeometry = Geometry::New();
index 9cb8aff..91a9f97 100644 (file)
@@ -71,7 +71,6 @@ const float DEFAULT_ANCHORING_DURATION = 1.0f;  // 1 second
 
 const float MILLISECONDS_PER_SECONDS = 1000.0f;
 
-const Vector2 OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE( 720.0f, 42.0f );
 const float OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD = 180.0f;
 const Vector4 OVERSHOOT_OVERLAY_NINE_PATCH_BORDER(0.0f, 0.0f, 1.0f, 12.0f);
 const float DEFAULT_KEYBOARD_FOCUS_SCROLL_DURATION = 0.2f;
@@ -90,23 +89,33 @@ float CalculateScrollDistance(Vector2 panDistance, Toolkit::ItemLayout& layout)
 }
 
 // Overshoot overlay constraints
-void OvershootOverlaySizeConstraint( Vector3& current, const PropertyInputContainer& inputs )
+struct OvershootOverlaySizeConstraint
 {
-  const Vector2& parentScrollDirection = inputs[0]->GetVector2();
-  const Toolkit::ControlOrientation::Type& layoutOrientation = static_cast<Toolkit::ControlOrientation::Type>(inputs[1]->GetInteger());
-  const Vector3& parentSize = inputs[2]->GetVector3();
-
-  if(Toolkit::IsVertical(layoutOrientation))
+  OvershootOverlaySizeConstraint( float height )
+  : mOvershootHeight( height )
   {
-    current.width = fabsf(parentScrollDirection.y) > Math::MACHINE_EPSILON_1 ? parentSize.x : parentSize.y;
   }
-  else
+
+  void operator()( Vector3& current, const PropertyInputContainer& inputs )
   {
-    current.width = fabsf(parentScrollDirection.x) > Math::MACHINE_EPSILON_1 ? parentSize.y : parentSize.x;
+    const Vector2& parentScrollDirection = inputs[0]->GetVector2();
+    const Toolkit::ControlOrientation::Type& layoutOrientation = static_cast<Toolkit::ControlOrientation::Type>(inputs[1]->GetInteger());
+    const Vector3& parentSize = inputs[2]->GetVector3();
+
+    if(Toolkit::IsVertical(layoutOrientation))
+    {
+      current.width = fabsf(parentScrollDirection.y) > Math::MACHINE_EPSILON_1 ? parentSize.x : parentSize.y;
+    }
+    else
+    {
+      current.width = fabsf(parentScrollDirection.x) > Math::MACHINE_EPSILON_1 ? parentSize.y : parentSize.x;
+    }
+
+    current.height = ( current.width > OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD ) ? mOvershootHeight : mOvershootHeight*0.5f;
   }
 
-  current.height = ( current.width > OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD ) ? OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height : OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height*0.5f;
-}
+  float mOvershootHeight;
+};
 
 void OvershootOverlayRotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
 {
@@ -307,8 +316,6 @@ void ItemView::OnInitialize()
 {
   Actor self = Self();
 
-  SetOvershootEnabled(true);
-
   Vector2 stageSize = Stage::GetCurrent().GetSize();
   mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
 
@@ -1483,13 +1490,13 @@ void ItemView::EnableScrollOvershoot( bool enable )
     mOvershootOverlay.SetDrawMode( DrawMode::OVERLAY_2D );
     self.Add(mOvershootOverlay);
 
-    Constraint constraint = Constraint::New<Vector3>( mOvershootOverlay, Actor::Property::SIZE, OvershootOverlaySizeConstraint );
+    Constraint constraint = Constraint::New<Vector3>( mOvershootOverlay, Actor::Property::SIZE, OvershootOverlaySizeConstraint(mOvershootSize.height) );
     constraint.AddSource( ParentSource( Toolkit::ItemView::Property::SCROLL_DIRECTION ) );
     constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_ORIENTATION ) );
     constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
     constraint.Apply();
 
-    mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
+    mOvershootOverlay.SetSize(mOvershootSize.width, mOvershootSize.height);
 
     constraint = Constraint::New<Quaternion>( mOvershootOverlay, Actor::Property::ORIENTATION, OvershootOverlayRotationConstraint );
     constraint.AddSource( ParentSource( Toolkit::ItemView::Property::SCROLL_DIRECTION ) );
index 0420830..bfc49c0 100644 (file)
@@ -27,13 +27,13 @@ using namespace Dali;
 
 namespace
 {
-const Vector2 OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE( 720.0f, 42.0f );
+
 const float OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD = 180.0f;
 
 // local helper function to resize the height of the bounce actor
-float GetBounceActorHeight( float width )
+float GetBounceActorHeight( float width, float defaultHeight )
 {
-  return (width > OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD) ? OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height : OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height * 0.5f;
+  return (width > OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD) ? defaultHeight : defaultHeight * 0.5f;
 }
 
 const float MAX_OVERSHOOT_NOTIFY_AMOUNT = 0.99f;                     // maximum amount to set notification for increased overshoot, beyond this we just wait for it to reduce again
@@ -129,6 +129,7 @@ ScrollOvershootEffectRipple::ScrollOvershootEffectRipple( bool vertical, Scrolla
     mOvershootProperty(Property::INVALID_INDEX),
     mEffectOvershootProperty(Property::INVALID_INDEX),
     mOvershoot(0.0f),
+    mOvershootSize( scrollable.GetOvershootSize() ),
     mAnimationStateFlags(0)
 {
   mOvershootOverlay = CreateBouncingEffectActor(mEffectOvershootProperty);
@@ -145,7 +146,7 @@ void ScrollOvershootEffectRipple::Apply()
   mOvershootProperty = IsVertical() ? Toolkit::ScrollView::Property::OVERSHOOT_Y : Toolkit::ScrollView::Property::OVERSHOOT_X;
 
   // make sure height is set, since we only create a constraint for image width
-  mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
+  mOvershootOverlay.SetSize( mOvershootSize );
 
   mAttachedScrollView.AddOverlay(mOvershootOverlay);
 
@@ -242,12 +243,12 @@ void ScrollOvershootEffectRipple::UpdateVisibility( bool visible )
       if(IsVertical())
       {
         mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) );
-        mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
+        mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width, mOvershootSize.height), size.depth);
       }
       else
       {
         mOvershootOverlay.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
-        mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
+        mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height, mOvershootSize.height), size.depth);
         relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
       }
       mOvershootOverlay.SetPosition(relativeOffset * parentSize);
@@ -261,13 +262,13 @@ void ScrollOvershootEffectRipple::UpdateVisibility( bool visible )
       if(IsVertical())
       {
         mOvershootOverlay.SetOrientation( Quaternion( Radian( Math::PI ), Vector3::ZAXIS ) );
-        mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
+        mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width, mOvershootSize.height), size.depth);
         relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
       }
       else
       {
         mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS ) );
-        mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
+        mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height, mOvershootSize.height), size.depth);
         relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
       }
       mOvershootOverlay.SetPosition(relativeOffset * parentSize);
index 7eebe4b..1dadcfc 100644 (file)
@@ -251,8 +251,9 @@ private:
   PropertyNotification  mOvershootDecreaseNotification;///< notification used to inform as overshoot decreases
   Property::Index       mOvershootProperty;            ///< index of the overshoot property in the scrollable actor
   Property::Index       mEffectOvershootProperty;      ///< index of the effect's overshoot property
-  float                mOvershoot;                    ///< last overshoot value as detected by notifications
-  unsigned short      mAnimationStateFlags;          ///< contains flags indicating the current state of the overshoot animation
+  float                 mOvershoot;                    ///< last overshoot value as detected by notifications
+  Vector2               mOvershootSize;                ///< The size of the overshoot effect
+  unsigned short        mAnimationStateFlags;          ///< contains flags indicating the current state of the overshoot animation
 };
 
 } // namespace Internal
index a8bd61e..4681474 100644 (file)
@@ -648,8 +648,6 @@ void ScrollView::OnInitialize()
   mRulerX = ruler;
   mRulerY = ruler;
 
-  SetOvershootEnabled(true);
-
   self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, mCanScrollVertical);
   self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, mCanScrollHorizontal);
 
@@ -1698,19 +1696,25 @@ bool ScrollView::AnimateTo(const Vector2& position, const Vector2& positionDurat
 
 void ScrollView::EnableScrollOvershoot(bool enable)
 {
-  if(enable && !mOvershootIndicator)
-  {
-    mOvershootIndicator = ScrollOvershootIndicator::New();
-  }
-  if( enable )
+  if (enable)
   {
+    if (!mOvershootIndicator)
+    {
+      mOvershootIndicator = ScrollOvershootIndicator::New();
+    }
+
     mOvershootIndicator->AttachToScrollable(*this);
   }
   else
   {
     mMaxOvershoot = mUserMaxOvershoot;
-    mOvershootIndicator->DetachFromScrollable(*this);
+
+    if (mOvershootIndicator)
+    {
+      mOvershootIndicator->DetachFromScrollable(*this);
+    }
   }
+
   UpdateMainInternalConstraint();
 }
 
index b3a2152..79b463f 100644 (file)
@@ -48,6 +48,8 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
 
 DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshoot-effect-color",    VECTOR4, OVERSHOOT_EFFECT_COLOR    )
 DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshoot-animation-speed", FLOAT,   OVERSHOOT_ANIMATION_SPEED )
+const int OVERSHOOT_SIZE = Dali::Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED + 1; // OVERSHOOT_SIZE is not public yet
+Dali::PropertyRegistration p1( typeRegistration, "overshoot-size", OVERSHOOT_SIZE, Property::VECTOR2, Dali::Toolkit::Internal::Scrollable::SetProperty, Dali::Toolkit::Internal::Scrollable::GetProperty );
 
 DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-relative-position", VECTOR2, SCROLL_RELATIVE_POSITION)
 DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-position-min",      VECTOR2, SCROLL_POSITION_MIN)
@@ -67,6 +69,7 @@ DALI_TYPE_REGISTRATION_END()
 
 const Vector4 DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.25f);
 const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
+const Vector2 OVERSHOOT_DEFAULT_SIZE( 720.0f, 42.0f );
 
 }
 
@@ -80,7 +83,8 @@ Scrollable::Scrollable()
 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | DISABLE_SIZE_NEGOTIATION ) ),
   mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
   mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
-  mOvershootEnabled(false)
+  mOvershootSize( OVERSHOOT_DEFAULT_SIZE ),
+  mOvershootEnabled(true)
 {
 }
 
@@ -88,7 +92,8 @@ Scrollable::Scrollable( ControlBehaviour behaviourFlags )
 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | behaviourFlags ) ),
   mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
   mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
-  mOvershootEnabled(false)
+  mOvershootSize( OVERSHOOT_DEFAULT_SIZE ),
+  mOvershootEnabled(true)
 {
 }
 
@@ -122,6 +127,11 @@ float Scrollable::GetOvershootAnimationSpeed() const
   return mOvershootAnimationSpeed;
 };
 
+const Vector2& Scrollable::GetOvershootSize() const
+{
+  return mOvershootSize;
+}
+
 Toolkit::Scrollable::ScrollStartedSignalType& Scrollable::ScrollStartedSignal()
 {
   return mScrollStartedSignal;
@@ -184,6 +194,16 @@ void Scrollable::SetProperty( BaseObject* object, Property::Index index, const P
         scrollableImpl.SetOvershootAnimationSpeed( value.Get<float>() );
         break;
       }
+      case OVERSHOOT_SIZE: // OVERSHOOT_SIZE is not public yet
+      {
+        Vector2 input;
+        if( value.Get( input ) )
+        {
+          scrollableImpl.mOvershootSize = input;
+        }
+        scrollableImpl.EnableScrollOvershoot( scrollableImpl.IsOvershootEnabled() );
+        break;
+      }
     }
   }
 }
@@ -209,6 +229,11 @@ Property::Value Scrollable::GetProperty( BaseObject* object, Property::Index ind
         value = scrollableImpl.GetOvershootAnimationSpeed();
         break;
       }
+      case OVERSHOOT_SIZE: // OVERSHOOT_SIZE is not public yet
+      {
+        value = scrollableImpl.mOvershootSize;
+        break;
+      }
     }
   }
 
index 0b349f5..97b3107 100644 (file)
@@ -110,6 +110,11 @@ public:
    */
   float GetOvershootAnimationSpeed() const;
 
+  /**
+   * @copydoc Dali::Toolkit::Scrollable::GetOvershootSize()
+   */
+  const Vector2& GetOvershootSize() const;
+
 private:
 
   /**
@@ -205,6 +210,7 @@ protected:
 
   Vector4         mOvershootEffectColor;    ///<The color of the overshoot bouncing effect
   float           mOvershootAnimationSpeed; ///<The speed of the overshoot animation (pixels per second)
+  Vector2         mOvershootSize;           ///<The size of the overshoot effect
 
   Toolkit::Scrollable::ScrollStartedSignalType mScrollStartedSignal;
   Toolkit::Scrollable::ScrollUpdatedSignalType mScrollUpdatedSignal;
index a7b1d49..795e9cf 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 = 5;
+const unsigned int TOOLKIT_MICRO_VERSION = 6;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index eee8bcb..3484c8c 100644 (file)
@@ -65,9 +65,9 @@ distributing this software or its derivatives.
       "secondary-cursor-color":[0.0,0.72,0.9,1.0],
       "cursor-width":1,
       "selection-highlight-color":[0.75,0.96,1.0,1.0],
-      "grab-handle-image" : "{DALI_IMAGE_DIR}cursor_handler_drop_center.png",
-      "selection-handle-image-left" : {"filename":"{DALI_IMAGE_DIR}selection_handle_drop_left.png" },
-      "selection-handle-image-right": {"filename":"{DALI_IMAGE_DIR}selection_handle_drop_right.png" }
+      "grab-handle-image" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
+      "selection-handle-image-left" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
+      "selection-handle-image-right": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }
     },
 
     "textfield-font-size-0":
@@ -117,7 +117,15 @@ distributing this software or its derivatives.
     },
     "scrollview":
     {
-      "overshoot-effect-color":"B018"
+      "overshoot-effect-color":"B018",
+      "overshoot-animation-speed":120.0,
+      "overshoot-size":[480.0,42.0]
+    },
+    "itemview":
+    {
+      "overshoot-effect-color":"B018",
+      "overshoot-animation-speed":120.0,
+      "overshoot-size":[480.0,42.0]
     }
   }
 }
index ec1b1c1..0c20938 100644 (file)
@@ -65,9 +65,9 @@ distributing this software or its derivatives.
       "secondary-cursor-color":[0.0,0.72,0.9,1.0],
       "cursor-width":3,
       "selection-highlight-color":[0.75,0.96,1.0,1.0],
-      "grab-handle-image" : "{DALI_IMAGE_DIR}cursor_handler_drop_center.png",
-      "selection-handle-image-left" : {"filename":"{DALI_IMAGE_DIR}selection_handle_drop_left.png" },
-      "selection-handle-image-right": {"filename":"{DALI_IMAGE_DIR}selection_handle_drop_right.png" }
+      "grab-handle-image" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
+      "selection-handle-image-left" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
+      "selection-handle-image-right": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }
     },
 
     "textfield-font-size-0":
@@ -117,7 +117,15 @@ distributing this software or its derivatives.
     },
     "scrollview":
     {
-      "overshoot-effect-color":"B018"
+      "overshoot-effect-color":"B018",
+      "overshoot-animation-speed":360.0,
+      "overshoot-size":[720.0,130.0]
+    },
+    "itemview":
+    {
+      "overshoot-effect-color":"B018",
+      "overshoot-animation-speed":360.0,
+      "overshoot-size":[720.0,130.0]
     }
   }
 }
diff --git a/dali-toolkit/styles/720x1280/images/cursor_handler_drop_center.png b/dali-toolkit/styles/720x1280/images/cursor_handler_drop_center.png
new file mode 100644 (file)
index 0000000..15c937a
Binary files /dev/null and b/dali-toolkit/styles/720x1280/images/cursor_handler_drop_center.png differ
diff --git a/dali-toolkit/styles/720x1280/images/selection_handle_drop_left.png b/dali-toolkit/styles/720x1280/images/selection_handle_drop_left.png
new file mode 100644 (file)
index 0000000..149becb
Binary files /dev/null and b/dali-toolkit/styles/720x1280/images/selection_handle_drop_left.png differ
diff --git a/dali-toolkit/styles/720x1280/images/selection_handle_drop_right.png b/dali-toolkit/styles/720x1280/images/selection_handle_drop_right.png
new file mode 100644 (file)
index 0000000..75035bc
Binary files /dev/null and b/dali-toolkit/styles/720x1280/images/selection_handle_drop_right.png differ
index 8e49fbe..6c329e9 100644 (file)
@@ -2,3 +2,6 @@
 
 dali_toolkit_style_files =\
     $(toolkit_styles_dir)/*.json
+
+dali_toolkit_style_images =\
+    $(toolkit_style_images_dir)/*.png
index fefb8a3..920c5db 100644 (file)
@@ -39,6 +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)
 
 ### Resources
  + [Resource Image](@ref resource-image)
diff --git a/docs/content/programming-guide/styling.h b/docs/content/programming-guide/styling.h
new file mode 100644 (file)
index 0000000..d6c197f
--- /dev/null
@@ -0,0 +1,62 @@
+/*! \page styling Styling
+ *
+@section styling-controls Styling Controls
+
+DALi Controls can be styled to look and behaviour differently.
+
+There are 2 ways to style a control, 1 is recommended.
+
+1) json markup in one of the style files.
+
+~~~
+      ...
+      "control":
+      {
+        "filename":"{IMAGES}file_name.png"
+      },
+      ...
+~~~
+
+or 2) via code using SetProperty
+
+@code
+Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
+control.SetProperty( Control::BACKGROUND, "file_name.png" );
+@endcode
+
+By setting the properties in the json file and not in code it prevents the need to edit code and recompile if changes required.
+
+In the example above, if the png file needs to be changed, method 1 only requires the json file to be changed and no actual code change.
+
+@section choosing-style-at-build Choosing Style files at build time
+
+When building for a target, a style selector should be specified.
+
+The selectors are resolution biased e.g; 720 and 480.
+
+Below can be added to configure to select a style
+
+@code
+./configure --with-style=480
+@endcode
+
+@code
+./configure --with-style=720
+@endcode
+
+
+or for gbs the below define added to the build command
+
+@code
+--define "dali_style 480x800"
+@endcode
+
+@section resources-for-styling Style specific resources
+
+Each style selector can have resource folders associated with it.
+
+Images for that style should be in their own folder named images.
+
+Common images not specific for a particular style will be in the images-common folder located in the style folder.
+*
+*/
index b80108a..9939f2c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.5
+Version:    1.1.6
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0, BSD-2.0, MIT