[dali_1.0.49] Merge branch 'devel/master' 57/44157/1
authorNick Holland <nick.holland@partner.samsung.com>
Fri, 17 Jul 2015 08:26:12 +0000 (09:26 +0100)
committerNick Holland <nick.holland@partner.samsung.com>
Fri, 17 Jul 2015 08:26:12 +0000 (09:26 +0100)
Change-Id: Ibce51e43c0f557cc08c63c943ab81e27b1b3664d

91 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/builder/json-parser.cpp
dali-toolkit/devel-api/builder/json-parser.h
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h
dali-toolkit/images/button-disabled.9.png
dali-toolkit/images/button-down-disabled.9.png
dali-toolkit/images/button-down.9.png
dali-toolkit/images/button-up.9.png
dali-toolkit/images/selection-popup-bg.9.png [moved from dali-toolkit/images/selection-popup-bg#.png with 100% similarity]
dali-toolkit/internal/atlas-manager/atlas-manager.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-set-property.cpp
dali-toolkit/internal/builder/json-parser-impl.cpp
dali-toolkit/internal/builder/json-parser-impl.h
dali-toolkit/internal/builder/replacement.cpp
dali-toolkit/internal/builder/replacement.h
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/buttons/push-button-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/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.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/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/feedback/feedback-ids.h [new file with mode: 0644]
dali-toolkit/internal/feedback/feedback-style.cpp [new file with mode: 0644]
dali-toolkit/internal/feedback/feedback-style.h [new file with mode: 0644]
dali-toolkit/internal/file.list
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-renderer.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/public-api/controls/buttons/button.cpp
dali-toolkit/public-api/controls/buttons/button.h
dali-toolkit/public-api/controls/buttons/check-box-button.cpp
dali-toolkit/public-api/controls/buttons/check-box-button.h
dali-toolkit/public-api/controls/buttons/push-button.cpp
dali-toolkit/public-api/controls/buttons/push-button.h
dali-toolkit/public-api/controls/control-depth-index-ranges.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/styles/dali-toolkit-default-theme.json
dali-toolkit/styles/default-feedback-theme.json [new file with mode: 0644]
dali-toolkit/styles/mobile/dali-toolkit-default-theme.json
docs/content/images/accessibility/accessibility-focus-group.png [new file with mode: 0644]
docs/content/images/accessibility/accessibility-focus-order.png [new file with mode: 0644]
docs/content/images/accessibility/accessibility-focus.png [new file with mode: 0644]
docs/content/main.md
docs/content/programming-guide/properties.h
docs/content/shared-javascript-and-cpp-documentation/accessibility.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/performance-tips.md
node-addon/build/Release/dali.node [deleted file]
node-addon/build/Release/obj.target/dali.node [deleted file]
packaging/dali-toolkit.spec
plugins/dali-script-v8/docs/content/actor.js
plugins/dali-script-v8/docs/content/constants.js
plugins/dali-script-v8/src/actors/actor-wrapper.cpp
plugins/dali-script-v8/src/actors/image-actor-api.cpp
plugins/dali-script-v8/src/actors/image-actor-api.h
plugins/dali-script-v8/src/constants/constants-wrapper.cpp
plugins/dali-script-v8/src/dali-wrapper.cpp
plugins/dali-script-v8/src/object/property-value-wrapper.cpp
plugins/dali-script-v8/src/utils/v8-utils.cpp

index 49a49c5..97a5a06 100644 (file)
@@ -46,9 +46,15 @@ void TestGlAbstraction::Initialize()
   mVertexAttribArrayChanged = false;
 
   mCheckFramebufferStatusResult = 0;
-  mNumBinaryFormats = 1;
-  mBinaryFormats = 1;
+  mFramebufferStatus = 0;
+  mFramebufferColorAttached = 0;
+  mFramebufferDepthAttached = 0;
+  mFramebufferStencilAttached = 0;
+
+  mNumBinaryFormats = 0;
+  mBinaryFormats = 0;
   mProgramBinaryLength = 0;
+  mGetProgramBinaryCalled = false;
 
   mLastAutoTextureIdUsed = 0;
 
@@ -56,6 +62,8 @@ void TestGlAbstraction::Initialize()
   mLastProgramIdUsed = 0;
   mLastUniformIdUsed = 0;
   mLastShaderCompiled = 0;
+  mLastClearBitMask = 0;
+  mClearCount = 0;
 
   mLastBlendEquationRgb   = 0;
   mLastBlendEquationAlpha = 0;
index 516b366..90ed38b 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <cstdio>  // fprintf
 #include <sstream>
 #include <string>
-#include <cstring> // for strcpy, strncpy
 #include <map>
+#include <cstdio>
+#include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
@@ -85,6 +85,8 @@ public:
 
   inline void BindFramebuffer( GLenum target, GLuint framebuffer )
   {
+    //Add 010 bit;
+    mFramebufferStatus |= 2;
   }
 
   inline void BindRenderbuffer( GLenum target, GLuint renderbuffer )
@@ -214,19 +216,45 @@ public:
 
   inline void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
   {
+     mBufferDataCalls.push_back(size);
   }
 
   inline void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
   {
+     mBufferSubDataCalls.push_back(size);
   }
 
   inline GLenum CheckFramebufferStatus(GLenum target)
   {
+    //If it has the three last bits set to 1 - 111, then the three minimum functions to create a
+    //Framebuffer texture have been called
+    if( mFramebufferStatus == 7 )
+    {
+      return GL_FRAMEBUFFER_COMPLETE;
+    }
+
     return mCheckFramebufferStatusResult;
   }
 
+  inline GLenum CheckFramebufferColorAttachment()
+  {
+    return mFramebufferColorAttached;
+  }
+
+  inline GLenum CheckFramebufferDepthAttachment()
+  {
+    return mFramebufferDepthAttached;
+  }
+
+  inline GLenum CheckFramebufferStencilAttachment()
+  {
+    return mFramebufferStencilAttached;
+  }
+
   inline void Clear(GLbitfield mask)
   {
+    mClearCount++;
+    mLastClearBitMask = mask;
   }
 
   inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
@@ -425,10 +453,26 @@ public:
 
   inline void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
   {
+    if (attachment == GL_DEPTH_ATTACHMENT)
+    {
+      mFramebufferDepthAttached = true;
+    }
+    else if (attachment == GL_STENCIL_ATTACHMENT)
+    {
+      mFramebufferStencilAttached = true;
+    }
   }
 
   inline void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
   {
+    //Add 100 bit;
+    mFramebufferStatus |= 4;
+
+    //We check 4 attachment colors
+    if ((attachment == GL_COLOR_ATTACHMENT0) || (attachment == GL_COLOR_ATTACHMENT1) || (attachment == GL_COLOR_ATTACHMENT2)  || (attachment == GL_COLOR_ATTACHMENT4))
+    {
+      mFramebufferColorAttached = true;
+    }
   }
 
   inline void FrontFace(GLenum mode)
@@ -447,10 +491,21 @@ public:
 
   inline void GenFramebuffers(GLsizei n, GLuint* framebuffers)
   {
+    for( int i = 0; i < n; i++ )
+    {
+      framebuffers[i] = i + 1;
+    }
+
+    //Add 001 bit, this function needs to be called the first one in the chain
+    mFramebufferStatus = 1;
   }
 
   inline void GenRenderbuffers(GLsizei n, GLuint* renderbuffers)
   {
+    for( int i = 0; i < n; i++ )
+    {
+      renderbuffers[i] = i + 1;
+    }
   }
 
   /**
@@ -491,7 +546,7 @@ public:
         out << ", ";
       }
     }
-    mTextureTrace.PushCall("GenTexture", out.str());
+    mTextureTrace.PushCall("GenTextures", out.str());
   }
 
   inline void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
@@ -1462,6 +1517,7 @@ public:
 
   inline void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
   {
+    mGetProgramBinaryCalled = true;
   }
 
   inline void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
@@ -1596,7 +1652,7 @@ public: // TEST FUNCTIONS
       }
     }
 
-    fprintf(stderr, "Not found, printing possible values:" );
+    fprintf(stderr, "Not found, printing possible values:\n" );
     for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
           program_it != mUniforms.end();
           ++program_it )
@@ -1616,7 +1672,7 @@ public: // TEST FUNCTIONS
         {
           std::stringstream out;
           out << uniform_it->first << ": " << origValue;
-          fprintf(stderr, "%s", out.str().c_str() );
+          fprintf(stderr, "%s\n", out.str().c_str() );
         }
       }
     }
@@ -1661,6 +1717,11 @@ public: // TEST FUNCTIONS
     return mLastProgramIdUsed;
   }
 
+  inline GLbitfield GetLastClearMask() const
+  {
+    return mLastClearBitMask;
+  }
+
   enum AttribType
   {
     ATTRIB_UNKNOWN = -1,
@@ -1686,9 +1747,23 @@ public: // TEST FUNCTIONS
   // Methods to check scissor tests
   inline const ScissorParams& GetScissorParams() const { return mScissorParams; }
 
+  inline bool GetProgramBinaryCalled() const { return mGetProgramBinaryCalled; }
+
+  inline unsigned int GetClearCountCalled() const { return mClearCount; }
+
+  typedef std::vector<size_t> BufferDataCalls;
+  inline const BufferDataCalls& GetBufferDataCalls() const { return mBufferDataCalls; }
+  inline void ResetBufferDataCalls() { mBufferDataCalls.clear(); }
+
+  typedef std::vector<size_t> BufferSubDataCalls;
+  inline const BufferSubDataCalls& GetBufferSubDataCalls() const { return mBufferSubDataCalls; }
+  inline void ResetBufferSubDataCalls() { mBufferSubDataCalls.clear(); }
+
 private:
   GLuint     mCurrentProgram;
   GLuint     mCompileStatus;
+  BufferDataCalls mBufferDataCalls;
+  BufferSubDataCalls mBufferSubDataCalls;
   GLuint     mLinkStatus;
   GLint      mGetAttribLocationResult;
   GLenum     mGetErrorResult;
@@ -1702,14 +1777,21 @@ private:
   GLboolean  mIsTextureResult;
   GLenum     mActiveTextureUnit;
   GLenum     mCheckFramebufferStatusResult;
+  GLint      mFramebufferStatus;
+  GLenum     mFramebufferColorAttached;
+  GLenum     mFramebufferDepthAttached;
+  GLenum     mFramebufferStencilAttached;
   GLint      mNumBinaryFormats;
   GLint      mBinaryFormats;
   GLint      mProgramBinaryLength;
   bool       mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE];
   bool       mVertexAttribArrayChanged;                            // whether the vertex attrib array has been changed
+  bool       mGetProgramBinaryCalled;
   typedef std::map< GLuint, std::string> ShaderSourceMap;
   ShaderSourceMap mShaderSources;
   GLuint     mLastShaderCompiled;
+  GLbitfield mLastClearBitMask;
+  unsigned int mClearCount;
 
   Vector4 mLastBlendColor;
   GLenum  mLastBlendEquationRgb;
index ddf0356..38c14a9 100644 (file)
@@ -66,7 +66,7 @@ void TestPlatformAbstraction::Resume()
 
 ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
                                                               ImageDimensions size,
-                                                              FittingMode::Type scalingMode,
+                                                              FittingMode::Type fittingMode,
                                                               SamplingMode::Type samplingMode,
                                                               bool orientationCorrection )
 {
@@ -77,7 +77,7 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string&
 
 ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
                                                    ImageDimensions size,
-                                                   FittingMode::Type scalingMode,
+                                                   FittingMode::Type fittingMode,
                                                    SamplingMode::Type samplingMode,
                                                    bool orientationCorrection )
 {
@@ -92,7 +92,7 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::Resou
 void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
 {
   std::ostringstream out;
-  out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl;
+  out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl ;
 
   mTrace.PushCall("LoadResource", out.str());
   if(mRequest != NULL)
@@ -110,20 +110,6 @@ Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously(
 }
 
 /**
- * @copydoc PlatformAbstraction::SaveResource()
- */
-void TestPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
-{
-  mTrace.PushCall("SaveResource", "");
-  if(mRequest != NULL)
-  {
-    delete mRequest;
-    tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
-  }
-  mRequest = new Integration::ResourceRequest(request);
-}
-
-/**
  * @copydoc PlatformAbstraction::CancelLoad()
  */
 void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
@@ -146,14 +132,6 @@ void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
   {
     cache.LoadFailed( mResources.loadFailedId, mResources.loadFailure );
   }
-  if(mResources.saved)
-  {
-    cache.SaveComplete( mResources.savedId, mResources.savedType );
-  }
-  if(mResources.saveFailed)
-  {
-    cache.SaveFailed( mResources.saveFailedId, mResources.saveFailure );
-  }
 }
 
 /**
@@ -193,7 +171,7 @@ void TestPlatformAbstraction::SetDpi (unsigned int dpiHorizontal, unsigned int d
 /**
  * @copydoc PlatformAbstraction::LoadFile()
  */
-bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+bool TestPlatformAbstraction::LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
 {
   mTrace.PushCall("LoadFile", "");
   if( mLoadFileResult.loadResult )
@@ -205,11 +183,11 @@ bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector
 }
 
 /**
- * @copydoc PlatformAbstraction::LoadShaderBinFile()
+ * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
  */
-bool TestPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
 {
-  mTrace.PushCall("LoadShaderBinFile", "");
+  mTrace.PushCall("LoadShaderBinaryFile", "");
   if( mLoadFileResult.loadResult )
   {
     buffer = mLoadFileResult.buffer;
@@ -221,7 +199,7 @@ bool TestPlatformAbstraction::LoadShaderBinFile( const std::string& filename, st
 /**
  * @copydoc PlatformAbstraction::SaveFile()
  */
-bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
+bool TestPlatformAbstraction::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes) const
 {
   mTrace.PushCall("SaveFile", "");
   return false;
@@ -232,12 +210,6 @@ void TestPlatformAbstraction::JoinLoaderThreads()
   mTrace.PushCall("JoinLoaderThreads", "");
 }
 
-Integration::DynamicsFactory* TestPlatformAbstraction::GetDynamicsFactory()
-{
-  mTrace.PushCall("GetDynamicsFactory", "");
-  return NULL;
-}
-
 /** Call this every test */
 void TestPlatformAbstraction::Initialize()
 {
@@ -264,16 +236,15 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
     case SuspendFunc:                         return mTrace.FindMethod("Suspend");
     case ResumeFunc:                          return mTrace.FindMethod("Resume");
     case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
-    case SaveResourceFunc:                    return mTrace.FindMethod("SaveResource");
     case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
-    case LoadShaderBinFileFunc:               return mTrace.FindMethod("LoadShaderBinFile");
+    case LoadShaderBinaryFileFunc:            return mTrace.FindMethod("LoadShaderBinaryFile");
+    case SaveShaderBinaryFileFunc:            return mTrace.FindMethod("SaveShaderBinaryFile");
     case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
     case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
     case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
     case IsLoadingFunc:                       return mTrace.FindMethod("IsLoading");
     case SetDpiFunc:                          return mTrace.FindMethod("SetDpi");
     case JoinLoaderThreadsFunc:               return mTrace.FindMethod("JoinLoaderThreads");
-    case GetDynamicsFactoryFunc:              return mTrace.FindMethod("GetDynamicsFactory");
   }
   return false;
 }
@@ -321,22 +292,6 @@ void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
   mResources.loadFailure = failure;
 }
 
-void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId      savedId,
-                                               Integration::ResourceTypeId  savedType)
-{
-  mResources.saved = true;
-  mResources.savedId = savedId;
-  mResources.savedType = savedType;
-}
-
-void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId  id,
-                                                    Integration::ResourceFailure failure)
-{
-  mResources.saveFailed = true;
-  mResources.saveFailedId = id;
-  mResources.saveFailure = failure;
-}
-
 Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
 {
   return mRequest;
@@ -353,7 +308,7 @@ void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
   mClosestSize = size;
 }
 
-void TestPlatformAbstraction::SetLoadFileResult( bool result, std::vector< unsigned char >& buffer )
+void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
 {
   mLoadFileResult.loadResult = result;
   if( result )
index c083fef..cd6bf85 100644 (file)
@@ -51,14 +51,6 @@ public:
     bool                         loadFailed;
     Integration::ResourceId      loadFailedId;
     Integration::ResourceFailure loadFailure;
-
-    bool                         saved;
-    Integration::ResourceId      savedId;
-    Integration::ResourceTypeId  savedType;
-
-    bool                         saveFailed;
-    Integration::ResourceId      saveFailedId;
-    Integration::ResourceFailure saveFailure;
   };
 
   struct LoadFileResult
@@ -70,7 +62,7 @@ public:
     }
 
     bool loadResult;
-    std::vector< unsigned char> buffer;
+    Dali::Vector< unsigned char> buffer;
   };
 
   /**
@@ -103,7 +95,7 @@ public:
    */
   virtual ImageDimensions GetClosestImageSize( const std::string& filename,
                                                  ImageDimensions size,
-                                                 FittingMode::Type scalingMode,
+                                                 FittingMode::Type fittingMode,
                                                  SamplingMode::Type samplingMode,
                                                  bool orientationCorrection );
 
@@ -112,7 +104,7 @@ public:
    */
   virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
                                                ImageDimensions size,
-                                               FittingMode::Type scalingMode,
+                                               FittingMode::Type fittingMode,
                                                SamplingMode::Type samplingMode,
                                                bool orientationCorrection );
 
@@ -127,11 +119,6 @@ public:
   virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
 
   /**
-   * @copydoc PlatformAbstraction::SaveResource()
-   */
-  virtual void SaveResource(const Integration::ResourceRequest& request);
-
-  /**
    * @copydoc PlatformAbstraction::CancelLoad()
    */
   virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
@@ -160,25 +147,27 @@ public:
    * @copydoc PlatformAbstraction::SetDpi()
    */
   virtual void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical);
+
   /**
    * @copydoc PlatformAbstraction::LoadFile()
    */
-  virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+  virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
 
   /**
-   * @copydoc PlatformAbstraction::LoadShaderBinFile()
+   * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
    */
-  virtual bool LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+  virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer
+) const;
+
+  virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
 
   /**
    * @copydoc PlatformAbstraction::SaveFile()
    */
-  virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
+  virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes) const;
 
   virtual void JoinLoaderThreads();
 
-  virtual Integration::DynamicsFactory* GetDynamicsFactory();
-
 public: // TEST FUNCTIONS
 
   // Enumeration of Platform Abstraction methods
@@ -188,16 +177,15 @@ public: // TEST FUNCTIONS
     SuspendFunc,
     ResumeFunc,
     LoadResourceFunc,
-    SaveResourceFunc,
     SaveFileFunc,
     LoadFileFunc,
-    LoadShaderBinFileFunc,
+    LoadShaderBinaryFileFunc,
+    SaveShaderBinaryFileFunc,
     CancelLoadFunc,
     GetResourcesFunc,
     IsLoadingFunc,
     SetDpiFunc,
-    JoinLoaderThreadsFunc,
-    GetDynamicsFactoryFunc,
+    JoinLoaderThreadsFunc
   } TestFuncEnum;
 
   /** Call this every test */
@@ -230,19 +218,13 @@ public: // TEST FUNCTIONS
   void SetResourceLoadFailed(Integration::ResourceId  id,
                              Integration::ResourceFailure failure);
 
-  void SetResourceSaved(Integration::ResourceId      savedId,
-                        Integration::ResourceTypeId  savedType);
-
-  void SetResourceSaveFailed(Integration::ResourceId  id,
-                             Integration::ResourceFailure failure);
-
   Integration::ResourceRequest* GetRequest();
 
   void DiscardRequest();
 
   void SetClosestImageSize(const Vector2& size);
 
-  void SetLoadFileResult( bool result, std::vector< unsigned char >& buffer );
+  void SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer );
 
   void SetSaveFileResult( bool result );
 
index 2d9d8cc..a4887ba 100644 (file)
@@ -232,7 +232,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // Default, HorizontalCenter, VerticalCenter - Ensure they do not change!
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -252,7 +252,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalLeft, VerticalCenter
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -272,7 +272,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalRight, VerticalCenter
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -292,7 +292,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalLeft, VerticalTop
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -312,7 +312,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalCenter, VerticalTop
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -332,7 +332,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalRight, VerticalTop
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -352,7 +352,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalLeft, VerticalBottom
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -372,7 +372,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalCenter, VerticalBottom
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -392,7 +392,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalRight, VerticalBottom
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -466,7 +466,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New();
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -479,7 +479,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -492,7 +492,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalRight);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -505,7 +505,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -518,7 +518,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -531,7 +531,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -544,7 +544,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -557,7 +557,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -570,7 +570,7 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -588,7 +588,7 @@ int UtcDaliAlignmentSetScaling(void)
   // ScaleToFill
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -621,7 +621,7 @@ int UtcDaliAlignmentSetScaling(void)
   // ScaleToFitKeepAspect
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -654,7 +654,7 @@ int UtcDaliAlignmentSetScaling(void)
   // ScaleToFillKeepAspect
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -687,7 +687,7 @@ int UtcDaliAlignmentSetScaling(void)
   // ShrinkToFit
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -720,7 +720,7 @@ int UtcDaliAlignmentSetScaling(void)
   // ShrinkToFitKeepAspect
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
+    alignment.Add(Actor::New());
     Stage::GetCurrent().Add(alignment);
     application.Render();
     application.SendNotification();
@@ -905,7 +905,7 @@ int UtcDaliAlignmentChildAddAndRemove(void)
   application.Render();
   application.SendNotification();
 
-  Actor actor = RenderableActor::New();
+  Actor actor = Actor::New();
   alignment.Add(actor);
 
   DALI_TEST_EQUALS(alignment.GetChildCount(), 1u, TEST_LOCATION);
index 5127cfb..3e7f4cf 100644 (file)
@@ -50,6 +50,27 @@ static bool ButtonCallback( Button button )
   return false;
 }
 
+Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
+{
+  BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
+
+  // Create the image
+  PixelBuffer* pixbuf = imageData.GetBuffer();
+  unsigned int size = width * height;
+
+  for( size_t i = 0; i < size; i++ )
+    {
+      pixbuf[i*4+0] = 0xFF * color.r;
+      pixbuf[i*4+1] = 0xFF * color.g;
+      pixbuf[i*4+2] = 0xFF * color.b;
+      pixbuf[i*4+3] = 0xFF * color.a;
+    }
+
+  imageData.Update();
+
+  return imageData;
+}
+
 const Dali::TouchPoint pointDownInside( 0, TouchPoint::Down, 240, 400 );
 const Dali::TouchPoint pointUpInside( 0, TouchPoint::Up, 240, 400 );
 const Dali::TouchPoint pointLeave( 0, TouchPoint::Leave, 240, 400 );
@@ -308,6 +329,60 @@ int UtcDaliButtonSetLabelActorP(void)
   END_TEST;
 }
 
+int UtcDaliButtonSetButtonImage(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonSetButtonImage");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+
+  PushButton pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
+
+  application.SendNotification();
+  application.Render();
+
+  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+  pushButton.SetButtonImage( image );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector3 size = pushButton.GetCurrentSize();
+
+  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliButtonSetSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonSetButtonImage");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+
+  PushButton pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
+
+  application.SendNotification();
+  application.Render();
+
+  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+  pushButton.SetSelectedImage( image );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector3 size = pushButton.GetCurrentSize();
+
+  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliButtonPressedSignalP(void)
 {
   ToolkitTestApplication application;
index f5a2a7c..a8aca48 100644 (file)
@@ -33,27 +33,6 @@ bool CheckBoxButtonClicked( Button button )
   return true;
 }
 
-Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
-{
-  BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
-
-  // Create the image
-  PixelBuffer* pixbuf = imageData.GetBuffer();
-  unsigned int size = width * height;
-
-  for( size_t i = 0; i < size; i++ )
-    {
-      pixbuf[i*4+0] = 0xFF * color.r;
-      pixbuf[i*4+1] = 0xFF * color.g;
-      pixbuf[i*4+2] = 0xFF * color.b;
-      pixbuf[i*4+3] = 0xFF * color.a;
-    }
-
-  imageData.Update();
-
-  return imageData;
-}
-
 } // namespace
 
 void checkbox_button_startup(void)
@@ -141,94 +120,6 @@ int UtcDaliCheckBoxButtonDownCastN(void)
   END_TEST;
 }
 
-int UtcDaliCheckBoxButtonSetBackgroundImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCheckBoxButtonSetBackgroundImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
-  checkBoxButton.SetBackgroundImage( image );
-
-  DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
-
-  checkBoxButton.SetBackgroundImage( imageActor );
-
-  DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
-
-  END_TEST;
-}
-
-int UtcDaliCheckBoxButtonSetSelectedImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCheckBoxButtonSetSelectedImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
-  checkBoxButton.SetSelectedImage( image );
-
-  DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
-
-  checkBoxButton.SetSelectedImage( imageActor );
-
-  DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
-
-  END_TEST;
-}
-
-int UtcDaliCheckBoxButtonSetDisabledBackgroundImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCheckBoxButtonSetDisabledBackgroundImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
-  checkBoxButton.SetDisabledBackgroundImage( image );
-
-  DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
-
-  checkBoxButton.SetDisabledBackgroundImage( imageActor );
-
-  DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
-
-  END_TEST;
-}
-
-int UtcDaliCheckBoxButtonSetDisabledSelectedImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCheckBoxButtonSetDisabledSelectedImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
-  checkBoxButton.SetDisabledSelectedImage( image );
-
-  DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
-
-  checkBoxButton.SetDisabledSelectedImage( imageActor );
-
-  DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
-
-  END_TEST;
-}
-
 int UtcDaliCheckBoxButtonSetGetSelected(void)
 {
   ToolkitTestApplication application;
@@ -256,52 +147,3 @@ int UtcDaliCheckBoxButtonSetGetSelected(void)
   DALI_TEST_CHECK( gCheckBoxButtonState );
   END_TEST;
 }
-
-int UtcDaliCheckBoxButtonSetImages(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliCheckBoxButtonSetImages");
-
-  Actor imageActor;
-
-  Image image01 = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor01 = CreateSolidColorActor( Color::RED );
-  imageActor01.SetSize( 20, 20 );
-
-  Image image02 = CreateSolidColorImage( Color::RED, 30, 30 );
-  ImageActor imageActor02 = CreateSolidColorActor( Color::RED );
-  imageActor02.SetSize( 40, 40 );
-  imageActor02.SetName( "imageActor02" );
-
-  Image image03 = CreateSolidColorImage( Color::RED, 50, 50 );
-  ImageActor imageActor03 = CreateSolidColorActor( Color::RED );
-  imageActor03.SetSize( 60, 60 );
-
-  Image image04 = CreateSolidColorImage( Color::RED, 70, 70 );
-  ImageActor imageActor04 = CreateSolidColorActor( Color::RED );
-  imageActor04.SetSize( 80, 80 );
-
-  Vector3 size;
-  CheckBoxButton checkBoxButton = CheckBoxButton::New();
-  checkBoxButton.SetName( "UtcDaliCheckBoxButtonSetImages" );
-  Stage::GetCurrent().Add( checkBoxButton );
-
-  application.SendNotification();
-  application.Render();
-
-  // Just check if check box button size changes when a bigger image is set.
-
-  checkBoxButton.SetBackgroundImage( image01 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
-
-  checkBoxButton.SetBackgroundImage( imageActor01 );
-
-  END_TEST;
-}
index daac903..a886d9d 100644 (file)
@@ -354,7 +354,7 @@ int UtcDaliControlImplChildAddAndRemove(void)
 
     DALI_TEST_EQUALS( dummyImpl.childAddCalled, false, TEST_LOCATION );
     DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
-    Actor actor = RenderableActor::New();
+    Actor actor = Actor::New();
     dummy.Add(actor);
     DALI_TEST_EQUALS( dummyImpl.childAddCalled, true, TEST_LOCATION );
     DALI_TEST_EQUALS( dummy.GetChildCount(), 1u, TEST_LOCATION );
@@ -382,7 +382,7 @@ int UtcDaliControlImplChildAddAndRemove(void)
     application.SendNotification();
 
     DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
-    Actor actor = RenderableActor::New();
+    Actor actor = Actor::New();
     dummy.Add(actor);
     DALI_TEST_EQUALS( dummy.GetChildCount(), 1u, TEST_LOCATION );
 
@@ -867,17 +867,11 @@ int UtcDaliControlImplOnStyleChangeN(void)
   Control dummy = Control::New();
   Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
 
-  // test that style manager is being used, passing an empty handle throws exception
-  try
-  {
-    Dali::Toolkit::StyleManager styleManager;
-    controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
-    tet_result(TET_FAIL);
-  }
-  catch (DaliException &exception)
-  {
-    tet_result(TET_PASS);
-  }
+  // test that style manager is being used, passing an empty handle does nothing but does not crash either
+  Dali::Toolkit::StyleManager styleManager;
+  controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
+  // no crash so test passes
+  tet_result(TET_PASS);
 
   END_TEST;
 }
index ecf4907..326928b 100644 (file)
@@ -171,150 +171,6 @@ int UtcDaliPushButtonDownCastN(void)
   END_TEST;
 }
 
-int UtcDaliPushButtonSetButtonImage(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetButtonImage");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
-  pushButton.SetButtonImage( image );
-
-  DALI_TEST_CHECK( pushButton.GetButtonImage() );
-
-  application.SendNotification();
-  application.Render();
-
-  Vector3 size = pushButton.GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
-
-  pushButton.SetButtonImage( imageActor );
-
-  DALI_TEST_CHECK( pushButton.GetButtonImage() );
-  END_TEST;
-}
-
-int UtcDaliPushButtonSetBackgroundImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetBackgroundImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  PushButton pushButton = PushButton::New();
-
-  pushButton.SetBackgroundImage( image );
-
-  DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
-
-  pushButton.SetBackgroundImage( imageActor );
-
-  DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
-
-  END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetSelectedImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  PushButton pushButton = PushButton::New();
-
-  pushButton.SetSelectedImage( image );
-
-  DALI_TEST_CHECK( pushButton.GetSelectedImage() );
-
-  pushButton.SetSelectedImage( imageActor );
-
-  DALI_TEST_CHECK( pushButton.GetSelectedImage() );
-
-  END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedBackgroundImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetSelectedBackgroundImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  PushButton pushButton = PushButton::New();
-
-  pushButton.SetSelectedBackgroundImage( image );
-
-  DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
-
-  pushButton.SetSelectedBackgroundImage( imageActor );
-
-  DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
-
-  END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledBackgroundImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetDisabledBackgroundImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  PushButton pushButton = PushButton::New();
-
-  pushButton.SetDisabledBackgroundImage( image );
-
-  DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
-
-  pushButton.SetDisabledBackgroundImage( imageActor );
-
-  DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
-
-  END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledImageP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetDisabledImageP");
-
-  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor = CreateSolidColorActor( Color::RED );
-  imageActor.SetSize( 20, 20 );
-
-  PushButton pushButton = PushButton::New();
-
-  pushButton.SetDisabledImage( image );
-
-  DALI_TEST_CHECK( pushButton.GetDisabledImage() );
-
-  pushButton.SetDisabledImage( imageActor );
-
-  DALI_TEST_CHECK( pushButton.GetDisabledImage() );
-
-  END_TEST;
-}
-
 int UtcDaliPushButtonSetGetAutoRepeating(void)
 {
   ToolkitTestApplication application;
index 9c1e054..14d183b 100644 (file)
@@ -595,18 +595,18 @@ int UtcDaliTableViewSetGetProperty(void)
   // Test "rows" property
   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS );
 
-  tableView.SetProperty( TableView::Property::ROWS, 4u );
+  tableView.SetProperty( TableView::Property::ROWS, 4 );
 
   DALI_TEST_CHECK( tableView.GetRows() == 4u );
-  DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<unsigned int>() == 4u );
+  DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4 );
 
   // Test "columns" property
   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS );
 
-  tableView.SetProperty( TableView::Property::COLUMNS, 5u );
+  tableView.SetProperty( TableView::Property::COLUMNS, 5 );
 
   DALI_TEST_CHECK( tableView.GetColumns() == 5u );
-  DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<unsigned int>() == 5u );
+  DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5 );
 
   // Test "cell-padding" property
   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING );
index 7e6b21e..b8fd9db 100644 (file)
@@ -72,7 +72,7 @@ const char* const PROPERTY_NAME_SELECTION_HIGHLIGHT_COLOR            = "selectio
 const char* const PROPERTY_NAME_DECORATION_BOUNDING_BOX              = "decoration-bounding-box";
 const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS                = "input-method-settings";
 
-const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
+const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
 const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
 const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
@@ -267,34 +267,11 @@ int UtcDaliTextFieldSetPropertyP(void)
   TextField field = TextField::New();
   DALI_TEST_CHECK( field );
 
-  // Check defaults.
-  DALI_TEST_EQUALS( field.GetProperty<unsigned int>( TextField::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::PLACEHOLDER_TEXT ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::PLACEHOLDER_TEXT_FOCUSED ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_FAMILY ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::POINT_SIZE ), 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::MAX_LENGTH ), 50u, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::EXCEED_POLICY ), TextField::EXCEED_POLICY_CLIP, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::HORIZONTAL_ALIGNMENT ), "BEGIN", TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::VERTICAL_ALIGNMENT ), "TOP", TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::TEXT_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector2>( TextField::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::PLACEHOLDER_TEXT_COLOR ), PLACEHOLDER_TEXT_COLOR, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::PRIMARY_CURSOR_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SECONDARY_CURSOR_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<bool>( TextField::Property::ENABLE_CURSOR_BLINK ), true, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_INTERVAL ), CURSOR_BLINK_INTERVAL * TO_SECONDS, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_DURATION ), 0.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::SCROLL_THRESHOLD ), SCROLL_THRESHOLD, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::SCROLL_SPEED ), SCROLL_SPEED, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SELECTION_HIGHLIGHT_COLOR ), LIGHT_BLUE, TEST_LOCATION );
+  // Note - we can't check the defaults since the stylesheets are platform-specific
 
   // Check the render backend property.
   field.SetProperty( TextField::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
-  DALI_TEST_EQUALS( field.GetProperty<unsigned int>( TextField::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
+  DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
 
   // Check text property.
   field.SetProperty( TextField::Property::TEXT, "Setting Text" );
@@ -610,6 +587,7 @@ int utcDaliTextFieldEvent02(void)
   // Checks if the right number of actors are created.
 
   TextField field = TextField::New();
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
   DALI_TEST_CHECK( field );
 
   Stage::GetCurrent().Add( field );
@@ -711,7 +689,7 @@ int utcDaliTextFieldEvent02(void)
 
   DALI_TEST_EQUALS( position2, position4, TEST_LOCATION ); // Should be in the same position2.
 
-  // Try to tap at the end.
+  // Tap away from the start position.
   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 13.f, 25.0f ) ) );
   application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 13.0f, 25.0f ) ) );
 
@@ -719,14 +697,14 @@ int utcDaliTextFieldEvent02(void)
   application.SendNotification();
   application.Render();
 
-  // Cursor position should be the same than position1.
   Vector3 position5 = cursor.GetCurrentPosition();
 
-  DALI_TEST_EQUALS( position1, position5, TEST_LOCATION ); // Should be in the same position1.
+  DALI_TEST_CHECK( position5.x > position4.x );
 
-  // Remove some text.
+  // Remove all the text.
   application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
   application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+  field.SetProperty( TextField::Property::TEXT, "" );
 
   // Render and notify
   application.SendNotification();
@@ -756,6 +734,7 @@ int utcDaliTextFieldEvent03(void)
   Stage::GetCurrent().Add( field );
 
   field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
   field.SetSize( 30.f, 50.f );
   field.SetParentOrigin( ParentOrigin::TOP_LEFT );
   field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
index 21b3c8b..a44081d 100644 (file)
@@ -51,7 +51,7 @@ const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underline-enabled";
 const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underline-color";
 const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underline-height";
 
-const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
+const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
 } // namespace
 
@@ -161,24 +161,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   TextLabel label = TextLabel::New();
   DALI_TEST_CHECK( label );
 
-  // Check defaults
-  DALI_TEST_EQUALS( label.GetProperty<unsigned int>( TextLabel::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::HORIZONTAL_ALIGNMENT ), "BEGIN", TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::VERTICAL_ALIGNMENT ), "TOP", TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 0.0f, TEST_LOCATION );
-
+  // Note - we can't check the defaults since the stylesheets are platform-specific
   label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
-  DALI_TEST_EQUALS( label.GetProperty<unsigned int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
+  DALI_TEST_EQUALS( label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
 
   // Check that text can be correctly reset
   label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );
index 37bff58..17029e0 100644 (file)
@@ -115,7 +115,7 @@ develapistyling_HEADERS =           $(devel_api_styling_header_files)
 develapisuperblurview_HEADERS =     $(devel_api_super_blur_view_header_files)
 develapitoolbar_HEADERS =           $(devel_api_tool_bar_header_files)
 develapitransitioneffects_HEADERS = $(devel_api_transition_effects_header_files)
-develapitextselectionpopup_HEADERS = $(devel_api_text_selection_popup_header_files)
+develapitextselectionpopup_HEADERS = $(devel_api_text_controls_header_files)
 
 # public api source
 publicapidir =                    $(topleveldir)/public-api
index 5d3838e..5e8c0ae 100644 (file)
@@ -59,7 +59,7 @@ JsonParser DownCast( BaseHandle handle )
   return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
 }
 
-int JsonParser::Parse(const std::string& source)
+bool JsonParser::Parse(const std::string& source)
 {
   return GetImplementation(*this).Parse(source);
 }
index b871948..05b8e80 100644 (file)
@@ -81,9 +81,9 @@ public:
    * Parse the source and construct a node tree.
    * Subsequent calls to this function will merge the trees.
    * @param source The json source to parse
-   * @return zero if parsed okay, otherwise an error.
+   * @return true if parsed okay, otherwise an error.
    */
-  int Parse(const std::string& source);
+  bool Parse(const std::string& source);
 
   /*
    * Optimize memory usage by packing strings
index 461e564..5140144 100644 (file)
@@ -142,7 +142,7 @@ public:
   /**
    * @brief Enable different blending mode for rendering.
    *
-   * @param[in] enable If false, the default blending function for RenderableActor is used.
+   * @param[in] enable If false, the default blending function if ImageActor is used.
    */
   void SetBlendMode( bool enable );
 
index ec3ad65..4b9f548 100644 (file)
@@ -68,6 +68,11 @@ void TextSelectionPopup::RaiseAbove( Layer target )
   GetImpl(*this).RaiseAbove( target );
 }
 
+void TextSelectionPopup::ShowPopup()
+{
+  GetImpl(*this).ShowPopup();
+}
+
 TextSelectionPopup::TextSelectionPopup( Internal::TextSelectionPopup& implementation )
 : Control(implementation)
 {
index 8608891..67a7966 100644 (file)
@@ -86,6 +86,9 @@ public:
       POPUP_PASTE_BUTTON_ICON_IMAGE,            ///< name "popup-paste-button-image",      The image to use as the popup paste icon,       type STRING
       POPUP_SELECT_BUTTON_ICON_IMAGE,           ///< name "popup-select-button-image",     The image to use as the popup select icon,      type STRING
       POPUP_SELECT_ALL_BUTTON_ICON_IMAGE,       ///< name "popup-select-all-button-image", The image to use as the popup select all icon,  type STRING
+      DIVIDER_COLOR,                            ///< name "popup-divider-color", VECTOR4,  The color of the divider between options,       type VECTOR4
+      ICON_COLOR,                               ///< name "popup-icon-color", VECTOR4,     The color of the icons (if supplied),           type VECTOR4
+      PRESSED_COLOR                             ///< name "popup-pressed-color", VECTOR4,  The color of the option when pressed,           type VECTOR4
     };
   };
 
@@ -143,6 +146,11 @@ public:
    */
   void RaiseAbove( Layer target );
 
+  /**
+   * @brief Show the Popup
+   */
+  void ShowPopup();
+
 public: // Not intended for application developers
 
   /**
index d9286e2..36b3908 100644 (file)
Binary files a/dali-toolkit/images/button-disabled.9.png and b/dali-toolkit/images/button-disabled.9.png differ
index a57bd78..21084b2 100644 (file)
Binary files a/dali-toolkit/images/button-down-disabled.9.png and b/dali-toolkit/images/button-down-disabled.9.png differ
index afff203..f6e25ab 100644 (file)
Binary files a/dali-toolkit/images/button-down.9.png and b/dali-toolkit/images/button-down.9.png differ
index 7a20d38..a2e2e01 100644 (file)
Binary files a/dali-toolkit/images/button-up.9.png and b/dali-toolkit/images/button-up.9.png differ
index 79eb9b7..532be6f 100644 (file)
@@ -162,10 +162,10 @@ public:
 
   struct AtlasSize
   {
-    SizeType mWidth;              // width of the atlas in pixels
-    SizeType mHeight;             // height of the atlas in pixels
-    SizeType mBlockWidth;         // width of a block in pixels
-    SizeType mBlockHeight;        // height of a block in pixels
+    SizeType mWidth;              ///< width of the atlas in pixels
+    SizeType mHeight;             ///< height of the atlas in pixels
+    SizeType mBlockWidth;         ///< width of a block in pixels
+    SizeType mBlockHeight;        ///< height of a block in pixels
   };
 
   /**
@@ -174,17 +174,25 @@ public:
    */
   struct AtlasMetricsEntry
   {
-    AtlasSize mSize;                 // size of atlas and blocks
-    SizeType mBlocksUsed;            // number of blocks used in the atlas
-    SizeType mTotalBlocks;           // total blocks used by atlas
-    Pixel::Format mPixelFormat;      // pixel format of the atlas
+    AtlasSize mSize;                 ///< size of atlas and blocks
+    SizeType mBlocksUsed;            ///< number of blocks used in the atlas
+    SizeType mTotalBlocks;           ///< total blocks used by atlas
+    Pixel::Format mPixelFormat;      ///< pixel format of the atlas
   };
 
   struct Metrics
   {
-    SizeType mAtlasCount;                               // number of atlases
-    SizeType mTextureMemoryUsed;                        // texture memory used by atlases
-    Dali::Vector< AtlasMetricsEntry > mAtlasMetrics;    // container of atlas information
+    Metrics()
+    : mAtlasCount( 0u ),
+      mTextureMemoryUsed( 0u )
+    {}
+
+    ~Metrics()
+    {}
+
+    SizeType mAtlasCount;                               ///< number of atlases
+    SizeType mTextureMemoryUsed;                        ///< texture memory used by atlases
+    Dali::Vector< AtlasMetricsEntry > mAtlasMetrics;    ///< container of atlas information
   };
 
   struct Vertex2D
@@ -233,8 +241,8 @@ public:
    */
   struct AtlasSlot
   {
-    ImageId mImageId;                           // Id of stored Image
-    AtlasId mAtlasId;                           // Id of Atlas containing this slot
+    ImageId mImageId;                           ///< Id of stored Image
+    AtlasId mAtlasId;                           ///< Id of Atlas containing this slot
   };
 
   typedef Dali::Vector< AtlasManager::AtlasSlot > slotContainer;
index 0371491..07ca895 100644 (file)
@@ -124,11 +124,6 @@ std::string PropertyValueToString( const Property::Value& value )
       ret = ToString( value.Get<int>() );
       break;
     }
-    case Property::UNSIGNED_INTEGER:
-    {
-      ret = ToString( value.Get<unsigned int>() );
-      break;
-    }
     case Property::VECTOR2:
     {
       ret = ToString( value.Get<Vector2>() );
index a1ed104..12f602c 100644 (file)
@@ -208,15 +208,6 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::V
       }
       break;
     }
-    case Property::UNSIGNED_INTEGER:
-    {
-      if( OptionalUnsignedInt v = replacer.IsUnsignedInteger( node) )
-      {
-        value = *v;
-        done = true;
-      }
-      break;
-    }
     case Property::VECTOR2:
     {
       if( OptionalVector2 v = replacer.IsVector2(node) )
index 2cff977..fdec738 100644 (file)
@@ -96,7 +96,7 @@ JsonParser::~JsonParser()
   }
 }
 
-int JsonParser::Parse(const std::string& source)
+bool JsonParser::Parse(const std::string& source)
 {
   mSources.push_back( VectorChar(source.begin(), source.end()) );
 
index 9936974..dbdbf45 100644 (file)
@@ -62,7 +62,7 @@ public:
   /*
    * @copydoc Toolkit::JsonParser::Parse()
    */
-  int Parse(const std::string& source);
+  bool Parse(const std::string& source);
 
   /*
    * @copydoc Toolkit::JsonParser::Pack()
index 49e7365..446a014 100644 (file)
@@ -321,27 +321,6 @@ OptionalInteger Replacement::IsInteger( const TreeNode & node ) const
   return ret;
 }
 
-OptionalUnsignedInt Replacement::IsUnsignedInteger( const TreeNode & node ) const
-{
-  OptionalUnsignedInt ret;
-  if( OptionalString replace = HasFullReplacement( node ) )
-  {
-    Property::Value value = GetFullReplacement( *replace );
-    if( Property::UNSIGNED_INTEGER == value.GetType() )
-    {
-      ret = value.Get<unsigned int>();
-    }
-  }
-  else
-  {
-    if ( OptionalInteger i = ::IsInteger( node ) )
-    {
-      ret = OptionalUnsignedInt(static_cast<unsigned int>(*i) );
-    }
-  }
-  return ret;
-}
-
 OptionalVector2 Replacement::IsVector2( const TreeNode & node ) const
 {
   OptionalVector2 ret;
index 358c21c..3c4d829 100644 (file)
@@ -102,13 +102,6 @@ public:
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalUnsignedInt IsUnsignedInteger( const TreeNode & node ) const;
-
-  /* @brief Check node for a type
-   *
-   * @param node The TreeNode to check
-   * @return Optional value
-   */
   OptionalVector2 IsVector2( const TreeNode & node ) const;
 
   /* @brief Check node for a type
index af57a7f..a9b9aa9 100644 (file)
@@ -322,7 +322,7 @@ Geometry BubbleEmitter::CreateGeometry( unsigned int numOfPatch )
   vertices.SetData( &vertexData[0] );
 
   Property::Map indexFormat;
-  indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+  indexFormat["indices"] = Property::INTEGER;
   PropertyBuffer indices = PropertyBuffer::New( indexFormat, numIndex  );
   indices.SetData( &indexData[0] );
 
index 4072f43..2883c9a 100644 (file)
@@ -143,8 +143,11 @@ void Button::SetDisabled( bool disabled )
       //(2) mDisabledBackgroundContent (Inserted)
       //(1) mBackgroundContent
 
-      TransitionInBetween( mUnselectedContent, mLabel, mDisabledContent );
-      TransitionInAbove( mBackgroundContent, mDisabledBackgroundContent );
+      AddButtonImage( mBackgroundContent );
+      TransitionButtonImage( mDisabledBackgroundContent );
+      AddButtonImage( mUnselectedContent );
+      TransitionButtonImage( mDisabledContent );
+      ReAddLabel();
 
       TransitionOut( mUnselectedContent );
       TransitionOut( mSelectedContent );
@@ -164,8 +167,12 @@ void Button::SetDisabled( bool disabled )
       //(2) mSelectedBackgroundContent
       //(1) mBackgroundContent
 
-      TransitionInBetween( mSelectedContent, mLabel, mDisabledSelectedContent );
-      TransitionInAbove( mSelectedBackgroundContent, mDisabledBackgroundContent );
+      AddButtonImage( mBackgroundContent );
+      AddButtonImage( mSelectedBackgroundContent );
+      TransitionButtonImage( mDisabledBackgroundContent );
+      AddButtonImage( mSelectedContent );
+      TransitionButtonImage( mDisabledSelectedContent );
+      ReAddLabel();
 
       TransitionOut( mUnselectedContent );
       TransitionOut( mSelectedContent );
@@ -184,8 +191,11 @@ void Button::SetDisabled( bool disabled )
       //(2) mBackgroundContent (Inserted)
       //(1) mDisabledBackgroundContent
 
-      TransitionInBetween( mDisabledContent, mLabel, mUnselectedContent );
-      TransitionInAbove( mDisabledBackgroundContent, mBackgroundContent );
+      AddButtonImage( mDisabledBackgroundContent );
+      TransitionButtonImage( mBackgroundContent );
+      AddButtonImage( mDisabledContent );
+      TransitionButtonImage( mUnselectedContent );
+      ReAddLabel();
 
       TransitionOut( mSelectedContent );
       TransitionOut( mSelectedBackgroundContent );
@@ -205,9 +215,12 @@ void Button::SetDisabled( bool disabled )
       //(2) mBackgroundContent (Inserted)
       //(1) mDisabledBackgroundContent
 
-      TransitionInBetween( mDisabledSelectedContent, mLabel, mSelectedContent );
-      TransitionInAbove( mDisabledBackgroundContent, mSelectedBackgroundContent );
-      TransitionInAbove( mDisabledBackgroundContent, mBackgroundContent );
+      AddButtonImage( mDisabledBackgroundContent );
+      TransitionButtonImage( mBackgroundContent );
+      TransitionButtonImage( mSelectedBackgroundContent );
+      AddButtonImage( mDisabledSelectedContent );
+      TransitionButtonImage( mSelectedContent );
+      ReAddLabel();
 
       TransitionOut( mUnselectedContent );
       TransitionOut( mDisabledContent );
@@ -314,9 +327,11 @@ void Button::SetSelected( bool selected, bool emitSignal )
       //(2) mSelectedBackgroundContent (Inserted)
       //(1) mBackgroundContent
 
-      TransitionInBetween( mUnselectedContent, mLabel, mSelectedContent );
-      TransitionInAbove( mBackgroundContent, mSelectedBackgroundContent );
-      TransitionInAtIndex( 0, mBackgroundContent );
+      AddButtonImage( mBackgroundContent );
+      TransitionButtonImage( mSelectedBackgroundContent );
+      AddButtonImage( mUnselectedContent );
+      TransitionButtonImage( mSelectedContent );
+      ReAddLabel();
 
       TransitionOut( mUnselectedContent );
       TransitionOut( mDisabledContent );
@@ -333,8 +348,10 @@ void Button::SetSelected( bool selected, bool emitSignal )
       //(2) mSelectedContent
       //(1) mBackgroundContent
 
-      TransitionInBetween( mSelectedContent, mLabel, mUnselectedContent );
-      TransitionInAtIndex( 0, mBackgroundContent );
+      AddButtonImage( mBackgroundContent );
+      AddButtonImage( mSelectedContent );
+      TransitionButtonImage( mUnselectedContent );
+      ReAddLabel();
 
       TransitionOut( mSelectedContent );
       TransitionOut( mSelectedBackgroundContent );
@@ -694,18 +711,17 @@ void Button::OnButtonDown()
 {
   if( !mTogglableButton )
   {
-    Toolkit::Button handle( GetOwner() );
-
     Pressed();
 
     if( mAutoRepeating )
     {
       SetUpTimer( mInitialAutoRepeatingDelay );
     }
-
-    //Emit signal.
-    mPressedSignal.Emit( handle );
   }
+
+  // The pressed signal should be emitted regardless of toggle mode.
+  Toolkit::Button handle( GetOwner() );
+  mPressedSignal.Emit( handle );
 }
 
 void Button::OnButtonUp()
@@ -724,13 +740,12 @@ void Button::OnButtonUp()
       {
         mAutoRepeatingTimer.Reset();
       }
-
-      Toolkit::Button handle( GetOwner() );
-
-      //Emit signal.
-      mReleasedSignal.Emit( handle );
-      mClickedSignal.Emit( handle );
     }
+
+    // The clicked and released signals should be emitted regardless of toggle mode.
+    Toolkit::Button handle( GetOwner() );
+    mReleasedSignal.Emit( handle );
+    mClickedSignal.Emit( handle );
   }
 }
 
@@ -740,18 +755,17 @@ void Button::OnTouchPointLeave()
   {
     if( !mTogglableButton )
     {
-      Toolkit::Button handle( GetOwner() );
-
       Released();
 
       if( mAutoRepeating )
       {
         mAutoRepeatingTimer.Reset();
       }
-
-      //Emit signal.
-      mReleasedSignal.Emit( handle );
     }
+
+    // The released signal should be emitted regardless of toggle mode.
+    Toolkit::Button handle( GetOwner() );
+    mReleasedSignal.Emit( handle );
   }
 }
 
@@ -957,9 +971,11 @@ void Button::Pressed()
     //(2) mSelectedBackgroundContent (Inserted)
     //(1) mBackgroundContent
 
-    TransitionInBetween( mUnselectedContent, mLabel, mSelectedContent );
-    TransitionInAbove( mBackgroundContent, mSelectedBackgroundContent );
-    TransitionInAtIndex( 0, mBackgroundContent );
+    AddButtonImage( mBackgroundContent );
+    TransitionButtonImage( mSelectedBackgroundContent );
+    AddButtonImage( mUnselectedContent );
+    TransitionButtonImage( mSelectedContent );
+    ReAddLabel();
 
     TransitionOut( mUnselectedContent );
     TransitionOut( mDisabledContent );
@@ -986,8 +1002,10 @@ void Button::Released()
     //(2) mSelectedContent
     //(1) mBackgroundContent
 
-    TransitionInBetween( mSelectedContent, mLabel, mUnselectedContent );
-    TransitionInAtIndex( 0, mBackgroundContent );
+    AddButtonImage( mBackgroundContent );
+    AddButtonImage( mSelectedContent );
+    TransitionButtonImage( mUnselectedContent );
+    ReAddLabel();
 
     TransitionOut( mSelectedContent );
     TransitionOut( mSelectedBackgroundContent );
@@ -1011,16 +1029,44 @@ Button::PaintState Button::GetPaintState()
   return mPaintState;
 }
 
-bool Button::InsertButtonImage( unsigned int index, Actor& actor )
+void Button::PrepareAddButtonImage( Actor& actor )
 {
   if( actor )
   {
-    Self().Insert( index, actor );
+    actor.Unparent();
+    Self().Add( actor );
     PrepareForTranstionOut( actor );
-    return true;
   }
+}
 
-  return false;
+void Button::TransitionButtonImage( Actor& actor )
+{
+  if( actor )
+  {
+    if( !actor.GetParent() )
+    {
+      Self().Add( actor );
+    }
+
+    OnTransitionIn( actor );
+  }
+}
+
+void Button::AddButtonImage( Actor& actor )
+{
+  if( actor )
+  {
+    Self().Add( actor );
+  }
+}
+
+void Button::ReAddLabel()
+{
+  if( mLabel )
+  {
+    mLabel.Unparent();
+    Self().Add( mLabel );
+  }
 }
 
 void Button::RemoveButtonImage( Actor& actor )
@@ -1052,31 +1098,6 @@ unsigned int Button::FindChildIndex( Actor& actor )
   return childrenNum;
 }
 
-void Button::TransitionInBetween(  Actor childLower, Actor childUpper, Actor actor )
-{
-  unsigned int index = childLower ? FindChildIndex( childLower ) + 1 : FindChildIndex( childUpper );
-  TransitionInAtIndex( index, actor );
-}
-
-void Button::TransitionInAbove( Actor child, Actor actor )
-{
-  unsigned int index = child ? FindChildIndex( child ) + 1 : 0;
-  TransitionInAtIndex( index, actor );
-}
-
-void Button::TransitionInAtIndex( unsigned int index, Actor actor )
-{
-  if( actor )
-  {
-    if( !actor.GetParent() )
-    {
-      Self().Insert( index, actor );
-    }
-
-    OnTransitionIn( actor );
-  }
-}
-
 void Button::TransitionOut( Actor actor )
 {
   OnTransitionOut( actor );
@@ -1084,9 +1105,8 @@ void Button::TransitionOut( Actor actor )
 
 void Button::ResetImageLayers()
 {
-  //ensure that all layers are in the correct order and state according to the paint state
+  // Ensure that all layers are in the correct order and state according to the paint state
 
-  int index = 0;
   switch( mPaintState )
   {
     case UnselectedState:
@@ -1101,14 +1121,8 @@ void Button::ResetImageLayers()
       RemoveButtonImage( mDisabledSelectedContent );
       RemoveButtonImage( mDisabledBackgroundContent );
 
-      if( InsertButtonImage( index, mBackgroundContent ) )
-      {
-        ++index;
-      }
-      if( InsertButtonImage( index, mUnselectedContent ) )
-      {
-        ++index;
-      }
+      PrepareAddButtonImage( mBackgroundContent );
+      PrepareAddButtonImage( mUnselectedContent );
       break;
     }
     case SelectedState:
@@ -1123,18 +1137,10 @@ void Button::ResetImageLayers()
       RemoveButtonImage( mDisabledSelectedContent );
       RemoveButtonImage( mDisabledBackgroundContent );
 
-      if( InsertButtonImage( index, mBackgroundContent ) )
-      {
-        ++index;
-      }
-      if( InsertButtonImage( index, mSelectedBackgroundContent ) )
-      {
-        ++index;
-      }
-      if( InsertButtonImage( index, mSelectedContent ) )
-      {
-        ++index;
-      }
+      PrepareAddButtonImage( mBackgroundContent );
+      PrepareAddButtonImage( mSelectedBackgroundContent );
+      PrepareAddButtonImage( mSelectedContent );
+      ReAddLabel();
       break;
     }
     case DisabledUnselectedState:
@@ -1149,14 +1155,9 @@ void Button::ResetImageLayers()
       RemoveButtonImage( mDisabledSelectedContent );
       RemoveButtonImage( mSelectedBackgroundContent );
 
-      if( InsertButtonImage( index, mDisabledBackgroundContent ? mDisabledBackgroundContent : mBackgroundContent ) )
-      {
-        ++index;
-      }
-      if( InsertButtonImage( index, mDisabledContent ? mDisabledContent : mUnselectedContent ) )
-      {
-        ++index;
-      }
+      PrepareAddButtonImage( mDisabledBackgroundContent ? mDisabledBackgroundContent : mBackgroundContent );
+      PrepareAddButtonImage( mDisabledContent ? mDisabledContent : mUnselectedContent );
+      ReAddLabel();
       break;
     }
     case DisabledSelectedState:
@@ -1173,27 +1174,16 @@ void Button::ResetImageLayers()
 
       if( mDisabledBackgroundContent )
       {
-        if( InsertButtonImage( index, mDisabledBackgroundContent) )
-        {
-          ++index;
-        }
+        PrepareAddButtonImage( mDisabledBackgroundContent );
       }
       else
       {
-        if( InsertButtonImage( index, mBackgroundContent ) )
-        {
-          ++index;
-        }
-        if( InsertButtonImage( index, mSelectedBackgroundContent ) )
-        {
-          ++index;
-        }
+        PrepareAddButtonImage( mBackgroundContent );
+        PrepareAddButtonImage( mSelectedBackgroundContent );
       }
 
-      if( InsertButtonImage( index, mDisabledSelectedContent ? mDisabledSelectedContent : mSelectedContent) )
-      {
-        ++index;
-      }
+      PrepareAddButtonImage( mDisabledSelectedContent ? mDisabledSelectedContent : mSelectedContent );
+      ReAddLabel();
       break;
     }
   }
index 89f0591..a17d058 100644 (file)
@@ -578,45 +578,43 @@ private:
   void ResetImageLayers();
 
   /**
-   * Transitions in the actor, inserting the actor above childLower below the childUpper.
-   * Will not insert the actor if it is already attached to a parent (and so will not reorder the actor)
+   * Transitions out the actor
    */
-  void TransitionInBetween( Actor childLower, Actor childUpper, Actor actor );
+  void TransitionOut( Actor actor );
 
   /**
-   * Transitions in the actor, inserting the actor above the child if the child exists or at the bottom otherwise
-   * Will not insert the actor if it is already attached to a parent (and so will not reorder the actor)
+   * Removes the actor from the button and prepares it to be transitioned out
    */
-  void TransitionInAbove( Actor child, Actor actor );
+  void RemoveButtonImage( Actor& actor );
 
   /**
-   * Transitions in the actor, inserting the actor at the index
-   * Will not insert the actor if it is already attached to a parent (and so will not reorder the actor)
+   * Finds the index of the actor.
+   * If the actor doesn't exist, return the last index + 1.
    */
-  void TransitionInAtIndex( unsigned int index, Actor actor );
+  unsigned int FindChildIndex( Actor& actor );
 
   /**
-   * Transitions out the actor
+   * Adds an actor to the hierarchy and prepares it to be transitioned.
+   * @param[in] actor The actor to add
    */
-  void TransitionOut( Actor actor );
+  void PrepareAddButtonImage( Actor& actor );
 
   /**
-   * Inserts the actor to the button and prepares it to be transitioned out
-   * @return true if the child was inserted, false otherwise
+   * Adds an actor to the hierarchy and marks it to be transitioned.
+   * @param[in] actor The actor to add
    */
-  bool InsertButtonImage( unsigned int index, Actor& actor );
+  void TransitionButtonImage( Actor& actor );
 
   /**
-   * Removes the actor from the button and prepares it to be transitioned out
+   * Adds an actor to the hierarchy.
+   * @param[in] actor The actor to add
    */
-  void RemoveButtonImage( Actor& actor );
+  void AddButtonImage( Actor& actor );
 
   /**
-   * Finds the index of the actor.
-   * If the actor doesn't exist, return the last index + 1.
+   * (Re)Adds the label (if exists) to the hierarchy (so it is always on top).
    */
-  unsigned int FindChildIndex( Actor& actor );
-
+  void ReAddLabel();
 
   // Undefined
   Button( const Button& );
index 1ee6b92..b6efdf8 100644 (file)
@@ -241,8 +241,11 @@ Vector3 PushButton::GetNaturalSize()
   Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( GetLabel() );
   if( label )
   {
-    size.width  = std::max( size.width,  label.GetRelayoutSize( Dimension::WIDTH ) );
-    size.height = std::max( size.height, label.GetRelayoutSize( Dimension::HEIGHT ) );
+    Padding padding( 0.0f, 0.0f, 0.0f, 0.0f );
+    label.GetPadding( padding );
+    size = label.GetNaturalSize();
+    size.width += padding.x + padding.width;
+    size.height += padding.y + padding.height;
   }
   else
   {
index 104c334..24d5934 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/rendering/cull-face.h>
 
 namespace Dali
 {
@@ -86,14 +87,14 @@ ImageActor PageTurnLandscapeView::NewPageFromRenderBuffer( int pageIndex )
 void PageTurnLandscapeView::OnAddPage( ImageActor newPage, bool isLeftSide )
 {
   newPage.SetParentOrigin( ParentOrigin::CENTER );
-  newPage.SetCullFace( CullBack );
+  SetCullFace( newPage, CullBack );
 
   if( 0 < newPage.GetChildCount() )
   {
      ImageActor backImage = ImageActor::DownCast( newPage.GetChildAt( 0 ) );
      backImage.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
      backImage.SetSize( mPageSize );
-     backImage.SetCullFace( CullFront );
+     SetCullFace( backImage, CullFront );
      backImage.SetZ( 0.25f * STATIC_PAGE_INTERVAL_DISTANCE );
   }
   if( isLeftSide )
index 9b18917..4d761fe 100644 (file)
@@ -22,6 +22,7 @@
 #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/devel-api/rendering/cull-face.h>
 
 //INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
@@ -159,14 +160,23 @@ void PageTurnPortraitView::OnPossibleOutwardsFlick( const Vector2& panPosition,
                          AlphaFunction::EASE_OUT, TimePeriod(PAGE_TURN_OVER_ANIMATION_DURATION*0.75f) );
     animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunction::EASE_OUT );
     animation.Play();
-    ImageActor::DownCast(actor).SetCullFace( CullBack );
+
+    ImageActor imageActor = ImageActor::DownCast(actor);
+    if( imageActor )
+    {
+      SetCullFace( imageActor, CullBack );
+    }
     animation.FinishedSignal().Connect( this, &PageTurnPortraitView::OnTurnedOver );
   }
 }
 
 void PageTurnPortraitView::OnTurnedOver( Animation& animation )
 {
-  ImageActor::DownCast(mAnimationActorPair[animation]).SetCullFace( CullNone );
+  ImageActor imageActor = ImageActor::DownCast( mAnimationActorPair[ animation ] );
+  if( imageActor )
+  {
+    SetCullFace( imageActor, CullNone );
+  }
   TurnedOver( animation );
 }
 
index d828897..d2b715f 100755 (executable)
@@ -175,6 +175,7 @@ ScrollBar::~ScrollBar()
 void ScrollBar::OnInitialize()
 {
   CreateDefaultIndicatorActor();
+  Self().SetDrawMode(DrawMode::OVERLAY_2D);
 }
 
 void ScrollBar::SetScrollPropertySource( Handle handle, Property::Index propertyScrollPosition, Property::Index propertyMinScrollPosition, Property::Index propertyMaxScrollPosition, Property::Index propertyScrollContentSize )
@@ -217,18 +218,13 @@ void ScrollBar::SetScrollIndicator( Actor indicator )
   if( indicator )
   {
     mIndicator = indicator;
+    Self().Add(mIndicator);
 
-    Actor self = Self();
-    self.Add(mIndicator);
+    EnableGestureDetection(Gesture::Type(Gesture::Pan));
 
-    if( !mPanGestureDetector )
-    {
-      mPanGestureDetector = PanGestureDetector::New();
-      mPanGestureDetector.DetectedSignal().Connect(this, &ScrollBar::OnPan);
-    }
-
-    mPanGestureDetector.DetachAll();
-    mPanGestureDetector.Attach( mIndicator );
+    PanGestureDetector detector( GetPanGestureDetector() );
+    detector.DetachAll();
+    detector.Attach( mIndicator );
 
     unsigned int childCount = mIndicator.GetChildCount();
     for ( unsigned int index = 0; index < childCount; index++ )
@@ -236,7 +232,7 @@ void ScrollBar::SetScrollIndicator( Actor indicator )
       Actor child = mIndicator.GetChildAt( index );
       if ( child )
       {
-        mPanGestureDetector.Attach( child );
+        detector.Attach( child );
       }
     }
   }
@@ -371,7 +367,7 @@ bool ScrollBar::OnPanGestureProcessTick()
   return true;
 }
 
-void ScrollBar::OnPan( Actor source, const PanGesture& gesture )
+void ScrollBar::OnPan( const PanGesture& gesture )
 {
   if(mScrollableObject)
   {
@@ -438,7 +434,7 @@ void ScrollBar::OnPan( Actor source, const PanGesture& gesture )
     if(itemView)
     {
       // Disable automatic refresh in ItemView during fast scrolling
-      GetImpl(itemView).SetRefreshEnabled(true);//!mIsPanning);
+      GetImpl(itemView).SetRefreshEnabled(!mIsPanning);
     }
   }
 }
index f5321a4..8a8177d 100755 (executable)
@@ -201,6 +201,11 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
+   * @copydoc Toolkit::Control::OnPan
+   */
+  virtual void OnPan( const PanGesture& gesture );
+
+  /**
    * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
    */
   virtual void OnSizeSet( const Vector3& size );
@@ -243,14 +248,6 @@ private:
    */
   void OnIndicatorHeightPolicyPropertySet(Property::Value propertyValue);
 
-  /**
-   * Pan gesture callback
-   *
-   * @param[in] actor The actor the event is raised for
-   * @param[in] gesture The pan event info
-   */
-  void OnPan(Actor source, const PanGesture& gesture);
-
 private:
 
   /**
@@ -290,8 +287,6 @@ private:
   Toolkit::ScrollBar::IndicatorHeightPolicy mIndicatorHeightPolicy;  ///< The height policy of scroll indicator (variable or fixed)
   float mIndicatorFixedHeight;                                      ///< The fixed height of scroll indicator
 
-  PanGestureDetector mPanGestureDetector;                            ///< The pan gesture detector for scroll indicator
-
   Timer mContractDelayTimer;                                         ///< Timer guarantee contract delay time.
   Timer mPanProcessTimer;                                            ///< The timer to process the pan gesture after the gesture is started.
 
index d278eb4..89eb96e 100644 (file)
@@ -102,7 +102,7 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex )
 
   unsigned int indexData[18] = { 0,3,1,0,2,3,4,7,5,4,6,7,8,11,9,8,10,11 };
   Property::Map indexFormat;
-  indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+  indexFormat["indices"] = Property::INTEGER;
   PropertyBuffer indices = PropertyBuffer::New( indexFormat, 18u );
   indices.SetData( indexData );
 
index 13ab888..c70b792 100644 (file)
@@ -1628,7 +1628,10 @@ void ItemView::GetItemsRange(ItemRange& range)
 void ItemView::OnScrollPositionChanged( float position )
 {
   // Cancel scroll animation to prevent any fighting of setting the scroll position property.
-  RemoveAnimation(mScrollAnimation);
+  if(!mRefreshEnabled)
+  {
+    RemoveAnimation(mScrollAnimation);
+  }
 
   // Refresh the cache immediately when the scroll position is changed.
   DoRefresh(position, false); // No need to cache extra items.
index 0be26cd..ae35484 100644 (file)
@@ -142,11 +142,11 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TableView, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "rows",           UNSIGNED_INTEGER, ROWS           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "columns",        UNSIGNED_INTEGER, COLUMNS        )
-DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cell-padding",   VECTOR2,          CELL_PADDING   )
-DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-rows",    MAP,              LAYOUT_ROWS    )
-DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-columns", MAP,              LAYOUT_COLUMNS )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "rows",           INTEGER, ROWS           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "columns",        INTEGER, COLUMNS        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cell-padding",   VECTOR2, CELL_PADDING   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-rows",    MAP,     LAYOUT_ROWS    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-columns", MAP,     LAYOUT_COLUMNS )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -877,17 +877,25 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr
     {
       case Toolkit::TableView::Property::ROWS:
       {
-        if( value.Get<unsigned int>() != tableViewImpl.GetRows() )
+        int rows = 0;
+        if( value.Get( rows ) && rows >= 0 )
         {
-          tableViewImpl.Resize( value.Get<unsigned int>(), tableViewImpl.GetColumns() );
+          if( static_cast<unsigned int>(rows) != tableViewImpl.GetRows() )
+          {
+            tableViewImpl.Resize( rows, tableViewImpl.GetColumns() );
+          }
         }
         break;
       }
       case Toolkit::TableView::Property::COLUMNS:
       {
-        if( value.Get<unsigned int>() != tableViewImpl.GetColumns() )
+        int columns = 0;
+        if( value.Get( columns ) && columns >= 0 )
         {
-          tableViewImpl.Resize( tableViewImpl.GetRows(), value.Get<unsigned int>() );
+          if( static_cast<unsigned int>( columns ) != tableViewImpl.GetColumns() )
+          {
+            tableViewImpl.Resize( tableViewImpl.GetRows(), value.Get<int>() );
+          }
         }
         break;
       }
@@ -923,12 +931,12 @@ Property::Value TableView::GetProperty( BaseObject* object, Property::Index inde
     {
       case Toolkit::TableView::Property::ROWS:
       {
-        value = tableViewImpl.GetRows();
+        value = static_cast<int>( tableViewImpl.GetRows() );
         break;
       }
       case Toolkit::TableView::Property::COLUMNS:
       {
-        value = tableViewImpl.GetColumns();
+        value = static_cast<int>( tableViewImpl.GetColumns() );
         break;
       }
       case Toolkit::TableView::Property::CELL_PADDING:
index 558d831..8fda39b 100644 (file)
@@ -115,7 +115,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         STRING,    SELECTION_HANDLE_IMAGE_RIGHT         )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  STRING,    SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            STRING,    SELECTION_HIGHLIGHT_COLOR            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            VECTOR4,   SELECTION_HIGHLIGHT_COLOR            )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings",                MAP,       INPUT_METHOD_SETTINGS                )
 
index ad9871b..3ff907b 100644 (file)
@@ -49,22 +49,6 @@ namespace
 
 const std::string TEXT_SELECTION_POPUP_LABEL = "textselectionpopuplabel";
 
-const Dali::Vector4 DEFAULT_POPUP_DIVIDER_COLOR( Dali::Vector4( 0.23f, 0.72f, 0.8f, 0.11f ) );
-const Dali::Vector4 DEFAULT_OPTION_ICON( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Dali::Vector4 DEFAULT_OPTION_PRESSED_COLOR( Dali::Vector4( 0.24f, 0.72f, 0.8f, 0.11f ) );
-
-const float DEFAULT_CAPTION_POINT_SIZE = 8.0f; // todo This should be from the style sheet not fixed.
-
-const std::string DEFAULT_POPUP_BACKGROUND_IMAGE( DALI_IMAGE_DIR "selection-popup-bg#.png" );
-const std::string OPTION_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" );
-const std::string OPTION_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" );
-const std::string OPTION_ICON_CUT( DALI_IMAGE_DIR "copy_paste_icon_cut.png" );
-const std::string OPTION_ICON_PASTE( DALI_IMAGE_DIR "copy_paste_icon_paste.png" );
-const std::string OPTION_ICON_SELECT( DALI_IMAGE_DIR "copy_paste_icon_select.png" );
-const std::string OPTION_ICON_SELECT_ALL( DALI_IMAGE_DIR "copy_paste_icon_select_all.png" );
-
-const float OPTION_MARGIN_WIDTH( 10.f );          ///< The margin between the right or lefts edge and the text or icon.
-
 #ifdef DGETTEXT_ENABLED
 
 #define POPUP_CUT_STRING GET_LOCALE_TEXT("IDS_COM_BODY_CUT")
@@ -112,6 +96,9 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-copy-button-imag
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-paste-button-image", STRING, POPUP_PASTE_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-select-button-image", STRING, POPUP_SELECT_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-select-all-button-image", STRING, POPUP_SELECT_ALL_BUTTON_ICON_IMAGE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-divider-color", VECTOR4, DIVIDER_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-icon-color", VECTOR4, ICON_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-pressed-color", VECTOR4, PRESSED_COLOR )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -150,11 +137,6 @@ void TextSelectionPopup::SetProperty( BaseObject* object, Property::Index index,
        impl.SetDimensionToCustomise( POPUP_MAXIMUM_SIZE, value.Get< Vector2 >() );
        break;
       }
-      case Toolkit::TextSelectionPopup::Property::POPUP_MIN_SIZE:
-      {
-        impl.SetDimensionToCustomise( POPUP_MINIMUM_SIZE, value.Get< Vector2 >() );
-        break;
-      }
       case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
       {
         impl.SetDimensionToCustomise( OPTION_MAXIMUM_SIZE, value.Get< Vector2 >() );
@@ -206,6 +188,21 @@ void TextSelectionPopup::SetProperty( BaseObject* object, Property::Index index,
         impl.SetButtonImage( Toolkit::TextSelectionPopup::SELECT_ALL, image );
         break;
       }
+      case Toolkit::TextSelectionPopup::Property::DIVIDER_COLOR:
+      {
+        impl.mDividerColor = value.Get< Vector4 >();
+        break;
+      }
+      case Toolkit::TextSelectionPopup::Property::ICON_COLOR:
+      {
+        impl.mIconColor = value.Get< Vector4 >();
+        break;
+      }
+      case Toolkit::TextSelectionPopup::Property::PRESSED_COLOR:
+      {
+        impl.mPressedColor = value.Get< Vector4 >();
+        break;
+      }
     } // switch
   } // TextSelectionPopup
 }
@@ -309,6 +306,11 @@ void TextSelectionPopup::RaiseAbove( Layer target )
   }
 }
 
+void TextSelectionPopup::ShowPopup()
+{
+  AddPopupOptionsToToolbar( mShowIcons, mShowCaptions );
+}
+
 void TextSelectionPopup::OnInitialize()
 {
   CreatePopup();
@@ -388,26 +390,16 @@ void TextSelectionPopup::SetDimensionToCustomise( const PopupCustomisations& set
   {
     case POPUP_MAXIMUM_SIZE :
     {
-      Actor self = Self();
-      mMaxSize = dimension;
       if ( mToolbar )
       {
-        mToolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, mMaxSize );
+        mToolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, dimension );
       }
       break;
     }
-    case POPUP_MINIMUM_SIZE :
-    {
-      Actor self = Self();
-      mMinSize = dimension;
-      // Option can not be smaller than this if only one.
-      break;
-    }
     case OPTION_MAXIMUM_SIZE :
     {
       mOptionMaxSize = dimension;
       // Option max size not currently currently supported
-
       break;
     }
     case OPTION_MINIMUM_SIZE :
@@ -434,11 +426,7 @@ Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& set
   {
     case POPUP_MAXIMUM_SIZE :
     {
-      return mMaxSize;
-    }
-    case POPUP_MINIMUM_SIZE :
-    {
-      return mMinSize;
+      return mToolbar.GetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE ).Get< Vector2 >();
     }
     case OPTION_MAXIMUM_SIZE :
     {
@@ -548,38 +536,11 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
    mOrderListOfButtons.reserve( 8u );
 
    // Create button for each possible option using Option priority
-   if ( !mCutIconImage )
-   {
-     mCutIconImage = ResourceImage::New( OPTION_ICON_CUT );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CUT, mCutOptionPriority, OPTION_CUT, POPUP_CUT_STRING , mCutIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CUT)  ) );
-
-   if ( !mCopyIconImage )
-   {
-     mCopyIconImage = ResourceImage::New( OPTION_ICON_COPY );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::COPY, mCopyOptionPriority, OPTION_COPY, POPUP_COPY_STRING, mCopyIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::COPY)  ) );
-
-   if ( !mPasteIconImage )
-   {
-     mPasteIconImage = ResourceImage::New( OPTION_ICON_PASTE );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::PASTE, mPasteOptionPriority, OPTION_PASTE, POPUP_PASTE_STRING, mPasteIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::PASTE)  ) );
-
-   if ( !mSelectIconImage )
-   mSelectIconImage = ResourceImage::New( OPTION_ICON_SELECT );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT, mSelectOptionPriority, OPTION_SELECT_WORD, POPUP_SELECT_STRING, mSelectIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT)  ) );
-
-   if ( !mSelectAllIconImage )
-   {
-    mSelectAllIconImage = ResourceImage::New( OPTION_ICON_SELECT_ALL );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT_ALL, mSelectAllOptionPriority, OPTION_SELECT_ALL, POPUP_SELECT_ALL_STRING, mSelectAllIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT_ALL)  ) );
-
-   if ( !mClipboardIconImage )
-   {
-     mClipboardIconImage = ResourceImage::New( OPTION_ICON_CLIPBOARD );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CLIPBOARD, mClipboardOptionPriority, OPTION_CLIPBOARD, POPUP_CLIPBOARD_STRING, mClipboardIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CLIPBOARD)  ) );
 
    // Sort the buttons according their priorities.
@@ -615,13 +576,11 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
      Toolkit::TextLabel captionTextLabel = Toolkit::TextLabel::New();
      captionTextLabel.SetStyleName( TEXT_SELECTION_POPUP_LABEL );
      captionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
-     captionTextLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, DEFAULT_CAPTION_POINT_SIZE );
      captionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
      Toolkit::TextLabel pressedCaptionTextLabel = Toolkit::TextLabel::New();
      pressedCaptionTextLabel.SetStyleName( TEXT_SELECTION_POPUP_LABEL );
      pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
-     pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, DEFAULT_CAPTION_POINT_SIZE );
      pressedCaptionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
      Padding padding;
@@ -638,7 +597,7 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
 
    int depth = Self().GetHierarchyDepth();
    // 3. Create the icons
-   if ( showIcons )
+   if ( showIcons && iconImage )
    {
      ImageActor pressedIcon = ImageActor::New(  iconImage );
      ImageActor icon = ImageActor::New(  iconImage );
@@ -769,31 +728,26 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
  void TextSelectionPopup::CreatePopup()
  {
    Actor self = Self();
-   CreateOrderedListOfPopupOptions();  //todo Currently causes all options to be shown
+   CreateOrderedListOfPopupOptions();
    self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
-   SetBackgroundImage( NinePatchImage::New( DEFAULT_POPUP_BACKGROUND_IMAGE ) );
 
    if( !mToolbar )
    {
      mToolbar = Toolkit::TextSelectionToolbar::New();
      mToolbar.SetParentOrigin( ParentOrigin::CENTER );
-     mToolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, mMaxSize );
      self.Add( mToolbar );
-     AddPopupOptionsToToolbar( mShowIcons, mShowCaptions );
    }
  }
 
 TextSelectionPopup::TextSelectionPopup( TextSelectionPopupCallbackInterface* callbackInterface )
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mToolbar(),
-  mMaxSize(),
-  mMinSize(),
-  mOptionDividerSize( Size( 2.0f, 0.0f) ),
+  mOptionDividerSize(),
   mEnabledButtons( Toolkit::TextSelectionPopup::NONE ),
   mCallbackInterface( callbackInterface ),
-  mDividerColor( DEFAULT_POPUP_DIVIDER_COLOR ),
-  mIconColor( DEFAULT_OPTION_ICON ),
-  mPressedColor( DEFAULT_OPTION_PRESSED_COLOR ),
+  mDividerColor( Color::WHITE ),
+  mIconColor(  Color::WHITE ),
+  mPressedColor(  Color::WHITE ),
   mSelectOptionPriority( 1 ),
   mSelectAllOptionPriority ( 2 ),
   mCutOptionPriority ( 4 ),
index 3bb8b71..619dc37 100644 (file)
@@ -44,7 +44,6 @@ namespace
 enum PopupCustomisations
 {
   POPUP_MAXIMUM_SIZE,
-  POPUP_MINIMUM_SIZE,
   OPTION_MAXIMUM_SIZE,
   OPTION_MINIMUM_SIZE,
   OPTION_DIVIDER_SIZE
@@ -129,6 +128,11 @@ public:
    */
   void RaiseAbove( Layer target );
 
+  /**
+   * @copydoc Toolkit::TextSelectionPopup::ShowPopup()
+   */
+  void ShowPopup();
+
 private: // From Control
 
   /**
@@ -257,9 +261,6 @@ private: // Data
   Image mSelectIconImage;
   Image mSelectAllIconImage;
 
-  Size mMaxSize;                       // Maximum size of the Popup
-  Size mMinSize;                       // Minimum size of the Popup
-
   Size mOptionMaxSize;                 // Maximum size of an Option button
   Size mOptionMinSize;                 // Minimum size of an Option button
   Size mOptionDividerSize;             // Size of divider line
index 756c44d..78d8f5f 100644 (file)
@@ -154,6 +154,11 @@ void TextSelectionToolbar::OnStageConnection( int depth )
 void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize )
 {
   mMaxSize = maxSize;
+  if (mScrollView && mStencilLayer )
+  {
+    mScrollView.SetMaximumSize( mMaxSize );
+    mStencilLayer.SetMaximumSize( mMaxSize );
+  }
 }
 
 const Dali::Vector2& TextSelectionToolbar::GetPopupMaxSize() const
@@ -166,7 +171,6 @@ void TextSelectionToolbar::SetUpScrollView( Toolkit::ScrollView& scrollView )
   scrollView.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   scrollView.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-  scrollView.SetMaximumSize( mMaxSize );
 
   scrollView.SetScrollingDirection( PanGestureDetector::DIRECTION_HORIZONTAL, Degree( 40.0f ) );
   scrollView.SetAxisAutoLock( true );
@@ -189,7 +193,6 @@ void TextSelectionToolbar::SetUp()
   mStencilLayer = Layer::New();
   mStencilLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   mStencilLayer.SetParentOrigin( ParentOrigin::CENTER );
-  mStencilLayer.SetMaximumSize( mMaxSize );
 
   ImageActor stencil = CreateSolidColorActor( Color::RED );
   stencil.SetDrawMode( DrawMode::STENCIL );
@@ -253,7 +256,7 @@ void TextSelectionToolbar::RaiseAbove( Layer target )
 
 TextSelectionToolbar::TextSelectionToolbar()
 : Control( ControlBehaviour( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ) ),
-  mMaxSize ( DEFAULT_MAX_SIZE ),
+  mMaxSize (),
   mIndexInTable( 0 ),
   mDividerIndexes()
 {
diff --git a/dali-toolkit/internal/feedback/feedback-ids.h b/dali-toolkit/internal/feedback/feedback-ids.h
new file mode 100644 (file)
index 0000000..cb7ffa3
--- /dev/null
@@ -0,0 +1,105 @@
+#ifndef __DALI_FEEDBACK_IDS_H__
+#define __DALI_FEEDBACK_IDS_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+/**
+ *  Enumerations for the types of feedback
+ *  Note: These are based on feedback_type_e in libsvi
+ */
+enum FeedbackType
+{
+  FEEDBACK_TYPE_NONE,
+
+  FEEDBACK_TYPE_SOUND,
+  FEEDBACK_TYPE_VIBRATION,
+  FEEDBACK_TYPE_LED,
+
+  FEEDBACK_TYPE_END
+};
+
+/**
+ *  The pattern list for feedback effects.
+ *  Note: These are based on feedback_pattern_e in libsvi
+ */
+enum FeedbackPattern
+{
+  FEEDBACK_PATTERN_NONE = -1,
+
+  FEEDBACK_PATTERN_TAP = 0,           /**< feedback pattern when general touch */
+  FEEDBACK_PATTERN_SIP,               /**< feedback pattern when touch text key */
+  FEEDBACK_PATTERN_SIP_BACKSPACE,     /**< feedback pattern when touch backspace key */
+  FEEDBACK_PATTERN_MAX_CHARACTER,     /**< feedback pattern when max character */
+  FEEDBACK_PATTERN_KEY0,              /**< feedback pattern when touch numeric 0 key */
+  FEEDBACK_PATTERN_KEY1,              /**< feedback pattern when touch numeric 1 key */
+  FEEDBACK_PATTERN_KEY2,              /**< feedback pattern when touch numeric 2 key */
+  FEEDBACK_PATTERN_KEY3,              /**< feedback pattern when touch numeric 3 key */
+  FEEDBACK_PATTERN_KEY4,              /**< feedback pattern when touch numeric 4 key */
+  FEEDBACK_PATTERN_KEY5,              /**< feedback pattern when touch numeric 5 key */
+  FEEDBACK_PATTERN_KEY6,              /**< feedback pattern when touch numeric 6 key */
+  FEEDBACK_PATTERN_KEY7,              /**< feedback pattern when touch numeric 7 key */
+  FEEDBACK_PATTERN_KEY8,              /**< feedback pattern when touch numeric 8 key */
+  FEEDBACK_PATTERN_KEY9,              /**< feedback pattern when touch numeric 9 key */
+  FEEDBACK_PATTERN_KEY_STAR,          /**< feedback pattern when touch star key */
+  FEEDBACK_PATTERN_KEY_SHARP,         /**< feedback pattern when touch sharp key */
+  FEEDBACK_PATTERN_HOLD,              /**< feedback pattern when touch hold */
+  FEEDBACK_PATTERN_MULTI_TAP,         /**< feedback pattern when multi touch */
+  FEEDBACK_PATTERN_HW_TAP,            /**< feedback pattern when press hardware key */
+  FEEDBACK_PATTERN_HW_HOLD,           /**< feedback pattern when holding press hardware key */
+
+  FEEDBACK_PATTERN_MESSAGE,           /**< feedback pattern when incoming a message */
+  FEEDBACK_PATTERN_MESSAGE_ON_CALL,   /**< feedback pattern when incoming a message on call */
+  FEEDBACK_PATTERN_EMAIL,             /**< feedback pattern when incoming an email */
+  FEEDBACK_PATTERN_EMAIL_ON_CALL,     /**< feedback pattern when incoming an email on call */
+  FEEDBACK_PATTERN_WAKEUP,            /**< feedback pattern when alert wake up call */
+  FEEDBACK_PATTERN_WAKEUP_ON_CALL,    /**< feedback pattern when alert wake up call on call */
+  FEEDBACK_PATTERN_SCHEDULE,          /**< feedback pattern when alert schedule alarm */
+  FEEDBACK_PATTERN_SCHEDULE_ON_CALL,    /**< feedback pattern when alert schedule alarm on call */
+  FEEDBACK_PATTERN_TIMER,             /**< feedback pattern when alert timer */
+  FEEDBACK_PATTERN_TIMER_ON_CALL,     /**< feedback pattern when alert timer on call */
+  FEEDBACK_PATTERN_GENERAL,           /**< feedback pattern when alert general event */
+  FEEDBACK_PATTERN_GENERAL_ON_CALL,   /**< feedback pattern when alert general event on call */
+
+  FEEDBACK_PATTERN_POWER_ON,           /**< feedback pattern when power on */
+  FEEDBACK_PATTERN_POWER_OFF,           /**< feedback pattern when power off */
+  FEEDBACK_PATTERN_CHARGERCONN,         /**< feedback pattern when connecting charger */
+  FEEDBACK_PATTERN_CHARGERCONN_ON_CALL, /**< feedback pattern when connecting charger on call */
+  FEEDBACK_PATTERN_FULLCHARGED,         /**< feedback pattern when full charged */
+  FEEDBACK_PATTERN_FULLCHARGED_ON_CALL, /**< feedback pattern when full charged on call */
+  FEEDBACK_PATTERN_LOWBATT,             /**< feedback pattern when low battery */
+  FEEDBACK_PATTERN_LOWBATT_ON_CALL,     /**< feedback pattern when low battery on call */
+  FEEDBACK_PATTERN_LOCK,                /**< feedback pattern when lock */
+  FEEDBACK_PATTERN_UNLOCK,              /**< feedback pattern when unlock */
+  FEEDBACK_PATTERN_CALLCONNECT,         /**< feedback pattern when connecting call */
+  FEEDBACK_PATTERN_DISCALLCONNECT,      /**< feedback pattern when disconnecting call */
+  FEEDBACK_PATTERN_MINUTEMINDER,        /**< feedback pattern when minute minder */
+  FEEDBACK_PATTERN_VIBRATION,           /**< feedback pattern when vibration */
+  FEEDBACK_PATTERN_SHUTTER,             /**< feedback pattern when screen capture or camera shutter */
+  FEEDBACK_PATTERN_LIST_REORDER,        /**< feedback pattern when list reorder */
+  FEEDBACK_PATTERN_SLIDER_SWEEP,        /**< feedback pattern when slider sweep */
+
+  FEEDBACK_PATTERN_END,
+};
+
+
+}  // namespace Dali
+
+#endif // __DALI_FEEDBACK_IDS_H__
diff --git a/dali-toolkit/internal/feedback/feedback-style.cpp b/dali-toolkit/internal/feedback/feedback-style.cpp
new file mode 100644 (file)
index 0000000..c1dca7e
--- /dev/null
@@ -0,0 +1,470 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/feedback/feedback-style.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/object/object-registry.h>
+#include <dali/devel-api/adaptor-framework/style-monitor.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali-toolkit/internal/feedback/feedback-ids.h>
+
+using std::string;
+
+namespace // unnamed namespace
+{
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::General, false, "LOG_FEEDBACK");
+#endif
+
+const char* DEFAULT_FEEDBACK_THEME_PATH = DALI_STYLE_DIR"default-feedback-theme.json";
+
+// Sets bool and string if the node has a child "name"
+void GetIfString(const Dali::Toolkit::TreeNode& node, const std::string& name, bool& exists, std::string& str)
+{
+  const Dali::Toolkit::TreeNode* child = node.GetChild(name);
+  if( child &&
+      Dali::Toolkit::TreeNode::STRING == child->GetType() )
+  {
+    exists = true;
+    str = child->GetString();
+  }
+}
+
+} // unnamed namespace
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+struct SignalFeedbackInfo
+{
+  /**
+   * Default constructor.
+   */
+  SignalFeedbackInfo()
+  :mHasHapticFeedbackInfo(false),
+   mHasSoundFeedbackInfo(false)
+  {
+  }
+
+  bool mHasHapticFeedbackInfo;
+  bool mHasSoundFeedbackInfo;
+  string mSignalName;
+  string mHapticFeedbackPattern;
+  string mSoundFeedbackPattern;
+  string mHapticFeedbackFile;
+  string mSoundFeedbackFile;
+};
+
+typedef std::vector<SignalFeedbackInfo> SignalFeedbackInfoContainer;
+typedef SignalFeedbackInfoContainer::const_iterator SignalFeedbackInfoConstIter;
+
+struct FeedbackStyleInfo
+{
+  /**
+   * Default constructor.
+   */
+  FeedbackStyleInfo()
+  {
+  }
+
+  string mTypeName;
+
+  SignalFeedbackInfoContainer mSignalFeedbackInfoList;
+};
+
+static const FeedbackStyleInfo DEFAULT_FEEDBACK_STYLE_INFO;
+
+FeedbackStyle::FeedbackStyle()
+: mConnections( this )
+{
+  mFeedback = Dali::FeedbackPlayer::Get();
+
+  string defaultTheme;
+
+  if( mFeedback && mFeedback.LoadFile( DEFAULT_FEEDBACK_THEME_PATH, defaultTheme ) )
+  {
+    LoadTheme( defaultTheme );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceLoader::LoadTheme(%s) - loaded %d bytes\n",
+                   DEFAULT_FEEDBACK_THEME_PATH, defaultTheme.size() );
+  }
+  else
+  {
+    DALI_LOG_ERROR("ResourceLoader::LoadTheme(%s) - failed to load\n", DEFAULT_FEEDBACK_THEME_PATH);
+  }
+
+}
+
+FeedbackStyle::~FeedbackStyle()
+{
+}
+
+struct PlayFeedbackFromSignal
+{
+  PlayFeedbackFromSignal( FeedbackStyle& controller, const string& typeName, const string& signalName )
+  : mController( controller ),
+    mTypeName( typeName ),
+    mSignalName( signalName )
+  {
+  }
+
+  void operator()()
+  {
+    mController.PlayFeedback( mTypeName, mSignalName );
+  }
+
+  FeedbackStyle& mController;
+  string mTypeName;
+  string mSignalName;
+};
+
+
+void FeedbackStyle::ObjectCreated( BaseHandle handle )
+{
+  std::string typeName = handle.GetTypeName();
+
+  if( handle )
+  {
+    string type = handle.GetTypeName();
+
+    const FeedbackStyleInfo styleInfo = GetStyleInfo( type );
+
+    for( SignalFeedbackInfoConstIter iter = styleInfo.mSignalFeedbackInfoList.begin(); iter != styleInfo.mSignalFeedbackInfoList.end(); ++iter )
+    {
+      const SignalFeedbackInfo& info = *iter;
+
+      if( info.mHasHapticFeedbackInfo || info.mHasSoundFeedbackInfo )
+      {
+        if( !info.mHapticFeedbackPattern.empty() || !info.mHapticFeedbackFile.empty() ||
+            !info.mSoundFeedbackPattern.empty()  || !info.mSoundFeedbackFile.empty() )
+        {
+          handle.ConnectSignal( this,
+                                info.mSignalName,
+                                PlayFeedbackFromSignal( *this, type, info.mSignalName ) );
+
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FeedbackStyle::Set found Haptic pattern %s for Object type: %s, Signal Type: %s\n",
+                         info.mHapticFeedbackPattern.c_str(), type.c_str(), info.mSignalName.c_str() );
+        }
+        else
+        {
+          DALI_LOG_ERROR("FeedbackStyle::Set() Warning Inconsistent data in theme file!\n");
+        }
+      }
+    }
+  }
+}
+
+const FeedbackStyleInfo& FeedbackStyle::GetStyleInfo( const string& type ) const
+{
+  std::map<const string, FeedbackStyleInfo>::const_iterator iter( mStyleInfoLut.find( type ) );
+  if( iter != mStyleInfoLut.end() )
+  {
+    return iter->second;
+  }
+  else
+  {
+    return DEFAULT_FEEDBACK_STYLE_INFO;
+  }
+}
+
+void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali::StyleChange::Type styleChange )
+{
+  if( StyleChange::THEME_CHANGE )
+  {
+    string userDefinedTheme;
+
+    if( mFeedback && mFeedback.LoadFile( userDefinedThemePath, userDefinedTheme ) )
+    {
+      if( !LoadTheme( userDefinedTheme ) )
+      {
+        DALI_LOG_ERROR("FeedbackStyle::StyleChanged() User defined theme failed to load! \n");
+
+        //If there is any problem is using the user defined theme, then fall back to default theme
+        if( !LoadTheme( DEFAULT_FEEDBACK_THEME_PATH ) )
+        {
+          //If the default theme fails, Then No luck!
+          DALI_LOG_ERROR("FeedbackStyle::StyleChanged() Default theme failed to load! \n");
+        }
+      }
+      else
+      {
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceLoader::LoadTheme(%s) - loaded %d bytes\n",
+                       userDefinedThemePath.c_str(), userDefinedTheme.size() );
+      }
+    }
+    else
+    {
+      DALI_LOG_ERROR("ResourceLoader::LoadTheme(%s) - failed to load\n", userDefinedThemePath.c_str());
+    }
+  }
+}
+
+bool FeedbackStyle::LoadTheme( const string& data )
+{
+  bool result = false;
+
+  try
+  {
+    LoadFromString( data );
+
+    result = true;
+  }
+  catch(...)
+  {
+    //Problem in user set theme, So fallback to use default theme.
+    DALI_LOG_ERROR( "FeedbackStyle::LoadTheme() Failed to load theme\n" );
+  }
+
+  return result;
+}
+
+void FeedbackStyle::LoadFromString( const string& data )
+{
+  Toolkit::JsonParser parser = Toolkit::JsonParser::New();
+  const Toolkit::TreeNode* root = NULL;
+
+  if( !parser.Parse( data ) )
+  {
+    DALI_LOG_WARNING( "JSON Parse Error:'%s'\n", parser.GetErrorDescription().c_str() );
+    DALI_LOG_WARNING( "JSON Parse Line :'%d (%d)'\n",
+                      parser.GetErrorLineNumber(),
+                      parser.GetErrorColumn() );
+  }
+  else
+  {
+    root = parser.GetRoot();
+  }
+
+  if(root)
+  {
+    // Clear previously loaded style
+    mStyleInfoLut.clear();
+
+    // Parse style
+    if( const TreeNode* node = root->GetChild("style") )
+    {
+      Toolkit::TreeNode::ConstIterator iter = node->CBegin();
+      Toolkit::TreeNode::ConstIterator end = node->CEnd();
+      for( ; iter != end; ++iter )
+      {
+        const char* key = (*iter).first;
+        FeedbackStyleInfo themeInfo;
+        themeInfo.mTypeName = key;
+
+        if( const TreeNode* signals = (*iter).second.GetChild("signals") )
+        {
+          TreeNode::ConstIterator signalIter = signals->CBegin();
+          TreeNode::ConstIterator signalEnd = signals->CEnd();
+          for( ; signalIter != signalEnd; ++signalIter )
+          {
+            SignalFeedbackInfo signalFeedbackInfo;
+
+            const TreeNode* type = (*signalIter).second.GetChild("type");
+            DALI_ASSERT_ALWAYS(type && TreeNode::STRING == type->GetType() && "Signal must have a type");
+            signalFeedbackInfo.mSignalName = type->GetString();
+
+            GetIfString( (*signalIter).second, "haptic-feedback-pattern",
+                         signalFeedbackInfo.mHasHapticFeedbackInfo,
+                         signalFeedbackInfo.mHapticFeedbackPattern );
+
+            GetIfString( (*signalIter).second, "haptic-feedback-file",
+                         signalFeedbackInfo.mHasHapticFeedbackInfo,
+                         signalFeedbackInfo.mHapticFeedbackFile );
+
+            GetIfString( (*signalIter).second, "sound-feedback-pattern",
+                         signalFeedbackInfo.mHasSoundFeedbackInfo,
+                         signalFeedbackInfo.mSoundFeedbackPattern );
+
+            GetIfString( (*signalIter).second, "haptic-feedback-file",
+                         signalFeedbackInfo.mHasSoundFeedbackInfo,
+                         signalFeedbackInfo.mSoundFeedbackFile );
+
+            if( signalFeedbackInfo.mHasHapticFeedbackInfo || signalFeedbackInfo.mHasSoundFeedbackInfo )
+            {
+              AddSignalInfo( themeInfo, signalFeedbackInfo );
+            }
+          }
+        }
+
+        mStyleInfoLut[key] = themeInfo;
+
+      } // for styles
+    } // if(style)
+  } // if(root)
+
+} // LoadFromString()
+
+void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo signalInfo )
+{
+  bool updated = false;
+  std::vector<SignalFeedbackInfo>::iterator iter;
+
+  // If info exists for the signal then update it, else add new
+  for( iter = styleInfo.mSignalFeedbackInfoList.begin(); iter != styleInfo.mSignalFeedbackInfoList.end(); ++iter )
+  {
+    if( (*iter).mSignalName == signalInfo.mSignalName )
+    {
+      (*iter).mHasHapticFeedbackInfo = signalInfo.mHasHapticFeedbackInfo;
+      (*iter).mHapticFeedbackPattern = signalInfo.mHapticFeedbackPattern;
+      (*iter).mHapticFeedbackFile    = signalInfo.mHapticFeedbackFile;
+      (*iter).mHasSoundFeedbackInfo  = signalInfo.mHasSoundFeedbackInfo;
+      (*iter).mSoundFeedbackPattern  = signalInfo.mSoundFeedbackPattern;
+      (*iter).mSoundFeedbackFile     = signalInfo.mSoundFeedbackFile;
+
+      updated = true;
+      break;
+    }
+  }
+
+  if( !updated )
+  {
+    styleInfo.mSignalFeedbackInfoList.push_back( signalInfo );
+  }
+}
+
+void FeedbackStyle::PlayFeedback(const string& type, const string& signalName)
+{
+  const FeedbackStyleInfo styleInfo = GetStyleInfo(type);
+  SignalFeedbackInfoConstIter iter;
+
+  for(iter = styleInfo.mSignalFeedbackInfoList.begin(); iter != styleInfo.mSignalFeedbackInfoList.end(); ++iter)
+  {
+    const SignalFeedbackInfo& info = *iter;
+
+    if(info.mSignalName == signalName)
+    {
+      if(info.mHasHapticFeedbackInfo)
+      {
+        if(!info.mHapticFeedbackPattern.empty())
+        {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FeedbackStyle::PlayFeedback Playing Haptic effect: Object type: %s, Signal type: %s, pattern type: %s\n",
+              type.c_str(), signalName.c_str(), info.mHapticFeedbackPattern.c_str());
+
+          mFeedback.PlayFeedbackPattern( FEEDBACK_TYPE_VIBRATION, GetFeedbackPattern(info.mHapticFeedbackPattern) );
+        }
+        else if(!info.mHapticFeedbackFile.empty())
+        {
+          mFeedback.PlayFile( info.mHapticFeedbackFile );
+        }
+      }
+
+      if(info.mHasSoundFeedbackInfo)
+      {
+        if(!info.mSoundFeedbackPattern.empty())
+        {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FeedbackStyle::PlayFeedback Playing Sound effect: Object type: %s, Signal type: %s, pattern type: %s\n",
+              type.c_str(), signalName.c_str(), info.mHapticFeedbackPattern.c_str());
+
+          mFeedback.PlayFeedbackPattern( FEEDBACK_TYPE_SOUND, GetFeedbackPattern(info.mSoundFeedbackPattern) );
+        }
+        else if(!info.mSoundFeedbackFile.empty())
+        {
+          mFeedback.PlaySound( info.mSoundFeedbackFile );
+        }
+      }
+
+      break;
+    }
+  }
+}
+
+FeedbackPattern FeedbackStyle::GetFeedbackPattern( const string &pattern )
+{
+  if( 0 == mFeedbackPatternLut.size() )
+  {
+    mFeedbackPatternLut["FEEDBACK_PATTERN_NONE"]                = Dali::FEEDBACK_PATTERN_NONE;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_TAP"]                 = Dali::FEEDBACK_PATTERN_TAP;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_SIP"]                 = Dali::FEEDBACK_PATTERN_SIP;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_SIP_BACKSPACE"]       = Dali::FEEDBACK_PATTERN_SIP_BACKSPACE;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_MAX_CHARACTER"]       = Dali::FEEDBACK_PATTERN_MAX_CHARACTER;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY0"]                = Dali::FEEDBACK_PATTERN_KEY0;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY1"]                = Dali::FEEDBACK_PATTERN_KEY1;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY2"]                = Dali::FEEDBACK_PATTERN_KEY2;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY3"]                = Dali::FEEDBACK_PATTERN_KEY3;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY4"]                = Dali::FEEDBACK_PATTERN_KEY4;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY5"]                = Dali::FEEDBACK_PATTERN_KEY5;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY6"]                = Dali::FEEDBACK_PATTERN_KEY6;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY7"]                = Dali::FEEDBACK_PATTERN_KEY7;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY8"]                = Dali::FEEDBACK_PATTERN_KEY8;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY9"]                = Dali::FEEDBACK_PATTERN_KEY9;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY_STAR"]            = Dali::FEEDBACK_PATTERN_KEY_STAR;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_KEY_SHARP"]           = Dali::FEEDBACK_PATTERN_KEY_SHARP;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_HOLD"]                = Dali::FEEDBACK_PATTERN_HOLD;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_MULTI_TAP"]           = Dali::FEEDBACK_PATTERN_MULTI_TAP;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_HW_TAP"]              = Dali::FEEDBACK_PATTERN_HW_TAP;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_HW_HOLD"]             = Dali::FEEDBACK_PATTERN_HW_HOLD;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_MESSAGE"]             = Dali::FEEDBACK_PATTERN_MESSAGE;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_MESSAGE_ON_CALL"]     = Dali::FEEDBACK_PATTERN_MESSAGE_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_EMAIL"]               = Dali::FEEDBACK_PATTERN_EMAIL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_EMAIL_ON_CALL"]       = Dali::FEEDBACK_PATTERN_EMAIL_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_WAKEUP"]              = Dali::FEEDBACK_PATTERN_WAKEUP;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_WAKEUP_ON_CALL"]      = Dali::FEEDBACK_PATTERN_WAKEUP_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_SCHEDULE"]            = Dali::FEEDBACK_PATTERN_SCHEDULE;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_SCHEDULE_ON_CALL"]    = Dali::FEEDBACK_PATTERN_SCHEDULE_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_TIMER"]               = Dali::FEEDBACK_PATTERN_TIMER;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_TIMER_ON_CALL"]       = Dali::FEEDBACK_PATTERN_TIMER_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_GENERAL"]             = Dali::FEEDBACK_PATTERN_GENERAL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_GENERAL_ON_CALL"]     = Dali::FEEDBACK_PATTERN_GENERAL_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_POWER_ON"]            = Dali::FEEDBACK_PATTERN_POWER_ON;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_POWER_OFF"]           = Dali::FEEDBACK_PATTERN_POWER_OFF;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_CHARGERCONN"]         = Dali::FEEDBACK_PATTERN_CHARGERCONN;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_CHARGERCONN_ON_CALL"] = Dali::FEEDBACK_PATTERN_CHARGERCONN_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_FULLCHARGED"]         = Dali::FEEDBACK_PATTERN_FULLCHARGED;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_FULLCHARGED_ON_CALL"] = Dali::FEEDBACK_PATTERN_FULLCHARGED_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_LOWBATT"]             = Dali::FEEDBACK_PATTERN_LOWBATT;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_LOWBATT_ON_CALL"]     = Dali::FEEDBACK_PATTERN_LOWBATT_ON_CALL;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_LOCK"]                = Dali::FEEDBACK_PATTERN_LOCK;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_UNLOCK"]              = Dali::FEEDBACK_PATTERN_UNLOCK;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_CALLCONNECT"]         = Dali::FEEDBACK_PATTERN_CALLCONNECT;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_DISCALLCONNECT"]      = Dali::FEEDBACK_PATTERN_DISCALLCONNECT;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_MINUTEMINDER"]        = Dali::FEEDBACK_PATTERN_MINUTEMINDER;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_VIBRATION"]           = Dali::FEEDBACK_PATTERN_VIBRATION;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_SHUTTER"]             = Dali::FEEDBACK_PATTERN_SHUTTER;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_LIST_REORDER"]        = Dali::FEEDBACK_PATTERN_LIST_REORDER;
+    mFeedbackPatternLut["FEEDBACK_PATTERN_SLIDER_SWEEP"]        = Dali::FEEDBACK_PATTERN_SLIDER_SWEEP;
+  }
+
+  std::map<const string, FeedbackPattern>::const_iterator iter( mFeedbackPatternLut.find( pattern ) );
+
+  if( iter != mFeedbackPatternLut.end() )
+  {
+    return iter->second;
+  }
+  else
+  {
+    DALI_LOG_ERROR( "Unknown feedback pattern type: %s, So Defaulting to FEEDBACK_PATTERN_NONE!\n" );
+    return Dali::FEEDBACK_PATTERN_NONE;
+  }
+}
+
+} // namespace Toolkit
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/feedback/feedback-style.h b/dali-toolkit/internal/feedback/feedback-style.h
new file mode 100644 (file)
index 0000000..0f8d270
--- /dev/null
@@ -0,0 +1,162 @@
+#ifndef __DALI_INTERNAL_FEEDBACK_STYLE_H__
+#define __DALI_INTERNAL_FEEDBACK_STYLE_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <map>
+#include <dali/public-api/object/base-handle.h>
+#include <dali/devel-api/adaptor-framework/feedback-player.h>
+#include <dali/public-api/signals/connection-tracker.h>
+#include <dali/public-api/adaptor-framework/style-change.h>
+#include <dali/public-api/signals/slot-delegate.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/feedback/feedback-ids.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+struct FeedbackStyleInfo;
+struct SignalFeedbackInfo;
+
+/**
+ * Plays feedback effects for Dali-Toolkit UI Controls.
+ *
+ * This functionality relies on an adaptor plugin.
+ * (And will have no effect if this is not loaded)
+ *
+ */
+class FeedbackStyle : public ConnectionTracker
+{
+public:
+
+  /**
+   * Constructor.
+   */
+  FeedbackStyle();
+
+  /**
+   * The destructor
+   */
+  ~FeedbackStyle();
+
+  /**
+   * Called to start playing feedback effects.
+   */
+  void Start();
+
+  /**
+   * Called to stop playing feedback effects.
+   */
+  void Stop();
+
+  /**
+   * Callback function to play a feedback effect when a signal is emitted for an object
+   * Plays feedback effect.
+   * @param [in] type The Object type
+   * @param [in] signalName The name of the signal
+   */
+  void PlayFeedback(const std::string& type, const std::string& signalName);
+
+  /**
+   * Connects feedback to signals for the newly created object
+   * @param [in] object Handle to the newly created object
+   */
+  void ObjectCreated( BaseHandle object );
+
+  /**
+   * Style changed so reload the theme file
+   * @param [in] userDefinedThemePath Theme filename path
+   * @param [in] styleChange The type of style change
+   */
+  void StyleChanged(const std::string& userDefinedThemePath, StyleChange::Type styleChange);
+
+private:
+
+  /**
+   * Helper to retrieve styleInfo from mStyleInfoLut
+   * @param type A string described a type of object
+   * @return The style information for the given object
+   */
+  const FeedbackStyleInfo& GetStyleInfo( const std::string& type) const;
+
+  /**
+   * Callback function for Dali::Toolkit::PushButton::SignalPressed signal
+   * Plays feedback effect.
+   * @param [in] effect The feedback effect to play
+   */
+  bool LoadTheme(const std::string& data);
+
+  /**
+   * Loads a string representation the theme.
+   * @param [in] data A string represenation of the theme.
+   * @param [in] format The string representation format ie JSON.
+   */
+  void LoadFromString( const std::string& data );
+
+  /**
+   * Helper to store signal information.
+   * @param [in] styleInfo The information will be stored here.
+   * @param [in] signalInfo The information to add.
+   */
+  void AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo signalInfo );
+
+  /**
+   * Map a pattern string to feedback pattern ID.
+   * @param [in] pattern The pattern string.
+   * @return A feedback pattern ID.
+   */
+  FeedbackPattern GetFeedbackPattern( const std::string& pattern );
+
+  /**
+   * Plays a feedback effect
+   * @param [in] type The feedback type haptic or sound
+   * @param [in] effect The feedback effect to play
+   */
+  void PlayEffect(FeedbackType type, FeedbackPattern effect);
+
+  /**
+   * Plays a haptic or sound effect file
+   * @param [in] type The feedback type haptic or sound
+   * @param [in] file The path to the file containing the effect
+   */
+  void PlayFile(FeedbackType type, const std::string& file);
+
+private:
+  Dali::FeedbackPlayer mFeedback;
+
+  std::map<const std::string, FeedbackPattern>   mFeedbackPatternLut; ///< Used to convert feedback pattern strings into enumerated values
+  std::map<const std::string, FeedbackStyleInfo> mStyleInfoLut;       ///< Converts key strings into style information
+
+  SlotDelegate< FeedbackStyle > mConnections; ///< Maintains the connections to the Object registry.
+};
+
+} // namespace Toolkit
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_FEEDBACK_STYLE_H__
index 807c3a2..0b8b570 100644 (file)
@@ -51,6 +51,9 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/text-controls/text-selection-toolbar-impl.cpp \
    $(toolkit_src_dir)/controls/tool-bar/tool-bar-impl.cpp \
    $(toolkit_src_dir)/accessibility-manager/accessibility-manager-impl.cpp \
+   \
+   $(toolkit_src_dir)/feedback/feedback-style.cpp \
+   \
    $(toolkit_src_dir)/focus-manager/keyboard-focus-manager-impl.cpp \
    $(toolkit_src_dir)/focus-manager/keyinput-focus-manager-impl.cpp \
    $(toolkit_src_dir)/filters/blur-two-pass-filter.cpp \
index 814421e..c245c15 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/devel-api/styling/style-manager.h>
+#include <dali-toolkit/internal/feedback/feedback-style.h>
 
 namespace
 {
@@ -99,7 +100,8 @@ Toolkit::StyleManager StyleManager::Get()
 StyleManager::StyleManager()
 : mOrientationDegrees( 0 ),  // Portrait
   mDefaultFontSize( -1 ),
-  mThemeFile( DEFAULT_THEME )
+  mThemeFile( DEFAULT_THEME ),
+  mFeedbackStyle( NULL )
 {
   // Add theme builder constants
   mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
@@ -111,10 +113,15 @@ StyleManager::StyleManager()
 
     mDefaultFontSize = mStyleMonitor.GetDefaultFontSize();
   }
+
+  // Sound & haptic style
+  mFeedbackStyle = new FeedbackStyle();
+
 }
 
 StyleManager::~StyleManager()
 {
+  delete mFeedbackStyle;
 }
 
 void StyleManager::SetOrientationValue( int orientation )
@@ -245,6 +252,7 @@ void StyleManager::BuildQualifiedStyleName( const std::string& styleName, const
 void StyleManager::ApplyStyle( Toolkit::Builder builder, Toolkit::Control control )
 {
   std::string styleName = control.GetStyleName();
+
   if( styleName.empty() )
   {
     // Convert control name to lower case
@@ -282,10 +290,28 @@ void StyleManager::ApplyStyle( Toolkit::Builder builder, Toolkit::Control contro
 
 void StyleManager::ApplyThemeStyle( Toolkit::Control control )
 {
+  if( !mThemeBuilder )
+  {
+    RequestDefaultTheme();
+  }
+
+  if( mThemeBuilder )
+  {
+    ApplyStyle( mThemeBuilder, control );
+  }
+}
+
+void StyleManager::ApplyThemeStyleAtInit( Toolkit::Control control )
+{
   if( mThemeBuilder )
   {
     ApplyStyle( mThemeBuilder, control );
   }
+
+  if(mFeedbackStyle)
+  {
+    mFeedbackStyle->ObjectCreated( control );
+  }
 }
 
 void StyleManager::ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName )
@@ -356,8 +382,14 @@ void StyleManager::RequestDefaultTheme()
 void StyleManager::SetTheme()
 {
   mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-  if ( LoadJSON( mThemeBuilder, mThemeFile ) )
+
+  if( LoadJSON( mThemeBuilder, mThemeFile ) )
   {
+    if(mFeedbackStyle)
+    {
+      mFeedbackStyle->StyleChanged( mThemeFile, StyleChange::THEME_CHANGE );
+    }
+
     mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), StyleChange::THEME_CHANGE );
   }
   else
index c612f7d..86c6d4c 100644 (file)
@@ -38,6 +38,9 @@ namespace Toolkit
 
 namespace Internal
 {
+
+class FeedbackStyle;
+
 /**
  * @copydoc Toolkit::StyleManager
  */
@@ -111,6 +114,13 @@ public:
   void ApplyThemeStyle( Toolkit::Control control );
 
   /**
+   * @brief Apply the theme style to a control at initialization.
+   *
+   * @param[in] control The control to apply style.
+   */
+  void ApplyThemeStyleAtInit( Toolkit::Control control );
+
+  /**
    * @copydoc Toolkit::StyleManager::ApplyStyle
    */
   void ApplyStyle( Toolkit::Control control, const std::string& jsonFileName, const std::string& styleName );
@@ -251,6 +261,8 @@ private:
 
   BuilderMap mBuilderCache;           ///< Cache of builders keyed by JSON file name
 
+  Toolkit::Internal::FeedbackStyle* mFeedbackStyle; ///< Feedback style
+
   // Signals
   Toolkit::StyleManager::StyleChangeSignalType       mStyleChangeSignal;         ///< Emitted when the style( theme/font ) changes
 };
index 43867b4..d09eacb 100644 (file)
@@ -273,6 +273,7 @@ struct Decorator::Impl : public ConnectionTracker
     mScrollThreshold( SCROLL_THRESHOLD ),
     mScrollSpeed( SCROLL_SPEED ),
     mScrollDistance( SCROLL_DISTANCE ),
+    mTextDepth( 0u ),
     mActiveCopyPastePopup( false ),
     mCursorBlinkStatus( true ),
     mPrimaryCursorVisible( false ),
@@ -281,7 +282,7 @@ struct Decorator::Impl : public ConnectionTracker
     mNotifyEndOfScroll( false )
   {
     mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
-    mQuadIndexFormat[ "indices" ] = Property::UNSIGNED_INTEGER;
+    mQuadIndexFormat[ "indices" ] = Property::INTEGER;
     mHighlightMaterial = Material::New( Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ) );
   }
 
@@ -296,6 +297,7 @@ struct Decorator::Impl : public ConnectionTracker
 
     // Show or hide the cursors
     CreateCursors();
+
     if( mPrimaryCursor )
     {
       const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
@@ -338,7 +340,7 @@ struct Decorator::Impl : public ConnectionTracker
         CreateGrabHandle();
 
         grabHandle.actor.SetPosition( position.x,
-                                      position.y + grabHandle.lineHeight );
+                                      grabHandle.lineHeight ); // TODO : Fix for multiline.
       }
       grabHandle.actor.SetVisible( isVisible );
     }
@@ -367,13 +369,13 @@ struct Decorator::Impl : public ConnectionTracker
         if( isPrimaryVisible )
         {
           primary.actor.SetPosition( primaryPosition.x,
-                                     primaryPosition.y + primary.lineHeight );
+                                     primary.lineHeight ); // TODO : Fix for multiline.
         }
 
         if( isSecondaryVisible )
         {
           secondary.actor.SetPosition( secondaryPosition.x,
-                                       secondaryPosition.y + secondary.lineHeight );
+                                       secondary.lineHeight ); // TODO : Fix for multiline.
         }
       }
       primary.actor.SetVisible( isPrimaryVisible );
@@ -803,24 +805,25 @@ struct Decorator::Impl : public ConnectionTracker
         mQuadVertices.SetData( &vertices[ 0 ] );
         mQuadIndices.SetData( &indices[ 0 ] );
 
-        mQuadGeometry = Geometry::New();
-        mQuadGeometry.AddVertexBuffer( mQuadVertices );
-        mQuadGeometry.SetIndexBuffer( mQuadIndices );
-
-        if( mHighlightRenderer )
+        if( !mQuadGeometry )
         {
-          mHighlightRenderer.SetGeometry( mQuadGeometry );
+          mQuadGeometry = Geometry::New();
+          mQuadGeometry.AddVertexBuffer( mQuadVertices );
         }
-        else
+        mQuadGeometry.SetIndexBuffer( mQuadIndices );
+
+        if( !mHighlightRenderer )
         {
           mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial );
           mHighlightActor.AddRenderer( mHighlightRenderer );
         }
-
-        mHighlightActor.SetPosition( mHighlightPosition.x,
-                                     mHighlightPosition.y );
       }
 
+      mHighlightActor.SetPosition( mHighlightPosition.x,
+                                   mHighlightPosition.y );
+
+      mHighlightQuadList.clear();
+
       mHighlightRenderer.SetDepthIndex( mTextDepth - 2u ); // text is rendered at mTextDepth and text's shadow at mTextDepth -1u.
     }
   }
@@ -1525,6 +1528,7 @@ void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButt
    if( mImpl->mActiveLayer )
    {
      mImpl->mActiveLayer.Add( mImpl->mCopyPastePopup.actor );
+     mImpl->mCopyPastePopup.actor.ShowPopup();
    }
 }
 
index e75009d..01a5786 100644 (file)
@@ -229,6 +229,14 @@ struct LayoutEngine::Impl
       // Get the glyph info.
       const GlyphInfo& glyphInfo = *( parameters.glyphsBuffer + glyphIndex );
 
+      // Check if the font of the current glyph is the same of the previous one.
+      // If it's different the ascender and descender need to be updated.
+      if( lastFontId != glyphInfo.fontId )
+      {
+        UpdateLineHeight( glyphInfo.fontId, tmpLineLayout );
+        lastFontId = glyphInfo.fontId;
+      }
+
       // Get the character indices for the current glyph. The last character index is needed
       // because there are glyphs formed by more than one character but their break info is
       // given only for the last character.
@@ -421,14 +429,6 @@ struct LayoutEngine::Impl
         tmpLineLayout.Clear();
       }
 
-      // Check if the font of the current glyph is the same of the previous one.
-      // If it's different the ascender and descender need to be updated.
-      if( lastFontId != glyphInfo.fontId )
-      {
-        UpdateLineHeight( glyphInfo.fontId, tmpLineLayout );
-        lastFontId = glyphInfo.fontId;
-      }
-
       previousCharacterDirection = characterDirection;
     }
 
index 1053ea9..fe8da41 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/common/stage.h>
+#include <dali/integration-api/debug.h>
 
 #define MAKE_SHADER(A)#A
 
 namespace
 {
+
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
+#endif
+
 const char* VERTEX_SHADER = MAKE_SHADER(
 attribute mediump vec2    aPosition;
 attribute mediump vec2    aTexCoord;
@@ -77,7 +83,8 @@ void main()
   gl_FragColor = vec4(uColor.rgb, uColor.a*color.r);
 }
 );
-}
+
+} // unnamed namespace
 
 namespace Dali
 {
@@ -95,32 +102,12 @@ AtlasGlyphManager::AtlasGlyphManager()
   mShadowShader = Shader::New( VERTEX_SHADER_SHADOW, FRAGMENT_SHADER_SHADOW, Dali::Shader::HINT_MODIFIES_GEOMETRY );
 }
 
-AtlasGlyphManager::~AtlasGlyphManager()
-{
-  // Clear up any remaining references
-  for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
-        fontGlyphRecordIt != mFontGlyphRecords.end();
-        ++fontGlyphRecordIt )
-  {
-    for ( Vector< GlyphRecordEntry >::Iterator glyphRecordEntryIt = fontGlyphRecordIt->mGlyphRecords.Begin();
-          glyphRecordEntryIt != fontGlyphRecordIt->mGlyphRecords.End();
-          ++glyphRecordEntryIt )
-    {
-      mAtlasManager.Remove( glyphRecordEntryIt->mImageId );
-    }
-  }
-}
-
-AtlasGlyphManagerPtr AtlasGlyphManager::New()
-{
-  AtlasGlyphManagerPtr internal = new AtlasGlyphManager();
-  return internal;
-}
-
 void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
                              const BufferImage& bitmap,
                              Dali::Toolkit::AtlasManager::AtlasSlot& slot )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "Added glyph, font: %d index: %d\n", glyph.fontId, glyph.index );
+
   mAtlasManager.Add( bitmap, slot );
 
   GlyphRecordEntry record;
@@ -166,7 +153,7 @@ void AtlasGlyphManager::StitchMesh( Toolkit::AtlasManager::Mesh2D& first,
 }
 
 bool AtlasGlyphManager::Cached( Text::FontId fontId,
-                                uint32_t index,
+                                Text::GlyphIndex index,
                                 Dali::Toolkit::AtlasManager::AtlasSlot& slot )
 {
   for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
@@ -215,41 +202,65 @@ Pixel::Format AtlasGlyphManager::GetPixelFormat( uint32_t atlasId )
 
 const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
 {
+  std::ostringstream verboseMetrics;
+
   mMetrics.mGlyphCount = 0u;
   for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
         fontGlyphRecordIt != mFontGlyphRecords.end();
         ++fontGlyphRecordIt )
   {
     mMetrics.mGlyphCount += fontGlyphRecordIt->mGlyphRecords.Size();
+
+    verboseMetrics << "[FontId " << fontGlyphRecordIt->mFontId << " Glyph ";
+    for ( Vector< GlyphRecordEntry >::Iterator glyphRecordEntryIt = fontGlyphRecordIt->mGlyphRecords.Begin();
+          glyphRecordEntryIt != fontGlyphRecordIt->mGlyphRecords.End();
+          ++glyphRecordEntryIt )
+    {
+      verboseMetrics << glyphRecordEntryIt->mIndex << "(" << glyphRecordEntryIt->mCount << ") ";
+    }
+    verboseMetrics << "] ";
   }
+  mMetrics.mVerboseGlyphCounts = verboseMetrics.str();
+
   mAtlasManager.GetMetrics( mMetrics.mAtlasMetrics );
+
   return mMetrics;
 }
 
-void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, uint32_t imageId, int32_t delta )
+void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, Text::GlyphIndex index, int32_t delta )
 {
-  for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
-        fontGlyphRecordIt != mFontGlyphRecords.end();
-        ++fontGlyphRecordIt )
+  if( 0 != delta )
   {
-    if ( fontGlyphRecordIt->mFontId == fontId )
+    DALI_LOG_INFO( gLogFilter, Debug::General, "AdjustReferenceCount %d, font: %d index: %d\n", delta, fontId, index );
+
+    for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
+          fontGlyphRecordIt != mFontGlyphRecords.end();
+          ++fontGlyphRecordIt )
     {
-      for ( Vector< GlyphRecordEntry >::Iterator glyphRecordIt = fontGlyphRecordIt->mGlyphRecords.Begin();
-            glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
-            ++glyphRecordIt )
+      if ( fontGlyphRecordIt->mFontId == fontId )
       {
-        if ( glyphRecordIt->mImageId == imageId )
+        for ( Vector< GlyphRecordEntry >::Iterator glyphRecordIt = fontGlyphRecordIt->mGlyphRecords.Begin();
+              glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
+              ++glyphRecordIt )
         {
-          glyphRecordIt->mCount += delta;
-          if ( !glyphRecordIt->mCount )
+          if ( glyphRecordIt->mIndex == index )
           {
-            mAtlasManager.Remove( glyphRecordIt->mImageId );
-            fontGlyphRecordIt->mGlyphRecords.Remove( glyphRecordIt );
+            glyphRecordIt->mCount += delta;
+            DALI_ASSERT_DEBUG( glyphRecordIt->mCount >= 0 && "Glyph ref-count should not be negative" );
+
+            if ( !glyphRecordIt->mCount )
+            {
+              mAtlasManager.Remove( glyphRecordIt->mImageId );
+              fontGlyphRecordIt->mGlyphRecords.Remove( glyphRecordIt );
+            }
+            return;
           }
-          return;
         }
       }
     }
+
+    // Should not arrive here
+    DALI_ASSERT_DEBUG( false && "Failed to adjust ref-count" );
   }
 }
 
@@ -263,6 +274,11 @@ Sampler AtlasGlyphManager::GetSampler( uint32_t atlasId ) const
   return mAtlasManager.GetSampler( atlasId );
 }
 
+AtlasGlyphManager::~AtlasGlyphManager()
+{
+  // mAtlasManager handle is automatically released here
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 5a90d17..ce937a8 100644 (file)
@@ -62,14 +62,10 @@ public:
     Vector< GlyphRecordEntry > mGlyphRecords;
   };
 
-  AtlasGlyphManager();
-
-  virtual ~AtlasGlyphManager();
-
-/**
-   * Create a new AtlasGlyphManager
+  /**
+   * @brief Constructor
    */
-  static AtlasGlyphManagerPtr New();
+  AtlasGlyphManager();
 
   /**
    * @copydoc Toolkit::AtlasGlyphManager::Add
@@ -116,7 +112,7 @@ public:
   /**
    * @copydoc toolkit::AtlasGlyphManager::AdjustReferenceCount
    */
-  void AdjustReferenceCount( Text::FontId fontId, uint32_t imageId, int32_t delta );
+  void AdjustReferenceCount( Text::FontId fontId, Text::GlyphIndex index, int32_t delta );
 
   /**
    * @copydoc Toolkit::AtlasGlyphManager::GetMaterial
@@ -149,6 +145,13 @@ public:
     return mShadowShader;
   }
 
+protected:
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~AtlasGlyphManager();
+
 private:
 
   Dali::Toolkit::AtlasManager mAtlasManager;          ///> Atlas Manager created by GlyphManager
index 7e1facd..e71ad89 100644 (file)
@@ -128,9 +128,9 @@ const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
   return GetImplementation(*this).GetMetrics();
 }
 
-void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, uint32_t imageId, int32_t delta )
+void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, Text::GlyphIndex index, int32_t delta )
 {
-  GetImplementation(*this).AdjustReferenceCount( fontId, imageId, delta );
+  GetImplementation(*this).AdjustReferenceCount( fontId, index, delta );
 }
 
 Shader AtlasGlyphManager::GetEffectBufferShader() const
index 6096612..a74ce28 100644 (file)
@@ -50,8 +50,9 @@ public:
     ~Metrics()
     {}
 
-    uint32_t mGlyphCount;                   // number of glyphs being managed
-    AtlasManager::Metrics mAtlasMetrics;    // metrics from the Atlas Manager
+    uint32_t mGlyphCount;                   ///< number of glyphs being managed
+    std::string mVerboseGlyphCounts;        ///< a verbose list of the glyphs + ref counts
+    AtlasManager::Metrics mAtlasMetrics;    ///< metrics from the Atlas Manager
   };
 
   /**
@@ -173,13 +174,13 @@ public:
   const Metrics& GetMetrics();
 
   /**
-   * @brief Adjust the reference count for an imageId and remove cache entry if it becomes free
+   * @brief Adjust the reference count for glyph
    *
-   * @param[in] fontId the font this image came from
-   * @param[in] imageId The imageId
-   * @param[in] delta adjustment to make to reference count
+   * @param[in] fontId The font this image came from
+   * @param[in] index The index of the glyph
+   * @param[in] delta The adjustment to make to the reference count
    */
-  void AdjustReferenceCount( Text::FontId fontId, uint32_t imageId, int32_t delta );
+  void AdjustReferenceCount( Text::FontId fontId, Text::GlyphIndex index, int32_t delta );
 
   /**
    * @brief Get Shader used for rendering glyph effect buffers
index 9d34fd2..d0cedf4 100644 (file)
@@ -104,7 +104,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
 
     mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
     mQuadVertexFormat[ "aTexCoord" ] = Property::VECTOR2;
-    mQuadIndexFormat[ "indices" ] = Property::UNSIGNED_INTEGER;
+    mQuadIndexFormat[ "indices" ] = Property::INTEGER;
   }
 
   void AddGlyphs( const std::vector<Vector2>& positions,
@@ -134,14 +134,11 @@ struct AtlasRenderer::Impl : public ConnectionTracker
       style = STYLE_DROP_SHADOW;
     }
 
-    if ( mTextCache.Size() )
-    {
-      // Update the glyph cache with any changes to current text
-      RemoveText( glyphs );
-    }
-
     CalculateBlocksSize( glyphs );
 
+    // Avoid emptying mTextCache (& removing references) until after incremented references for the new text
+    Vector< TextCacheEntry > newTextCache;
+
     for( uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i )
     {
       const GlyphInfo& glyph = glyphs[ i ];
@@ -235,13 +232,18 @@ struct AtlasRenderer::Impl : public ConnectionTracker
             mGlyphManager.Add( glyph, bitmap, slot );
           }
         }
+        else
+        {
+          // We have 2+ copies of the same glyph
+          mGlyphManager.AdjustReferenceCount( glyph.fontId, glyph.index, 1/*increment*/ );
+        }
 
         // Generate mesh data for this quad, plugging in our supplied position
         mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
         textCacheEntry.mFontId = glyph.fontId;
         textCacheEntry.mImageId = slot.mImageId;
         textCacheEntry.mIndex = glyph.index;
-        mTextCache.PushBack( textCacheEntry );
+        newTextCache.PushBack( textCacheEntry );
 
         // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
         StitchTextMesh( meshContainer,
@@ -256,6 +258,10 @@ struct AtlasRenderer::Impl : public ConnectionTracker
       }
     }
 
+    // Now remove references for the old text
+    RemoveText();
+    mTextCache.Swap( newTextCache );
+
     if ( underlineEnabled )
     {
       // Check to see if any of the text needs an underline
@@ -292,9 +298,12 @@ struct AtlasRenderer::Impl : public ConnectionTracker
                                                 metrics.mGlyphCount,
                                                 metrics.mAtlasMetrics.mAtlasCount,
                                                 metrics.mAtlasMetrics.mTextureMemoryUsed / 1024 );
+
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str() );
+
     for ( uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i )
     {
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n",
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "   Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n",
                                                  i + 1, i > 8 ? "" : " ",
                                                  metrics.mAtlasMetrics.mAtlasMetrics[ i ].mPixelFormat == Pixel::L8 ? "L8  " : "BGRA",
                                                  metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mWidth,
@@ -307,6 +316,15 @@ struct AtlasRenderer::Impl : public ConnectionTracker
 #endif
   }
 
+  void RemoveText()
+  {
+    for ( Vector< TextCacheEntry >::Iterator oldTextIter = mTextCache.Begin(); oldTextIter != mTextCache.End(); ++oldTextIter )
+    {
+      mGlyphManager.AdjustReferenceCount( oldTextIter->mFontId, oldTextIter->mIndex, -1/*decrement*/ );
+    }
+    mTextCache.Resize( 0 );
+  }
+
   Actor CreateMeshActor( const MeshRecord& meshRecord )
   {
     PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat, meshRecord.mMesh.mVertices.Size() );
@@ -442,58 +460,6 @@ struct AtlasRenderer::Impl : public ConnectionTracker
     }
   }
 
-  void RemoveText( const Vector<GlyphInfo>& glyphs )
-  {
-    Vector< CheckEntry > checked;
-    CheckEntry checkEntry;
-
-    for ( Vector< TextCacheEntry >::Iterator tCit = mTextCache.Begin(); tCit != mTextCache.End(); ++tCit )
-    {
-      uint32_t index = tCit->mIndex;
-      uint32_t fontId = tCit->mFontId;
-
-      // Check that this character has not already been checked...
-      bool wasChecked = false;
-      for ( Vector< CheckEntry >::Iterator cEit = checked.Begin(); cEit != checked.End(); ++cEit )
-      {
-        if ( fontId == cEit->mFontId && index == cEit->mIndex )
-        {
-          wasChecked = true;
-        }
-      }
-
-      if ( !wasChecked )
-      {
-
-        int32_t newCount = 0;
-        int32_t oldCount = 0;
-
-        // How many times does this character occur in the old text ?
-        for ( Vector< TextCacheEntry >::Iterator oTcit = mTextCache.Begin(); oTcit != mTextCache.End(); ++oTcit )
-        {
-          if ( fontId == oTcit->mFontId && index == oTcit->mIndex )
-          {
-            oldCount++;
-          }
-        }
-
-        // And how many times in the new ?
-        for ( Vector< GlyphInfo >::Iterator cGit = glyphs.Begin(); cGit != glyphs.End(); ++cGit )
-        {
-          if ( fontId == cGit->fontId && index == cGit->index )
-          {
-            newCount++;
-          }
-        }
-        mGlyphManager.AdjustReferenceCount( fontId, tCit->mImageId, newCount - oldCount );
-        checkEntry.mIndex = index;
-        checkEntry.mFontId = fontId;
-        checked.PushBack( checkEntry );
-      }
-    }
-    mTextCache.Resize( 0 );
-  }
-
   void CalculateBlocksSize( const Vector<GlyphInfo>& glyphs )
   {
     MaxBlockSize maxBlockSize;
@@ -779,7 +745,6 @@ AtlasRenderer::AtlasRenderer()
 
 AtlasRenderer::~AtlasRenderer()
 {
-  Vector< GlyphInfo > emptyGlyphs;
-  mImpl->RemoveText( emptyGlyphs );
+  mImpl->RemoveText();
   delete mImpl;
 }
index 17be8d8..eea4efa 100644 (file)
@@ -42,7 +42,7 @@ typedef IntrusivePtr<Renderer> RendererPtr;
  * @brief Abstract base class for Text renderers.
  *
  * This is reponsible for rendering the glyphs from a ViewInterface in the specified positions.
- * It is implemented by returning a RenderableActor intended as the child of a UI control.
+ * It is implemented by returning aActor intended as the child of a UI control.
  */
 class Renderer : public RefObject
 {
index 5c93ffe..12fbb2f 100644 (file)
@@ -81,8 +81,8 @@ namespace Text
  * @param[in] glyphIndex The index to the first glyph.
  * @param[in] numberOfGlyphs The number of glyphs.
  * @param[out] glyphMetrics Some glyph metrics (font height, advance, ascender and x bearing).
- * @param[in]
- * @param[in]
+ * @param[in] visualModel The visual model.
+ * @param[in] fontClient The font client.
  */
 void GetGlyphsMetrics( GlyphIndex glyphIndex,
                        Length numberOfGlyphs,
@@ -663,7 +663,7 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       if( handleStopScrolling )
       {
-        mEventData->mUpdateLeftSelectionPosition = ( mEventData->mLeftSelectionPosition != handlePosition ) && ( mEventData->mRightSelectionPosition != handlePosition);
+        mEventData->mUpdateLeftSelectionPosition = ( mEventData->mRightSelectionPosition != handlePosition );
         mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateLeftSelectionPosition;
 
         if( mEventData->mUpdateLeftSelectionPosition )
@@ -681,9 +681,8 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       if( handleStopScrolling )
       {
-        mEventData->mUpdateRightSelectionPosition = ( mEventData->mRightSelectionPosition != handlePosition ) && ( mEventData->mLeftSelectionPosition != handlePosition );
+        mEventData->mUpdateRightSelectionPosition = ( mEventData->mLeftSelectionPosition != handlePosition );
         mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateRightSelectionPosition;
-
         if( mEventData->mUpdateRightSelectionPosition )
         {
           mEventData->mRightSelectionPosition = handlePosition;
@@ -705,74 +704,84 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
     ClampHorizontalScroll( actualSize );
 
+    bool endOfScroll = false;
     if( Vector2::ZERO == ( currentScrollPosition - mEventData->mScrollPosition ) )
     {
       // Notify the decorator there is no more text to scroll.
       // The decorator won't send more scroll events.
       mEventData->mDecorator->NotifyEndOfScroll();
+      // Still need to set the position of the handle.
+      endOfScroll = true;
     }
-    else
-    {
-      const bool scrollRightDirection = xSpeed > 0.f;
-      const bool leftSelectionHandleEvent = Event::LEFT_SELECTION_HANDLE_EVENT == event.type;
-      const bool rightSelectionHandleEvent = Event::RIGHT_SELECTION_HANDLE_EVENT == event.type;
 
-      if( Event::GRAB_HANDLE_EVENT == event.type )
-      {
-        ChangeState( EventData::GRAB_HANDLE_PANNING );
+    // Set the position of the handle.
+    const bool scrollRightDirection = xSpeed > 0.f;
+    const bool leftSelectionHandleEvent = Event::LEFT_SELECTION_HANDLE_EVENT == event.type;
+    const bool rightSelectionHandleEvent = Event::RIGHT_SELECTION_HANDLE_EVENT == event.type;
 
-        Vector2 position = mEventData->mDecorator->GetPosition( GRAB_HANDLE );
+    if( Event::GRAB_HANDLE_EVENT == event.type )
+    {
+      ChangeState( EventData::GRAB_HANDLE_PANNING );
 
-        // Position the grag handle close to either the left or right edge.
-        position.x = scrollRightDirection ? 0.f : mControlSize.width;
+      Vector2 position = mEventData->mDecorator->GetPosition( GRAB_HANDLE );
 
-        // Get the new handle position.
-        // The grab handle's position is in decorator coords. Need to transforms to text coords.
-        const CharacterIndex handlePosition = GetClosestCursorIndex( position.x - mEventData->mScrollPosition.x - mAlignmentOffset.x,
-                                                                     position.y - mEventData->mScrollPosition.y - mAlignmentOffset.y );
+      // Position the grag handle close to either the left or right edge.
+      position.x = scrollRightDirection ? 0.f : mControlSize.width;
 
-        mEventData->mUpdateCursorPosition = mEventData->mPrimaryCursorPosition != handlePosition;
-        mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateCursorPosition;
-        mEventData->mPrimaryCursorPosition = handlePosition;
-      }
-      else if( leftSelectionHandleEvent || rightSelectionHandleEvent )
-      {
-        // TODO: This is recalculating the selection box every time the text is scrolled with the selection handles.
-        //       Think if something can be done to save power.
+      // Get the new handle position.
+      // The grab handle's position is in decorator coords. Need to transforms to text coords.
+      const CharacterIndex handlePosition = GetClosestCursorIndex( position.x - mEventData->mScrollPosition.x - mAlignmentOffset.x,
+                                                                   position.y - mEventData->mScrollPosition.y - mAlignmentOffset.y );
 
-        ChangeState( EventData::SELECTION_HANDLE_PANNING );
+      mEventData->mUpdateCursorPosition = mEventData->mPrimaryCursorPosition != handlePosition;
+      mEventData->mScrollAfterUpdatePosition = mEventData->mUpdateCursorPosition;
+      mEventData->mPrimaryCursorPosition = handlePosition;
+    }
+    else if( leftSelectionHandleEvent || rightSelectionHandleEvent )
+    {
+      // TODO: This is recalculating the selection box every time the text is scrolled with the selection handles.
+      //       Think if something can be done to save power.
 
-        Vector2 position = mEventData->mDecorator->GetPosition( leftSelectionHandleEvent ? Text::LEFT_SELECTION_HANDLE : Text::RIGHT_SELECTION_HANDLE );
+      ChangeState( EventData::SELECTION_HANDLE_PANNING );
 
-        // Position the selection handle close to either the left or right edge.
-        position.x = scrollRightDirection ? 0.f : mControlSize.width;
+      Vector2 position = mEventData->mDecorator->GetPosition( leftSelectionHandleEvent ? Text::LEFT_SELECTION_HANDLE : Text::RIGHT_SELECTION_HANDLE );
 
-        // Get the new handle position.
-        // The selection handle's position is in decorator coords. Need to transforms to text coords.
-        const CharacterIndex handlePosition = GetClosestCursorIndex( position.x - mEventData->mScrollPosition.x - mAlignmentOffset.x,
-                                                                     position.y - mEventData->mScrollPosition.y - mAlignmentOffset.y );
+      // Position the selection handle close to either the left or right edge.
+      position.x = scrollRightDirection ? 0.f : mControlSize.width;
 
-        if( leftSelectionHandleEvent )
+      // Get the new handle position.
+      // The selection handle's position is in decorator coords. Need to transforms to text coords.
+      const CharacterIndex handlePosition = GetClosestCursorIndex( position.x - mEventData->mScrollPosition.x - mAlignmentOffset.x,
+                                                                   position.y - mEventData->mScrollPosition.y - mAlignmentOffset.y );
+
+      if( leftSelectionHandleEvent )
+      {
+        const bool differentHandles = ( mEventData->mLeftSelectionPosition != handlePosition ) && ( mEventData->mRightSelectionPosition != handlePosition );
+        mEventData->mUpdateLeftSelectionPosition = endOfScroll || differentHandles;
+        if( differentHandles )
         {
-          mEventData->mUpdateLeftSelectionPosition = handlePosition != mEventData->mLeftSelectionPosition;
           mEventData->mLeftSelectionPosition = handlePosition;
         }
-        else
+      }
+      else
+      {
+        const bool differentHandles = ( mEventData->mRightSelectionPosition != handlePosition ) && ( mEventData->mLeftSelectionPosition != handlePosition );
+        mEventData->mUpdateRightSelectionPosition = endOfScroll || differentHandles;
+        if( differentHandles )
         {
-          mEventData->mUpdateRightSelectionPosition = handlePosition != mEventData->mRightSelectionPosition;
           mEventData->mRightSelectionPosition = handlePosition;
         }
+      }
 
-        if( mEventData->mUpdateLeftSelectionPosition || mEventData->mUpdateRightSelectionPosition )
-        {
-          RepositionSelectionHandles( mEventData->mLeftSelectionPosition,
-                                      mEventData->mRightSelectionPosition );
+      if( mEventData->mUpdateLeftSelectionPosition || mEventData->mUpdateRightSelectionPosition )
+      {
+        RepositionSelectionHandles( mEventData->mLeftSelectionPosition,
+                                    mEventData->mRightSelectionPosition );
 
-          mEventData->mScrollAfterUpdatePosition = true;
-        }
+        mEventData->mScrollAfterUpdatePosition = true;
       }
-      mEventData->mDecoratorUpdated = true;
     }
+    mEventData->mDecoratorUpdated = true;
   } // end ( HANDLE_SCROLLING == state )
 }
 
@@ -928,8 +937,9 @@ void Controller::Impl::RepositionSelectionHandles( CharacterIndex selectionStart
     std::swap( selectionStart, selectionEnd );
   }
 
-  GlyphIndex glyphStart = *( charactersToGlyphBuffer + selectionStart );
-  GlyphIndex glyphEnd = *( charactersToGlyphBuffer + ( selectionEnd - 1u ) ) + *( glyphsPerCharacterBuffer + ( selectionEnd - 1u ) ) - 1u;
+  const GlyphIndex glyphStart = *( charactersToGlyphBuffer + selectionStart );
+  const Length numberOfGlyphs = *( glyphsPerCharacterBuffer + ( selectionEnd - 1u ) );
+  const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + ( selectionEnd - 1u ) ) + ( ( numberOfGlyphs > 0 ) ? numberOfGlyphs - 1u : 0u );
 
   mEventData->mDecorator->SwapSelectionHandlesEnabled( firstLine.direction != indicesSwapped );
 
@@ -937,6 +947,7 @@ void Controller::Impl::RepositionSelectionHandles( CharacterIndex selectionStart
 
   for( GlyphIndex index = glyphStart; index <= glyphEnd; ++index )
   {
+    // TODO: Fix the LATIN ligatures. i.e ff, fi, etc...
     const GlyphInfo& glyph = *( glyphsBuffer + index );
     const Vector2& position = *( positionsBuffer + index );
 
@@ -1386,30 +1397,26 @@ void Controller::Impl::GetCursorPosition( CharacterIndex logical,
     return;
   }
 
-  // Get the previous logical index.
-  const CharacterIndex previousLogical = isFirstPosition ? 0u : logical - 1u;
+  // 'logical' is the logical 'cursor' index.
+  // Get the next and current logical 'character' index.
+  const CharacterIndex nextCharacterIndex = logical;
+  const CharacterIndex characterIndex = isFirstPosition ? logical : logical - 1u;
 
-  // Decrease the logical index if it's the last one.
-  if( isLastPosition )
-  {
-    --logical;
-  }
-
-  // Get the direction of the character and the previous one.
+  // Get the direction of the character and the next one.
   const CharacterDirection* const modelCharacterDirectionsBuffer = ( 0u != mLogicalModel->mCharacterDirections.Count() ) ? mLogicalModel->mCharacterDirections.Begin() : NULL;
 
   CharacterDirection isCurrentRightToLeft = false;
-  CharacterDirection isPreviousRightToLeft = false;
+  CharacterDirection isNextRightToLeft = false;
   if( NULL != modelCharacterDirectionsBuffer ) // If modelCharacterDirectionsBuffer is NULL, it means the whole text is left to right.
   {
-    isCurrentRightToLeft = *( modelCharacterDirectionsBuffer + logical );
-    isPreviousRightToLeft = *( modelCharacterDirectionsBuffer + previousLogical );
+    isCurrentRightToLeft = *( modelCharacterDirectionsBuffer + characterIndex );
+    isNextRightToLeft = *( modelCharacterDirectionsBuffer + nextCharacterIndex );
   }
 
   // Get the line where the character is laid-out.
   const LineRun* modelLines = mVisualModel->mLines.Begin();
 
-  const LineIndex lineIndex = mVisualModel->GetLineOfCharacter( logical );
+  const LineIndex lineIndex = mVisualModel->GetLineOfCharacter( characterIndex );
   const LineRun& line = *( modelLines + lineIndex );
 
   // Get the paragraph's direction.
@@ -1417,123 +1424,106 @@ void Controller::Impl::GetCursorPosition( CharacterIndex logical,
 
   // Check whether there is an alternative position:
 
-  cursorInfo.isSecondaryCursor = ( isCurrentRightToLeft != isPreviousRightToLeft ) ||
-    ( isLastPosition && ( isRightToLeftParagraph != isCurrentRightToLeft ) );
+  cursorInfo.isSecondaryCursor = ( !isLastPosition && ( isCurrentRightToLeft != isNextRightToLeft ) ) ||
+                                 ( isLastPosition && ( isRightToLeftParagraph != isCurrentRightToLeft ) );
 
   // Set the line height.
   cursorInfo.lineHeight = line.ascender + -line.descender;
 
-  // Convert the cursor position into the glyph position.
-  CharacterIndex characterIndex = logical;
-  if( cursorInfo.isSecondaryCursor &&
-      ( isRightToLeftParagraph != isCurrentRightToLeft ) )
+  // Calculate the primary cursor.
+
+  CharacterIndex index = characterIndex;
+  if( cursorInfo.isSecondaryCursor )
   {
-    characterIndex = previousLogical;
+    // If there is a secondary position, the primary cursor may be in a different place than the logical index.
+
+    if( isLastPosition )
+    {
+      // The position of the cursor after the last character needs special
+      // care depending on its direction and the direction of the paragraph.
+
+      // Need to find the first character after the last character with the paragraph's direction.
+      // i.e l0 l1 l2 r0 r1 should find r0.
+
+      // TODO: check for more than one line!
+      index = isRightToLeftParagraph ? line.characterRun.characterIndex : line.characterRun.characterIndex + line.characterRun.numberOfCharacters - 1u;
+      index = mLogicalModel->GetLogicalCharacterIndex( index );
+    }
+    else
+    {
+      index = ( isRightToLeftParagraph == isCurrentRightToLeft ) ? characterIndex : nextCharacterIndex;
+    }
   }
 
-  const GlyphIndex currentGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + characterIndex );
-  const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + characterIndex );
-  const Length numberOfCharacters = *( mVisualModel->mCharactersPerGlyph.Begin() +currentGlyphIndex );
+  // Convert the cursor position into the glyph position.
+  const GlyphIndex primaryGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + index );
+  const Length primaryNumberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + index );
+  const Length primaryNumberOfCharacters = *( mVisualModel->mCharactersPerGlyph.Begin() + primaryGlyphIndex );
 
   // Get the metrics for the group of glyphs.
   GlyphMetrics glyphMetrics;
-  GetGlyphsMetrics( currentGlyphIndex,
-                    numberOfGlyphs,
+  GetGlyphsMetrics( primaryGlyphIndex,
+                    primaryNumberOfGlyphs,
                     glyphMetrics,
                     mVisualModel,
                     mFontClient );
 
-  float interGlyphAdvance = 0.f;
+  float glyphAdvance = 0.f;
   if( !isLastPosition &&
-      ( numberOfCharacters > 1u ) )
+      ( primaryNumberOfCharacters > 1u ) )
+  {
+    const CharacterIndex firstIndex = *( mVisualModel->mGlyphsToCharacters.Begin() + primaryGlyphIndex );
+    glyphAdvance = static_cast<float>( 1u + characterIndex - firstIndex ) * glyphMetrics.advance / static_cast<float>( primaryNumberOfCharacters );
+  }
+  else
   {
-    const CharacterIndex firstIndex = *( mVisualModel->mGlyphsToCharacters.Begin() + currentGlyphIndex );
-    interGlyphAdvance = static_cast<float>( characterIndex - firstIndex ) * glyphMetrics.advance / static_cast<float>( numberOfCharacters );
+    glyphAdvance = glyphMetrics.advance;
   }
 
   // Get the glyph position and x bearing.
-  const Vector2& currentPosition = *( mVisualModel->mGlyphPositions.Begin() + currentGlyphIndex );
+  const Vector2& primaryPosition = *( mVisualModel->mGlyphPositions.Begin() + primaryGlyphIndex );
 
-  // Set the cursor's height.
-  cursorInfo.primaryCursorHeight = glyphMetrics.fontHeight;
-
-  // Set the position.
-  cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + currentPosition.x + ( isCurrentRightToLeft ? glyphMetrics.advance : interGlyphAdvance );
-  cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
+  // Set the primary cursor's height.
+  cursorInfo.primaryCursorHeight = cursorInfo.isSecondaryCursor ? 0.5f * glyphMetrics.fontHeight : glyphMetrics.fontHeight;
 
+  // Set the primary cursor's position.
   if( isLastPosition )
   {
-    // The position of the cursor after the last character needs special
-    // care depending on its direction and the direction of the paragraph.
-
-    if( cursorInfo.isSecondaryCursor )
-    {
-      // Need to find the first character after the last character with the paragraph's direction.
-      // i.e l0 l1 l2 r0 r1 should find r0.
-
-      // TODO: check for more than one line!
-      characterIndex = isRightToLeftParagraph ? line.characterRun.characterIndex : line.characterRun.characterIndex + line.characterRun.numberOfCharacters - 1u;
-      characterIndex = mLogicalModel->GetLogicalCharacterIndex( characterIndex );
-
-      const GlyphIndex glyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + characterIndex );
-      const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + characterIndex );
-
-      const Vector2& position = *( mVisualModel->mGlyphPositions.Begin() + glyphIndex );
+    cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + primaryPosition.x + ( isRightToLeftParagraph ? 0.f : glyphMetrics.advance );
+  }
+  else
+  {
+    cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + primaryPosition.x + ( ( ( isFirstPosition && !isCurrentRightToLeft ) || ( !isFirstPosition && isCurrentRightToLeft ) ) ? 0.f : glyphAdvance );
+  }
+  cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
 
-      // Get the metrics for the group of glyphs.
-      GlyphMetrics glyphMetrics;
-      GetGlyphsMetrics( glyphIndex,
-                        numberOfGlyphs,
-                        glyphMetrics,
-                        mVisualModel,
-                        mFontClient );
+  // Calculate the secondary cursor.
 
-      cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + position.x + ( isRightToLeftParagraph ? 0.f : glyphMetrics.advance );
+  if( cursorInfo.isSecondaryCursor )
+  {
+    // Set the secondary cursor's height.
+    cursorInfo.secondaryCursorHeight = 0.5f * glyphMetrics.fontHeight;
 
-      cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
-    }
-    else
+    CharacterIndex index = characterIndex;
+    if( !isLastPosition )
     {
-      if( !isCurrentRightToLeft )
-      {
-        cursorInfo.primaryPosition.x += glyphMetrics.advance;
-      }
-      else
-      {
-        cursorInfo.primaryPosition.x -= glyphMetrics.advance;
-      }
+      index = ( isRightToLeftParagraph == isCurrentRightToLeft ) ? nextCharacterIndex : characterIndex;
     }
-  }
 
-  // Set the alternative cursor position.
-  if( cursorInfo.isSecondaryCursor )
-  {
-    // Convert the cursor position into the glyph position.
-    const CharacterIndex previousCharacterIndex = ( ( isRightToLeftParagraph != isCurrentRightToLeft ) ? logical : previousLogical );
-    const GlyphIndex previousGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + previousCharacterIndex );
-    const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + previousCharacterIndex );
+    const GlyphIndex secondaryGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + index );
+    const Length secondaryNumberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + index );
 
-    // Get the glyph position.
-    const Vector2& previousPosition = *( mVisualModel->mGlyphPositions.Begin() + previousGlyphIndex );
+    const Vector2& secondaryPosition = *( mVisualModel->mGlyphPositions.Begin() + index );
 
-    // Get the metrics for the group of glyphs.
-    GlyphMetrics glyphMetrics;
-    GetGlyphsMetrics( previousGlyphIndex,
-                      numberOfGlyphs,
+    GetGlyphsMetrics( secondaryGlyphIndex,
+                      secondaryNumberOfGlyphs,
                       glyphMetrics,
                       mVisualModel,
                       mFontClient );
 
-    // Set the cursor position and height.
-    cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + previousPosition.x + ( ( ( isLastPosition && !isCurrentRightToLeft ) ||
-                                                                                       ( !isLastPosition && isCurrentRightToLeft )    ) ? glyphMetrics.advance : 0.f );
-
-    cursorInfo.secondaryCursorHeight = 0.5f * glyphMetrics.fontHeight;
-
+    // Set the secondary cursor's position.
+    cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + secondaryPosition.x + ( isCurrentRightToLeft ? 0.f : glyphMetrics.advance );
     cursorInfo.secondaryPosition.y = cursorInfo.lineHeight - cursorInfo.secondaryCursorHeight - line.descender - ( glyphMetrics.fontHeight - glyphMetrics.ascender );
-
-    // Update the primary cursor height as well.
-    cursorInfo.primaryCursorHeight *= 0.5f;
   }
 }
 
index 86746c3..c7b7b89 100644 (file)
@@ -23,6 +23,9 @@
 
 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/image-actor.h>
+
 namespace Dali
 {
 
@@ -140,6 +143,51 @@ Actor Button::GetLabel() const
   return Dali::Toolkit::GetImplementation( *this ).GetLabel();
 }
 
+void Button::SetButtonImage( Image image )
+{
+  Actor imageActor = ImageActor::New( image );
+  Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
+}
+
+void Button::SetBackgroundImage( Image image )
+{
+  Actor imageActor = ImageActor::New( image );
+  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor );
+}
+
+void Button::SetSelectedImage( Image image )
+{
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor );
+}
+
+void Button::SetSelectedBackgroundImage( Image image )
+{
+  Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) );
+}
+
+void Button::SetDisabledBackgroundImage( Image image )
+{
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( imageActor );
+}
+
+void Button::SetDisabledImage( Image image )
+{
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( imageActor );
+}
+
+void Button::SetDisabledSelectedImage( Image image )
+{
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( imageActor );
+}
+
 Button::ButtonSignalType& Button::PressedSignal()
 {
   return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
index a49a9e0..baad4dc 100644 (file)
@@ -248,6 +248,55 @@ public:
    */
   Actor GetLabel() const;
 
+  /**
+   * @brief Sets the button image.
+   *
+   * @param[in] image The button image.
+   */
+  void SetButtonImage( Image image );
+
+  /**
+   * @brief Sets the background image.
+   *
+   * @param[in] image The background image.
+   */
+  void SetBackgroundImage( Image image );
+
+  /**
+   * @brief Sets the selected image.
+   *
+   * @param[in] image The selected image.
+   */
+  void SetSelectedImage( Image image );
+
+  /**
+   * @brief Sets the selected background image.
+   *
+   * @param[in] image The selected background image.
+   */
+  void SetSelectedBackgroundImage( Image image );
+
+  /**
+   * @brief Sets the disabled background image.
+   *
+   * @param[in] image The disabled background image.
+   */
+  void SetDisabledBackgroundImage( Image image );
+
+  /**
+   * @brief Sets the disabled button image.
+   *
+   * @param[in] image The disabled button image.
+   */
+  void SetDisabledImage( Image image );
+
+  /**
+   * @brief Sets the disabled selected button image.
+   *
+   * @param[in] image The disabled selected button image.
+   */
+  void SetDisabledSelectedImage( Image image );
+
 public: //Signals
 
   /**
index de1c2b0..e2f7f56 100644 (file)
@@ -22,7 +22,6 @@
 // INTERNAL INCLUDES
 
 #include <dali-toolkit/internal/controls/buttons/check-box-button-impl.h>
-#include <dali/public-api/actors/image-actor.h>
 
 namespace Dali
 {
@@ -63,66 +62,6 @@ CheckBoxButton CheckBoxButton::DownCast( BaseHandle handle )
   return Control::DownCast<CheckBoxButton, Internal::CheckBoxButton>(handle);
 }
 
-void CheckBoxButton::SetBackgroundImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetBackgroundImage( Actor image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
-}
-
-Actor CheckBoxButton::GetBackgroundImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
-}
-
-void CheckBoxButton::SetSelectedImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetSelectedImage( Actor image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
-}
-
-Actor CheckBoxButton::GetSelectedImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
-}
-
-void CheckBoxButton::SetDisabledBackgroundImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetDisabledBackgroundImage( Actor image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
-}
-
-Actor CheckBoxButton::GetDisabledBackgroundImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
-}
-
-void CheckBoxButton::SetDisabledSelectedImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetDisabledSelectedImage( Actor image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image );
-}
-
-Actor CheckBoxButton::GetDisabledSelectedImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetDisabledSelectedImage();
-}
-
 CheckBoxButton::CheckBoxButton( Internal::CheckBoxButton& implementation )
 : Button( implementation )
 {
index 9752213..5798ef3 100644 (file)
@@ -91,78 +91,6 @@ public:
    */
   static CheckBoxButton DownCast( BaseHandle handle );
 
-  /**
-   * Sets the background image.
-   *
-   * @param[in] image The background image.
-   */
-  void SetBackgroundImage( Image image );
-
-  /**
-   * @copydoc SetBackgroundImage( Image image )
-   */
-  void SetBackgroundImage( Actor image );
-
-  /**
-   * Gets the background image.
-   * @return An actor with the background image.
-   */
-  Actor GetBackgroundImage() const;
-
-  /**
-   * Sets the selected image.
-   *
-   * @param[in] image The selected image.
-   */
-  void SetSelectedImage( Image image );
-
-  /**
-   * @copydoc SetSelectedImage( Image image )
-   */
-  void SetSelectedImage( Actor image );
-
-  /**
-   * Gets the selected image.
-   * @return An actor with the selected image.
-   */
-  Actor GetSelectedImage() const;
-
-  /**
-   * Sets the disabled background image.
-   *
-   * @param[in] image The disabled background image.
-   */
-  void SetDisabledBackgroundImage( Image image );
-
-  /**
-   * @copydoc SetDisabledBackgroundImage( Image image )
-   */
-  void SetDisabledBackgroundImage( Actor image );
-
-  /**
-   * Gets the disabled background image.
-   * @return An actor with the disabled background image.
-   */
-  Actor GetDisabledBackgroundImage() const;
-
-  /**
-   * Sets the disabled selected image.
-   *
-   * @param[in] image The disabled selected image.
-   */
-  void SetDisabledSelectedImage( Image image );
-
-  /**
-   * @copydoc SetDisabledSelectedImage( Image image )
-   */
-  void SetDisabledSelectedImage( Actor image );
-
-  /**
-   * Gets the disabled selected image.
-   * @return An actor with the disabled selected image.
-   */
-  Actor GetDisabledSelectedImage() const;
-
 public: // Not intended for application developers
 
   /**
index 0ef9698..d3f21d7 100644 (file)
@@ -74,12 +74,6 @@ PushButton PushButton::DownCast( BaseHandle handle )
   return Control::DownCast<PushButton, Internal::PushButton>(handle);
 }
 
-void PushButton::SetButtonImage( Image image )
-{
-  Actor imageActor = ImageActor::New( image );
-  Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
-}
-
 void PushButton::SetButtonImage( Actor image )
 {
   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
@@ -90,12 +84,6 @@ Actor PushButton::GetButtonImage() const
   return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
 }
 
-void PushButton::SetBackgroundImage( Image image )
-{
-  Actor imageActor = ImageActor::New( image );
-  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor );
-}
-
 void PushButton::SetBackgroundImage( Actor image )
 {
   Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
@@ -106,13 +94,6 @@ Actor PushButton::GetBackgroundImage() const
   return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
 }
 
-void PushButton::SetSelectedImage( Image image )
-{
-  Actor imageActor = ImageActor::New( image );
-  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor );
-}
-
 void PushButton::SetSelectedImage( Actor image )
 {
   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
@@ -123,11 +104,6 @@ Actor PushButton::GetSelectedImage() const
   return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
 }
 
-void PushButton::SetSelectedBackgroundImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) );
-}
-
 void PushButton::SetSelectedBackgroundImage( Actor image )
 {
   Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image );
@@ -138,13 +114,6 @@ Actor PushButton::GetSelectedBackgroundImage() const
   return Dali::Toolkit::GetImplementation( *this ).GetSelectedBackgroundImage();
 }
 
-void PushButton::SetDisabledBackgroundImage( Image image )
-{
-  Actor imageActor = ImageActor::New( image );
-  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( imageActor );
-}
-
 void PushButton::SetDisabledBackgroundImage( Actor image )
 {
   Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
@@ -155,13 +124,6 @@ Actor PushButton::GetDisabledBackgroundImage() const
   return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
 }
 
-void PushButton::SetDisabledImage( Image image )
-{
-  Actor imageActor = ImageActor::New( image );
-  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( imageActor );
-}
-
 void PushButton::SetDisabledImage( Actor image )
 {
   Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
index dd3ffb6..a74610a 100644 (file)
@@ -121,12 +121,7 @@ public:
    */
   static PushButton DownCast( BaseHandle handle );
 
-  /**
-   * @brief Sets the button image.
-   *
-   * @param[in] image The button image.
-   */
-  void SetButtonImage( Image image );
+  using Button::SetButtonImage;
 
   /**
    * @brief SetButtonImage
@@ -145,12 +140,7 @@ public:
    */
   Actor GetButtonImage() const;
 
-  /**
-   * @brief Sets the background image.
-   *
-   * @param[in] image The background image.
-   */
-  void SetBackgroundImage( Image image );
+  using Button::SetBackgroundImage;
 
   /**
    * @brief SetBackgroundImage
@@ -169,12 +159,7 @@ public:
    */
   Actor GetBackgroundImage() const;
 
-  /**
-   * @brief Sets the selected image.
-   *
-   * @param[in] image The selected image.
-   */
-  void SetSelectedImage( Image image );
+  using Button::SetSelectedImage;
 
   /**
    * @copydoc SetSelectedImage( Image image )
@@ -188,12 +173,7 @@ public:
    */
   Actor GetSelectedImage() const;
 
-  /**
-   * @brief Sets the selected background image.
-   *
-   * @param[in] image The selected background image.
-   */
-  void SetSelectedBackgroundImage( Image image );
+  using Button::SetSelectedBackgroundImage;
 
   /**
    * @copydoc SetSelectedBackgroundImage( Image image )
@@ -207,12 +187,7 @@ public:
    */
   Actor GetSelectedBackgroundImage() const;
 
-  /**
-   * @brief Sets the disabled background image.
-   *
-   * @param[in] image The disabled background image.
-   */
-  void SetDisabledBackgroundImage( Image image );
+  using Button::SetDisabledBackgroundImage;
 
   /**
    * @copydoc SetDisabledBackgroundImage( Image image )
@@ -226,12 +201,7 @@ public:
    */
   Actor GetDisabledBackgroundImage() const;
 
-  /**
-   * @brief Sets the disabled button image.
-   *
-   * @param[in] image The disabled button image.
-   */
-  void SetDisabledImage( Image image );
+  using Button::SetDisabledImage;
 
   /**
    * @copydoc SetDisabledImage( Image image )
index e9fc76a..1a55cf2 100644 (file)
  *
  */
 
+#include <dali/public-api/actors/layer.h>
 namespace Dali
 {
 namespace Toolkit
 {
 enum ControlDepthIndexRanges
 {
-    BACKGROUND_DEPTH_INDEX    = -10000000,
-    CONTENT_DEPTH_INDEX       =  0,
-    DECORATION_DEPTH_INDEX    =  10000000
+    BACKGROUND_DEPTH_INDEX    = static_cast<int>( -Dali::Layer::TREE_DEPTH_MULTIPLIER * 0.1f ),
+    CONTENT_DEPTH_INDEX       = 0,
+    DECORATION_DEPTH_INDEX    = static_cast<int>( Dali::Layer::TREE_DEPTH_MULTIPLIER * 0.1f )
 };
 
 }
index c0c71ea..b4b9cdb 100644 (file)
@@ -239,7 +239,7 @@ Actor CreateBackground( Actor parent, const Vector4& color, Image image = Image(
 
     //Create the index buffer
     Property::Map indexFormat;
-    indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+    indexFormat["indices"] = Property::INTEGER;
     PropertyBuffer indexBuffer = PropertyBuffer::New( indexFormat, 6u );
     indexBuffer.SetData(gQuadIndex);
 
@@ -584,8 +584,8 @@ void Control::SetBackgroundColor( const Vector4& color )
     Actor actor = CreateBackground(Self(), color );
     background.actor = actor;
     mImpl->mAddRemoveBackgroundChild = true;
-    // use insert to guarantee its the first child (so that OVERLAY mode works)
-    Self().Insert( 0, actor );
+    // The actor does not need to be inserted to guarantee order.
+    Self().Add( actor );
     mImpl->mAddRemoveBackgroundChild = false;
   }
 
@@ -619,8 +619,8 @@ void Control::SetBackgroundImage( Image image )
    // Set the background actor before adding so that we do not inform derived classes
    background.actor = actor;
    mImpl->mAddRemoveBackgroundChild = true;
-   // use insert to guarantee its the first child (so that OVERLAY mode works)
-   Self().Insert( 0, actor );
+   // The actor does not need to be inserted to guarantee order.
+   Self().Add( actor );
    mImpl->mAddRemoveBackgroundChild = false;
 }
 
@@ -875,7 +875,7 @@ void Control::Initialize()
       styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange );
 
       // Apply the current style
-      GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+      GetImpl( styleManager ).ApplyThemeStyleAtInit( Toolkit::Control( GetOwner() ) );
     }
   }
 
@@ -900,7 +900,7 @@ void Control::OnControlChildRemove( Actor& child )
 void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
 {
   // By default the control is only interested in theme (not font) changes
-  if( change == StyleChange::THEME_CHANGE )
+  if( styleManager && change == StyleChange::THEME_CHANGE )
   {
     GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
   }
index 05a7535..6a07984 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 48;
+const unsigned int TOOLKIT_MICRO_VERSION = 49;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index c47661f..014efd4 100644 (file)
@@ -44,7 +44,13 @@ distributing this software or its derivatives.
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
-      "popup-min-size":[100,65]
+      "option-divider-size":[2,0],
+      "popup-divider-color":[0.23,0.72,0.8,0.11],
+      "popup-icon-color":[1.0,1.0,1.0,1.0],
+      "popup-pressed-color":[0.24,0.72,0.8,0.11],
+      "background-image": {
+        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        }
     },
     "textfield":
     {
diff --git a/dali-toolkit/styles/default-feedback-theme.json b/dali-toolkit/styles/default-feedback-theme.json
new file mode 100644 (file)
index 0000000..25b0c7d
--- /dev/null
@@ -0,0 +1,20 @@
+//******************************************************************************
+//
+// Default feedback theme for dali-toolkit
+//
+//******************************************************************************
+{
+  "style":
+  {
+    "PushButton":
+    {
+      "signals":
+      [
+        {
+          "type": "clicked",
+          "sound-feedback-pattern": "FEEDBACK_PATTERN_TAP"
+        }
+      ]
+    }
+  }
+}
index b4536b8..8eeec51 100644 (file)
@@ -58,6 +58,7 @@ distributing this software or its derivatives.
       "point-size":25
     },
 
+
     "textfield":
     {
       "font-family":"SamsungSans",
@@ -97,7 +98,13 @@ distributing this software or its derivatives.
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
-      "popup-min-size":[100,65]
+      "option-divider-size":[2,0],
+      "popup-divider-color":[0.23,0.72,0.8,0.11],
+      "popup-icon-color":[1.0,1.0,1.0,1.0],
+      "popup-pressed-color":[0.24,0.72,0.8,0.11],
+      "background-image": {
+        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        }
     },
     "scrollview":
     {
diff --git a/docs/content/images/accessibility/accessibility-focus-group.png b/docs/content/images/accessibility/accessibility-focus-group.png
new file mode 100644 (file)
index 0000000..5b175dc
Binary files /dev/null and b/docs/content/images/accessibility/accessibility-focus-group.png differ
diff --git a/docs/content/images/accessibility/accessibility-focus-order.png b/docs/content/images/accessibility/accessibility-focus-order.png
new file mode 100644 (file)
index 0000000..f85e5a5
Binary files /dev/null and b/docs/content/images/accessibility/accessibility-focus-order.png differ
diff --git a/docs/content/images/accessibility/accessibility-focus.png b/docs/content/images/accessibility/accessibility-focus.png
new file mode 100644 (file)
index 0000000..f745218
Binary files /dev/null and b/docs/content/images/accessibility/accessibility-focus.png differ
index c34c256..cf99aeb 100644 (file)
@@ -48,7 +48,7 @@
 ### Control Base Class
  + [Background Feature](@ref background)
  + Keyboard Focus
- + Accessibility
+ + [Accessibility](@ref accessibility)
 
 ### UI Components
  + [Text Label](@ref text-label)
index bde81c2..d984cf1 100644 (file)
@@ -33,7 +33,7 @@ Within the public-api header file; image-actor.h:
 @code
 /**
  * @brief An enumeration of properties belonging to the ImageActor class.
- * Properties additional to RenderableActor.
+ * Properties additional to Actor.
  */
 struct Property
 {
diff --git a/docs/content/shared-javascript-and-cpp-documentation/accessibility.md b/docs/content/shared-javascript-and-cpp-documentation/accessibility.md
new file mode 100644 (file)
index 0000000..78a54aa
--- /dev/null
@@ -0,0 +1,270 @@
+<!--
+/**-->
+
+[TOC]
+
+# Accessibility{#accessibility}
+
+
+## Introduction - What is Accessibility? {#accessibilityintroduction}
+
+Accessibility describes functionality designed to aid usage by the visually impaired.
+  
+This includes:
+- Reading out selections or other on-screen items via text-to-speach.
+- Item selection being controlled with gestures to aid selecting other small hard to select entities.
+  
+
+## Accessibility within DALi {#accessibilitydali}
+
+DALi will pick up the system's current accessibility state (and subsequent changes to it) and enable its internal accessibility mode based on this.
+  
+DALi includes an Accessibility Manager which prodives public API control of the order of object selection by gesture, and text to be read out per actor or control.
+  
+It further provides many signals that represent accessibility gestures. These gestures can range from a simple actor selection through to a more control-specific concept like "page-up", which an application developer may want to provide an implementation for.
+  
+Furthermore, these APIs can be used not only with existing actors and controls, but also when creating a custom control.
+  
+The AccessibilityManager lives within DALi Toolkit. Please see accessibility-manager.h for the full API.
+
+
+## Accessibility Focus {#accessibilityfocus}
+
+<!-- Float image to the right of the text -->
+<div style="float: right">
+    ![ ](../assets/img/accessibility/accessibility-focus.png) ![ ](./accessibility-focus.png)
+</div>
+
+Visibily, when enabled, accessibility will typically show an actor (or actors) as focused. This is represented by default with yellow rectangular frame around the actor. See this section for [modifying the appearance of the accessibility focus](#accessibilityfocusappearance).
+  
+Once in accessibility mode, normal control is disabled and accessibility gestures must be used to access content.
+DALi actors and controls will no longer receive tap gestures or click events when they are touched once (as they normally would).
+  
+Note: The accessibility focus is also refered to as the Focus Indicator.
+
+
+### Moving the focus with gestures {#accessibilitygestures}
+
+Accessibility recognises many gesture types to move the accessibility focus from actor to actor.
+  
+Note:
+  
+- Some of these gestures have pre-defined, automatic behaviour.
+- Some gestures require an specific implementation to be added to use.
+- All can be caught as signals if extra control is needed.
+  
+To test (and understand) this behaviour, you can use the Tizen adaptor which uses the following gestures to perform basic operation:
+  
+Note: The gestures that perform these actions are platform specific. These are the gestures implemented in the Tizen adaptor for example only.
+  
+- Swiping right and left will move the focus forward and backward one item.
+- Doing a left or right swipe-return (where a direction is swiped forwards and backwards quickly) will move to the previous or next page - DALi cannot know what a page is within your application so these gestures can only work if implemented manually.
+  
+
+![ ](../assets/img/accessibility/accessibility-focus-order.png) ![ ](./accessibility-focus-order.png)
+
+### Activation {#accessibilityactivation}
+
+Activation describes an operation performed on a selected actor, typically an on-tap or on-click event.
+  
+Activating an actor in accessibility mode will call a virtual function, as well as signal, for that actor.
+Depending on the platform this can br triggered in different ways.
+When activated, the built in actor types (like PushButton) will do the equivalent of a tap.
+  
+Custom-built actor types will need to implement activation in order to perform a specific behaviour. See the [Custom Controls](#accessibilitycustomcontrol) section.
+  
+Therefore, to tap an actor (EG. Click a button) in accessibility mode, the following must be done:
+  
+- The actor needs to be selected first (using gestures specific to the platform).
+- Then activated, by using the activation gesture.
+  
+## Scrolling {#accessibilityscrolling}
+
+Scrolling around a view outside of accessibility is normally performed by simply holding one finger and dragging (in the appropriate direction).
+Within accessibility this can be overridden and performed with a different gesture type to achieve the same effect.
+  
+Example: For the Tizen platform scrolling is performed with a two-finger drag.
+
+
+## Basic functionality {#accessibilitybasicfunctionality}
+
+### Using the Accessibility Manager functionality {#accessibilityfunctionality}
+
+Accessibility information is stored within the accessibility manager itself rather than within actors.
+This allows the manager to have a global view of focusable actors and their order.
+  
+The Accessibility Manager is a singleton (owned by the singleton service) and can be accessed via its static Get() method:
+  
+~~~{.cpp}
+// Get the accessibility manager singleton.
+accessibilityManager accessibilityManager = AccessibilityManager::Get();
+~~~
+
+
+### Controlling where the focus will move {#accessibilitymovingfocus}
+
+In order to provide automatic focus movement, the accessibility manager must be told the focus order of any actors to be selected.
+This order is a linear order. It can move forwards or backwards only (there is no concept of "up" or "down").
+  
+The order of a particular actor can be set with a call to the accessibility manager like so:
+  
+~~~{.cpp}
+// 6 is an int representing this actor's position in the focus chain.
+accessibilityManager.SetFocusOrder( actor, 6 );
+~~~
+  
+The focus order of each actor in the focus chain is unique. If there is another actor assigned with the same focus order already, the new actor will be inserted to the focus chain with that focus order, and the focus order of the original actor and all the actors followed in the focus chain will be increased accordingly.
+  
+If the focus order assigned to the actor is 0, it means that actor's focus order is undefined (e.g. the actor has a description but with no focus order being set yet) and therefore that actor is not focusable.
+  
+Moving focus to a particular actor directly can be done with SetCurrentFocusActor like so:
+  
+~~~{.cpp}
+// Move focus to the first item on our applications page.
+AccessibilityManager accessibilityManager = AccessibilityManager::Get();
+  
+accessibilityManager.SetCurrentFocusActor( table.GetChildAt( 0 ) );
+~~~
+
+### Modifying the appearance of the accessibility focus {#accessibilityfocusappearance}
+
+The focus graphic itself can be customised.
+It can be an image (EG. A nine-patch border) or any other type of actor.
+  
+It can be set using this method within C++:
+  
+~~~{.cpp}
+accessibilityManager.SetFocusIndicatorActor( myCustomIndicatorActor );
+~~~
+
+
+### Using activation {#accessibilityusingactivation}
+
+If the application would like to perform specific behaviour when an entity is activated, it can catch the activation by connecting to a signal like this:
+  
+~~~{.cpp}
+AccessibilityManager::Get().FocusedActorActivatedSignal().Connect( this, &MyClass::OnFocusedActorActivated );
+~~~
+  
+Controlling the activation behaviour within a custom control is covered in the [custom control section](#accessibilitycustomcontrol)
+
+
+## Focus groups {#accessibilityfocusgroups}
+
+<!-- Float image to the right of the text -->
+<div style="float: right">
+    ![ ](../assets/img/accessibility/accessibility-focus-group.png) ![ ](./accessibility-focus-group.png)
+</div>
+
+Group mode allows the limiting of focusable actors.
+  
+Example: If a popup appears, you may want the focus to be limited to only the OK and Cancel buttons. You can do this by setting the popup as a focus group and turning on group mode, the focus will be limited.
+  
+~~~{.cpp}
+// Create a parent actor and add two children to it.
+Actor groupActor = Actor::New();
+
+Actor child1 = Actor::New();
+groupActor.Add( child1 );
+
+Actor child2 = Actor::New();
+groupActor.Add( child2 );
+
+AccessibilityManager accessibilityManager = AccessibilityManager::Get();
+
+// Mark the parent as a focus group. Now focus movement *can* be limited to the children of this actor.
+// Note: That this is not enabled until specified.
+accessibilityManager.SetFocusGroup( groupActor, true );
+
+// Enable the focus group mode.
+accessibilityManager.SetGroupMode( true );
+~~~
+
+
+### Wrap mode {#accessibilitywrapmode}
+
+Wrap mode allows the focus to wrap back to the beginning once the end is reached.
+  
+In group mode this will move to the beggining of the current focus group.
+  
+~~~{.cpp}
+AccessibilityManager accessibilityManager = AccessibilityManager::Get();
+
+// Enable wrap mode.
+accessibilityManager.SetWrapMode( true );
+~~~
+
+
+## Using Accessibility {#accessibilityusage}
+
+### Using accessibility with existing actors {#accessibilityactors}
+
+This example sets up a 3 by 3 grid of actors with the following accessibility functionality:
+  
+  - They have a focus order that moves from top left to bottom right (when using the accessibility next and previous gestures).
+  - They contain text that will be spoken out loud (via text-to-speach) when the focus changes.
+  
+Note that all the above is set via the AccessibilityManager and not as properties within the actors.
+  
+The text spoken per tile will be the LABEL, TRAIT and HINT (in that order).
+  
+~~~{.cpp}
+Toolkit::TableView table = Toolkit::TableView::New( 3, 3 );
+int tileNumber = 0;
+for( int row = 0; row < 3; ++row )
+{
+  for( int column = 0; column < 3; ++column )
+  {
+    // Create a solid color actor, with some text.
+    Actor tile = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
+    Toolkit::TextLabel text = Toolkit::TextLabel::New( tileNames[tileNumber] );
+    tile.Add( text );
+
+    // Get the accessibility manager singleton.
+    accessibilityManager accessibilityManager = AccessibilityManager::Get();
+
+    // Set the focus order of this actor.
+    accessibilityManager.SetFocusOrder( tile, tileNumber );
+
+    // Set up the accessibility information for this actor (this will be read out with text-to-speach).
+    accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_LABEL, tileNames[tileNumber] );
+    accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_TRAIT, "Tile" );
+    accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_HINT, "You can run this example");
+
+    // Lay out our actor within the table view.
+    table.AddChild( tile, Toolkit::TableView::CellPosition( row, column ) );
+
+    tileNumber++;
+  }
+}
+Stage::GetCurrent().Add( table );
+~~~
+
+### Using accessibility within a custom control (C++) {#accessibilitycustomcontrol}
+
+As well as the Activation signal, if implementing a custom control from C++ you can use the OnAccessibilityActivate() virtual function.
+  
+Other virtual accessibility methods are available for overriding within control also:
+  
+- virtual bool OnAccessibilityPan( PanGesture gesture );
+- virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
+- virtual bool OnAccessibilityValueChange( bool isIncrease ); // (i.e. value change of slider control)
+- virtual bool OnAccessibilityZoom();
+  
+
+### Using accessibility signals for extra control {#accessibilitysignals}
+
+For more specific control of functionality when accessibility is enabled, there are several signals within the accessibility manager's public API that can be connected to.
+  
+The main catagories of signals are:
+  
+- The signal when the accessibility status is detected as being toggled on or off: StatusChangedSignal()
+- Focus changes can cause FocusChangedSignal() and FocusOvershotSignal(). These can be connected to in order to provide custom actions when the focus is moved around the screen.
+- The activated signal when an actor has been activated (typically by a focus, then double tap): ActionActivateSignal()
+- Gesture received signals: There are many of these. They are each linked to the many accessibility gestures that can be received by the system.
+  
+Please see accessibility-manager.h within DALi Toolkit for the full API.
+
+
+@class _Guide_Accessibility
+*/
index 7831c7b..782c05b 100644 (file)
@@ -20,7 +20,7 @@
 // In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
 // Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
 
-Actor::SetDrawMode( DrawMode::OVERLAY ); // C++
+Actor::SetDrawMode( DrawMode::OVERLAY_2D ); // C++
 ~~~
 
 ~~~{.js}
@@ -28,7 +28,7 @@ Actor::SetDrawMode( DrawMode::OVERLAY ); // C++
 // In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
 // Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
 
-actor.drawMode = dali.DRAW_MODE_OVERLAY;
+actor.drawMode = dali.DRAW_MODE_OVERLAY_2D;
 ~~~
   - Use TextureAtlases ( reduces state changes in the GPU)
   - Use compressed textures
diff --git a/node-addon/build/Release/dali.node b/node-addon/build/Release/dali.node
deleted file mode 100755 (executable)
index 3d5c61d..0000000
Binary files a/node-addon/build/Release/dali.node and /dev/null differ
diff --git a/node-addon/build/Release/obj.target/dali.node b/node-addon/build/Release/obj.target/dali.node
deleted file mode 100755 (executable)
index 3d5c61d..0000000
Binary files a/node-addon/build/Release/obj.target/dali.node and /dev/null differ
index 31e140d..c8b3dae 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.48
+Version:    1.0.49
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 4938c01..70def0c 100644 (file)
@@ -543,7 +543,7 @@ INHERIT_SCALE,
  * By default a renderable actor will be drawn as a 3D object. It will be depth-tested against
  * other objects in the world i.e. it may be obscured if other objects are in front.
  *
- * If OVERLAY is used, the actor and its children will be drawn as a 2D overlay.
+ * If OVERLAY_2D is used, the actor and its children will be drawn as a 2D overlay.
  * Overlay actors are drawn in a separate pass, after all non-overlay actors within the Layer.
  * For overlay actors, the drawing order is determined by the hierachy (depth-first search order),
  * and depth-testing will not be used.
@@ -554,9 +554,9 @@ INHERIT_SCALE,
  *
  * @example
  *
- *      var actor.drawMode = dali.DRAW_MODE_NORMAL;  // binary 00. The default draw-mode
- *      var actor.drawMode = dali.DRAW_MODE_OVERLAY; // binary 01. Draw the actor and its children as an overlay
- *      var actor.drawMode = dali.DRAW_MODE_STENCIL ;// binary 11. Draw the actor and its children into the stencil buffer
+ *      var actor.drawMode = dali.DRAW_MODE_NORMAL;     // binary 00. The default draw-mode
+ *      var actor.drawMode = dali.DRAW_MODE_OVERLAY_2D; // binary 01. Draw the actor and its children as an overlay
+ *      var actor.drawMode = dali.DRAW_MODE_STENCIL ;   // binary 11. Draw the actor and its children into the stencil buffer
  *
  *
  * @type Number
index 51c869a..b10e4e6 100644 (file)
@@ -58,7 +58,7 @@ Constants accessible under the dali global object.
 
 |**actor.drawMode  **| |
 |DRAW_MODE_NORMAL                         | integer value |
-|DRAW_MODE_OVERLAY                        | integer value |
+|DRAW_MODE_OVERLAY_2D                     | integer value |
 |DRAW_MODE_STENCIL                        | integer value |
 
 |**Image load policy  **| |
index 7b9b158..b242721 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
+#include <dali-toolkit/public-api/controls/control.h>
 
 // INTERNAL INCLUDES
 #include <actors/layer-api.h>
@@ -256,8 +257,6 @@ const ActorFunctions ActorFunctionTable[]=
     // ignore GetNinePatchBorder use imageActor.border
     { "SetSortModifier",    ImageActorApi::SetSortModifier,   IMAGE_ACTOR_API  },
     { "GetSortModifier",    ImageActorApi::GetSortModifier,   IMAGE_ACTOR_API  },
-    { "SetCullFace",        ImageActorApi::SetCullFace,       IMAGE_ACTOR_API  },
-    { "GetCullFace",        ImageActorApi::GetCullFace,       IMAGE_ACTOR_API  },
     { "SetBlendMode",       ImageActorApi::SetBlendMode,      IMAGE_ACTOR_API  },
     { "GetBlendMode",       ImageActorApi::GetBlendMode,      IMAGE_ACTOR_API  },
     { "SetBlendFunc",       ImageActorApi::SetBlendFunc,      IMAGE_ACTOR_API  },
@@ -318,7 +317,10 @@ ActorWrapper::ActorWrapper( Actor actor,
 v8::Handle<v8::Object> ActorWrapper::WrapActor(v8::Isolate* isolate, Actor actor )
 {
   v8::EscapableHandleScope handleScope( isolate );
-  v8::Local<v8::Object> object = WrapActor( isolate, actor, GetActorType( actor.GetTypeName() ) );
+
+  // Check whether the actor is a Control
+  ActorWrapper::ActorType type = Toolkit::Control::DownCast(actor) ? ACTOR : GetActorType( actor.GetTypeName() );
+  v8::Local<v8::Object> object = WrapActor( isolate, actor, type );
 
   return handleScope.Escape( object );
 }
index 7394fa0..252838e 100644 (file)
@@ -192,59 +192,6 @@ void ImageActorApi::GetSortModifier( const v8::FunctionCallbackInfo<v8::Value>&
 }
 
 /**
- * Set the face-culling mode for this actor.
- * @for ImageActor
- * @method setCullFace
- * @param {Number} cullMode
- * @example
- *      // cull mode should be one of the following constants
- *      dali.CULL_FACE_DISABLE        // Face culling disabled
- *      dali.CULL_FRONT_FACE          // Cull front facing polygons
- *      dali.CULL_BACK_FACE           // Cull back facing polygons
- *      dali.CULL_FRONT_AND_BACK_FACE // Cull front and back facing polygons
- *      actor.SetCullFace( dali.CULL_FRONT_FACE );
- */
-void ImageActorApi::SetCullFace( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageActor imageActor = GetImageActor( isolate, args );
-
-  bool found( false );
-  int cullMode = V8Utils::GetIntegerParameter( PARAMETER_0, found, isolate, args, 0 );
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter" );
-    return;
-  }
-
-  imageActor.SetCullFace(  static_cast<Dali::CullFaceMode>( cullMode ) );
-
-}
-
-/**
- * Retrieve the face-culling mode for this actor.
- * @for ImageActor
- * @method getCullFace
- * @return {Number} cullMode
- * @example
- *      // cull mode is one of the following
- *      dali.CULL_FACE_DISABLE        // Face culling disabled
- *      dali.CULL_FRONT_FACE          // Cull front facing polygons
- *      dali.CULL_BACK_FACE           // Cull back facing polygons
- *      dali.CULL_FRONT_AND_BACK_FACE // Cull front and back facing polygon
- */
-void ImageActorApi::GetCullFace( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageActor imageActor = GetImageActor( isolate, args );
-
-  args.GetReturnValue().Set( v8::Integer::New( isolate, imageActor.GetCullFace() ) );
-
-}
-
-/**
  * Sets the blending mode.
  *
  * If blending is disabled (BLENDING_OFF) fade in and fade out animations do not work.
index 2d00599..f5974e0 100644 (file)
@@ -44,8 +44,6 @@ namespace ImageActorApi
   void GetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
   void SetSortModifier( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetSortModifier( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void SetCullFace( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetCullFace( const v8::FunctionCallbackInfo< v8::Value >& args );
   void SetBlendMode( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetBlendMode( const v8::FunctionCallbackInfo< v8::Value >& args );
   void SetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args );
index c3b2043..1571273 100644 (file)
@@ -154,7 +154,7 @@ const IntegerPair EnumTable[] =
     { "POSITION_INHERITANCE_DONT_INHERIT_POSITION",                      DONT_INHERIT_POSITION                      },
 
     { "DRAW_MODE_NORMAL",                                   DrawMode::NORMAL     },
-    { "DRAW_MODE_OVERLAY",                                  DrawMode::OVERLAY    },
+    { "DRAW_MODE_OVERLAY_2D",                               DrawMode::OVERLAY_2D },
     { "DRAW_MODE_STENCIL",                                  DrawMode::STENCIL    },
 
     { "IMAGE_LOAD_POLICY_IMMEDIATE",                        ResourceImage::IMMEDIATE },
@@ -204,12 +204,6 @@ const IntegerPair EnumTable[] =
     { "BLEND_EQUATION_SUBTRACT",                           BlendingEquation::SUBTRACT         },
     { "BLEND_EQUATION_REVERSE_SUBTRACT",                   BlendingEquation::REVERSE_SUBTRACT },
 
-
-    { "CULL_FACE_DISABLE",                                  CullNone  },
-    { "CULL_FRONT_FACE",                                    CullFront },
-    { "CULL_BACK_FACE",                                     CullBack  },
-    { "CULL_FRONT_AND_BACK_FACE",                           CullFrontAndBack },
-
     { "CAMERA_FREE_LOOK"             ,      Camera::FREE_LOOK                   },
     { "CAMERA_LOOK_AT_TARGET"        ,      Camera::LOOK_AT_TARGET              },
     { "CAMERA_PERSPECTIVE_PROJECTION" ,     Camera::PERSPECTIVE_PROJECTION      },
index c716f75..257b5d4 100644 (file)
@@ -63,9 +63,7 @@ const ApiFunction ConstructorFunctionTable[]=
     { "PathConstrainer",    PathConstrainerWrapper::NewPathConstrainer},
     { "LinearConstrainer",  LinearConstrainerWrapper::NewLinearConstrainer},
     { "Actor",              ActorWrapper::NewActor },
-    { "TextActor",          ActorWrapper::NewActor },
     { "ImageActor",         ActorWrapper::NewActor },
-    { "MeshActor",          ActorWrapper::NewActor },
     { "CameraActor",        ActorWrapper::NewActor },
     { "Layer",              ActorWrapper::NewActor },
     { "Control",            ActorWrapper::NewControl },
index c58d991..0b70084 100644 (file)
@@ -481,7 +481,6 @@ bool IsPrimitive( const Dali::Property::Value &value )
   {
     case Dali::Property::BOOLEAN:
     case Dali::Property::INTEGER:
-    case Dali::Property::UNSIGNED_INTEGER:
     case Dali::Property::STRING:
     case Dali::Property::FLOAT:
     {
@@ -516,11 +515,6 @@ v8::Local<v8::Object> CreateJavaScriptPrimitive( v8::Isolate* isolate, const Dal
        v8Value = v8::Integer::New( isolate, value.Get<int>());
        break;
      }
-     case Dali::Property::UNSIGNED_INTEGER:
-     {
-       v8Value = v8::Integer::New( isolate, value.Get<unsigned int>());
-       break;
-     }
      case Dali::Property::STRING:
      {
        std::string string = value.Get< std::string >();
@@ -683,14 +677,6 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i
       }
       break;
     }
-    case Dali::Property::UNSIGNED_INTEGER:
-    {
-      if( v8Value->IsUint32() )
-      {
-        daliPropertyValue = Dali::Property::Value(  v8Value->Uint32Value() );//static_cast<unsigned int>( V8Utils::GetNumberValue( isolate, v8Value) ));
-      }
-      break;
-    }
     case Dali::Property::STRING:
     {
       if( V8Utils::IsStringPrimitiveOrObject( v8Value) )
index 697b9dd..3466198 100644 (file)
@@ -422,18 +422,12 @@ Property::Value GetPropertyValueFromObject( bool& found, v8::Isolate* isolate, c
     v8::Local<v8::Number> v = value->ToNumber();
     return Dali::Property::Value(static_cast<float>(v->Value()));
   }
-  else if( value->IsInt32() )
+  else if( value->IsInt32() || value->IsUint32() )
   {
     found = true;
     v8::Local<v8::Int32> v = value->ToInt32();
     return Dali::Property::Value(static_cast<int>(v->Value()));
   }
-  else if ( value->IsUint32() )
-  {
-    found = true;
-    v8::Local<v8::Uint32> v = value->ToUint32();
-    return Dali::Property::Value(static_cast<unsigned int>(v->Value()));
-  }
   return daliPropertyValue;
 
 }
@@ -894,11 +888,6 @@ void CreatePropertyMap( v8::Isolate* isolate, const Property::Map& map, v8::Loca
         v8Value = v8::Integer::New( isolate, value.Get<int>());
         break;
       }
-      case Dali::Property::UNSIGNED_INTEGER:
-      {
-        v8Value = v8::Integer::New( isolate, value.Get<unsigned int>());
-        break;
-      }
       case Dali::Property::STRING:
       {
         std::string string = value.Get< std::string >();