LLVM/Emscripten fixes 93/25993/7
authorLee Morgan <Lee.morgan@partner.samsung.com>
Wed, 13 Aug 2014 14:59:48 +0000 (15:59 +0100)
committerLee Morgan <Lee.morgan@partner.samsung.com>
Fri, 12 Sep 2014 15:51:22 +0000 (16:51 +0100)
Change-Id: I7e48e683e9421ce06c2960f04816c97a6047ea8a
Signed-off-by: Lee Morgan <Lee.morgan@partner.samsung.com>
32 files changed:
automated-tests/src/dali-unmanaged/utc-Dali-TypeRegistry.cpp
dali/integration-api/platform-abstraction.h
dali/internal/common/dali-hash.cpp [new file with mode: 0644]
dali/internal/common/dali-hash.h [new file with mode: 0644]
dali/internal/event/common/proxy-object.cpp
dali/internal/event/common/proxy-object.h
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-info-impl.h
dali/internal/event/effects/shader-factory.cpp
dali/internal/event/images/bitmap-packed-pixel.cpp
dali/internal/event/images/image-factory.cpp
dali/internal/event/images/nine-patch-image-impl.h
dali/internal/event/resources/resource-client.h
dali/internal/event/text/atlas/atlas.cpp
dali/internal/event/text/font-factory.cpp
dali/internal/event/text/resource/glyph-resource-manager.cpp
dali/internal/file.list
dali/internal/render/shader-source/flat-color-texture.txt
dali/internal/update/animation/scene-graph-constraint-base.cpp
dali/internal/update/resources/resource-manager.h
dali/public-api/common/dali-common.cpp
dali/public-api/common/dali-common.h
dali/public-api/object/base-handle.cpp
dali/public-api/object/base-handle.h
dali/public-api/object/base-object.cpp
dali/public-api/object/base-object.h
dali/public-api/object/property-value.cpp
dali/public-api/object/property-value.h
dali/public-api/object/type-info.cpp
dali/public-api/object/type-info.h
dali/public-api/signals/base-signal.cpp
dali/public-api/signals/functor-delegate.cpp

index 2533f7e..6e80cc8 100644 (file)
@@ -630,8 +630,19 @@ int UtcDaliTypeRegistryCustomActor(void)
   MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle );
   DALI_TEST_CHECK( customHandle );
 
-  DALI_TEST_EQUALS( type.GetActions().size(), TEST_ACTION_COUNT + baseType.GetActions().size(), TEST_LOCATION );
-  DALI_TEST_EQUALS( type.GetSignals().size(), TEST_SIGNAL_COUNT + baseType.GetSignals().size(), TEST_LOCATION );
+  TypeInfo::NameContainer names;
+  type.GetActions(names);
+  TypeInfo::NameContainer baseNames;
+  baseType.GetActions(baseNames);
+  DALI_TEST_EQUALS( names.size(), TEST_ACTION_COUNT + baseNames.size(), TEST_LOCATION );
+
+  names.clear();
+  type.GetSignals(names);
+
+  baseNames.clear();
+  baseType.GetSignals(baseNames);
+
+  DALI_TEST_EQUALS( names.size(), TEST_SIGNAL_COUNT + baseNames.size(), TEST_LOCATION );
 
   {
     TestConnectionTracker tracker;
@@ -685,8 +696,21 @@ int UtcDaliTypeRegistryCustomSignalFailure(void)
   MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle );
   DALI_TEST_CHECK( customHandle );
 
-  DALI_TEST_EQUALS( type.GetActions().size(), TEST_ACTION_COUNT + baseType.GetActions().size(), TEST_LOCATION );
-  DALI_TEST_EQUALS( type.GetSignals().size(), TEST_SIGNAL_COUNT + baseType.GetSignals().size(), TEST_LOCATION );
+  TypeInfo::NameContainer names;
+  TypeInfo::NameContainer baseNames;
+
+  type.GetActions(names);
+  baseType.GetActions(baseNames);
+
+  DALI_TEST_EQUALS( names.size(), TEST_ACTION_COUNT + baseNames.size(), TEST_LOCATION );
+
+  names.clear();
+  baseNames.clear();
+
+  type.GetSignals(names);
+  baseType.GetSignals(baseNames);
+
+  DALI_TEST_EQUALS( names.size(), TEST_SIGNAL_COUNT + baseNames.size(), TEST_LOCATION );
 
   {
     TestConnectionTracker tracker;
index 4fb4352..bc34896 100644 (file)
@@ -41,6 +41,8 @@ class DALI_IMPORT_API PlatformAbstraction
 {
 public:
 
+  virtual ~PlatformAbstraction() {}
+
   // Dali Lifecycle
 
   /**
diff --git a/dali/internal/common/dali-hash.cpp b/dali/internal/common/dali-hash.cpp
new file mode 100644 (file)
index 0000000..e77839d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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/internal/common/dali-hash.h>
+
+
+namespace Dali
+{
+
+/*
+ * djb2 (http://www.cse.yorku.ca/~oz/hash.html)
+ */
+unsigned long StringHash::operator()(const std::string& toHash)
+{
+  unsigned long hash = 5381;
+
+  const char *str = toHash.c_str();
+
+  while( int c = *str++ )
+  {
+    hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
+  }
+
+  return hash;
+}
+
+} // namespace Dali
diff --git a/dali/internal/common/dali-hash.h b/dali/internal/common/dali-hash.h
new file mode 100644 (file)
index 0000000..487efd3
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __DALI_HASH__
+#define __DALI_HASH__
+
+/*
+ * 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.
+ *
+ */
+#include <string>
+
+namespace Dali
+{
+
+struct StringHash
+{
+  unsigned long operator()(const std::string& toHash);
+};
+
+} // namespace Dali
+
+#endif // header
index 54c740c..98910f5 100644 (file)
@@ -130,7 +130,7 @@ unsigned int ProxyObject::GetPropertyCount() const
 
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Default Properties: %d\n", count );
 
-  TypeInfo* typeInfo( GetTypeInfo() );
+  const TypeInfo* typeInfo( GetTypeInfo() );
   if ( typeInfo )
   {
     unsigned int manual( typeInfo->GetPropertyCount() );
@@ -163,7 +163,7 @@ const std::string& ProxyObject::GetPropertyName( Property::Index index ) const
 
   if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
-    TypeInfo* typeInfo( GetTypeInfo() );
+    const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       return typeInfo->GetPropertyName( index );
@@ -190,7 +190,7 @@ Property::Index ProxyObject::GetPropertyIndex(const std::string& name) const
 
   if ( index == Property::INVALID_INDEX )
   {
-    TypeInfo* typeInfo( GetTypeInfo() );
+    const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       index = typeInfo->GetPropertyIndex( name );
@@ -224,7 +224,7 @@ bool ProxyObject::IsPropertyWritable( Property::Index index ) const
 
   if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
-    TypeInfo* typeInfo( GetTypeInfo() );
+    const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       return typeInfo->IsPropertyWritable( index );
@@ -310,7 +310,7 @@ Property::Type ProxyObject::GetPropertyType( Property::Index index ) const
 
   if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
-    TypeInfo* typeInfo( GetTypeInfo() );
+    const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       return typeInfo->GetPropertyType( index );
@@ -343,7 +343,7 @@ void ProxyObject::SetProperty( Property::Index index, const Property::Value& pro
   }
   else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
-    TypeInfo* typeInfo( GetTypeInfo() );
+    const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       typeInfo->SetProperty( this, index, propertyValue );
@@ -381,7 +381,7 @@ Property::Value ProxyObject::GetProperty(Property::Index index) const
   }
   else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
-    TypeInfo* typeInfo( GetTypeInfo() );
+    const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       value = typeInfo->GetProperty( this, index );
@@ -508,7 +508,7 @@ void ProxyObject::GetPropertyIndices( Property::IndexContainer& indices ) const
   GetDefaultPropertyIndices( indices );
 
   // Manual Properties
-  TypeInfo* typeInfo( GetTypeInfo() );
+  const TypeInfo* typeInfo( GetTypeInfo() );
   if ( typeInfo )
   {
     typeInfo->GetPropertyIndices( indices );
@@ -914,7 +914,7 @@ CustomPropertyLookup& ProxyObject::GetCustomPropertyLookup() const
   return *mCustomProperties;
 }
 
-TypeInfo* ProxyObject::GetTypeInfo() const
+const TypeInfo* ProxyObject::GetTypeInfo() const
 {
   if ( !mTypeInfo )
   {
@@ -1035,7 +1035,7 @@ void ProxyObject::RemoveConstraints()
   }
 }
 
-void ProxyObject::SetTypeInfo( TypeInfo* typeInfo )
+void ProxyObject::SetTypeInfo( const TypeInfo* typeInfo )
 {
   mTypeInfo = typeInfo;
 }
index 62eecf3..14fb561 100644 (file)
@@ -288,7 +288,7 @@ public: // Called by TypeInfo
    * Called by TypeInfo to set the type-info that this proxy-object is created by.
    * @param[in] typeInfo The TypeInfo that creates this proxy-object.
    */
-  void SetTypeInfo( TypeInfo* typeInfo );
+  void SetTypeInfo( const TypeInfo* typeInfo );
 
 protected:
 
@@ -437,14 +437,14 @@ protected:
    * to it locally there-after. The type info will not change during the life-time of the application.
    * @return The type-info for this object (Can be NULL)
    */
-  TypeInfo* GetTypeInfo() const;
+  const TypeInfo* GetTypeInfo() const;
 
 private:
 
   Property::Index mNextCustomPropertyIndex; ///< The ID of the next custom property to be registered
 
   mutable CustomPropertyLookup* mCustomProperties; ///< Used for accessing custom Node properties, mutable so it can be lazy initialized from const function
-  mutable TypeInfo* mTypeInfo; ///< The type-info for this object, mutable so it can be lazy initialized from const method if it is required
+  mutable TypeInfo const *  mTypeInfo; ///< The type-info for this object, mutable so it can be lazy initialized from const method if it is required
 
   Dali::Vector<Observer*> mObservers;
 
index b23440e..d10e9cb 100644 (file)
@@ -93,7 +93,7 @@ TypeInfo::~TypeInfo()
 {
 }
 
-BaseHandle TypeInfo::CreateInstance()
+BaseHandle TypeInfo::CreateInstance() const
 {
   BaseHandle ret;
 
@@ -162,26 +162,24 @@ bool TypeInfo::ConnectSignal( BaseObject* object, ConnectionTrackerInterface* co
   return connected;
 }
 
-const std::string& TypeInfo::GetName()
+const std::string& TypeInfo::GetName() const
 {
   return mTypeName;
 }
 
-const std::string& TypeInfo::GetBaseName()
+const std::string& TypeInfo::GetBaseName() const
 {
   return mBaseTypeName;
 }
 
-Dali::TypeInfo::CreateFunction TypeInfo::GetCreator()
+Dali::TypeInfo::CreateFunction TypeInfo::GetCreator() const
 {
   return mCreate;
 }
 
-Dali::TypeInfo::NameContainer TypeInfo::GetActions()
+void TypeInfo::GetActions( Dali::TypeInfo::NameContainer& ret ) const
 {
-  Dali::TypeInfo::NameContainer ret;
-
-  for(ActionContainer::iterator iter = mActions.begin(); iter != mActions.end(); ++iter)
+  for(ActionContainer::const_iterator iter = mActions.begin(); iter != mActions.end(); ++iter)
   {
     ret.push_back(iter->first);
   }
@@ -189,7 +187,7 @@ Dali::TypeInfo::NameContainer TypeInfo::GetActions()
   Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
   while( base )
   {
-    for(ActionContainer::iterator iter = GetImplementation(base).mActions.begin();
+    for(ActionContainer::const_iterator iter = GetImplementation(base).mActions.begin();
         iter != GetImplementation(base).mActions.end(); ++iter)
     {
       ret.push_back(iter->first);
@@ -197,15 +195,11 @@ Dali::TypeInfo::NameContainer TypeInfo::GetActions()
 
     base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
   }
-
-  return ret;
 }
 
-Dali::TypeInfo::NameContainer TypeInfo::GetSignals()
+void TypeInfo::GetSignals(Dali::TypeInfo::NameContainer& ret) const
 {
-  Dali::TypeInfo::NameContainer ret;
-
-  for(ConnectorContainerV2::iterator iter = mSignalConnectors.begin(); iter != mSignalConnectors.end(); ++iter)
+  for(ConnectorContainerV2::const_iterator iter = mSignalConnectors.begin(); iter != mSignalConnectors.end(); ++iter)
   {
     ret.push_back(iter->first);
   }
@@ -213,7 +207,7 @@ Dali::TypeInfo::NameContainer TypeInfo::GetSignals()
   Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
   while( base )
   {
-    for(ConnectorContainerV2::iterator iter = GetImplementation(base).mSignalConnectors.begin();
+    for(ConnectorContainerV2::const_iterator iter = GetImplementation(base).mSignalConnectors.begin();
         iter != GetImplementation(base).mSignalConnectors.end(); ++iter)
     {
       ret.push_back(iter->first);
@@ -221,8 +215,29 @@ Dali::TypeInfo::NameContainer TypeInfo::GetSignals()
 
     base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
   }
+}
 
-  return ret;
+void TypeInfo::GetProperties( Dali::TypeInfo::NameContainer& ret ) const
+{
+  Property::IndexContainer indices;
+
+  GetPropertyIndices(indices);
+
+  ret.reserve(indices.size());
+
+  typedef std::vector< Property::Index > IndexContainer; ///< A vector of property indices
+  for(Property::IndexContainer::iterator iter = indices.begin(); iter != indices.end(); ++iter)
+  {
+    const std::string& name = GetPropertyName( *iter );
+    if(name.size())
+    {
+      ret.push_back( name );
+    }
+    else
+    {
+      DALI_LOG_WARNING("Property had no name\n");
+    }
+  }
 }
 
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
@@ -430,10 +445,10 @@ Property::Type TypeInfo::GetPropertyType( Property::Index index ) const
   return type;
 }
 
-void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Property::Value& value )
+void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Property::Value& value ) const
 {
-  RegisteredPropertyContainer::iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
-                                                    PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+  RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                              PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
   if ( iter != mRegisteredProperties.end() )
   {
     DALI_ASSERT_ALWAYS( iter->second.setFunc && "Trying to write to a read-only property" );
@@ -453,10 +468,10 @@ void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Pro
   }
 }
 
-void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const Property::Value& value )
+void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const Property::Value& value ) const
 {
-  RegisteredPropertyContainer::iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
-                                                    PropertyNameFinder< RegisteredPropertyPair >( name ) );
+  RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                              PropertyNameFinder< RegisteredPropertyPair >( name ) );
   if ( iter != mRegisteredProperties.end() )
   {
     DALI_ASSERT_ALWAYS( iter->second.setFunc && "Trying to write to a read-only property" );
@@ -476,7 +491,7 @@ void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const P
   }
 }
 
-Property::Value TypeInfo::GetProperty( const BaseObject *object, Property::Index index )
+Property::Value TypeInfo::GetProperty( const BaseObject *object, Property::Index index ) const
 {
   RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                           PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
@@ -497,7 +512,7 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, Property::Index
   return Property::Value();
 }
 
-Property::Value TypeInfo::GetProperty( const BaseObject *object, const std::string& name )
+Property::Value TypeInfo::GetProperty( const BaseObject *object, const std::string& name ) const
 {
   RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                           PropertyNameFinder< RegisteredPropertyPair >( name ) );
index bd81be5..df42aa0 100644 (file)
@@ -58,32 +58,37 @@ public:
   /**
    * @copydoc Dali::TypeInfo::GetName
    */
-  const std::string& GetName();
+  const std::string& GetName() const;
 
   /**
    * @copydoc Dali::TypeInfo::GetBaseName
    */
-  const std::string& GetBaseName();
+  const std::string& GetBaseName() const;
 
   /**
    * @copydoc TypeInfo::CreateFunction
    */
-  BaseHandle CreateInstance();
+  BaseHandle CreateInstance() const;
 
   /**
    * @copydoc Dali::TypeInfo::GetCreator
    */
-  Dali::TypeInfo::CreateFunction GetCreator();
+  Dali::TypeInfo::CreateFunction GetCreator() const;
 
   /**
    * @copydoc Dali::TypeInfo::GetActions
    */
-  Dali::TypeInfo::NameContainer GetActions();
+  void GetActions( Dali::TypeInfo::NameContainer& container ) const;
 
   /**
    * @copydoc Dali::TypeInfo::GetSignals
    */
-  Dali::TypeInfo::NameContainer GetSignals();
+  void GetSignals( Dali::TypeInfo::NameContainer& container) const;
+
+  /**
+   * @copydoc Dali::TypeInfo::GetProperties
+   */
+  void GetProperties( Dali::TypeInfo::NameContainer& container) const;
 
   /**
    * Adds the property indices to the container specified.
@@ -171,7 +176,7 @@ public:
    * @param[in] index The property index.
    * @param[in] value The value to set.
    */
-  void SetProperty( BaseObject *object, Property::Index index, const Property::Value& value );
+  void SetProperty( BaseObject *object, Property::Index index, const Property::Value& value ) const;
 
   /**
    * Sets the value of a property with the name specified for the given object.
@@ -179,7 +184,7 @@ public:
    * @param[in] name The property name.
    * @param[in] value The value to set.
    */
-  void SetProperty( BaseObject *object, const std::string& name, const Property::Value& value );
+  void SetProperty( BaseObject *object, const std::string& name, const Property::Value& value ) const;
 
   /**
    * Retrieves the value of a property at the index specified for the given object.
@@ -187,7 +192,7 @@ public:
    * @param[in] index The property index.
    * @return The current value of the property.
    */
-  Property::Value GetProperty( const BaseObject *object, Property::Index index );
+  Property::Value GetProperty( const BaseObject *object, Property::Index index ) const;
 
   /**
    * Retrieves the value of a property with the name specified for the given object.
@@ -195,7 +200,7 @@ public:
    * @param[in] name The property name.
    * @return The current value of the property.
    */
-  Property::Value GetProperty( const BaseObject *object, const std::string& name );
+  Property::Value GetProperty( const BaseObject *object, const std::string& name ) const;
 
 private:
 
index def38a0..6c488d3 100644 (file)
@@ -21,9 +21,9 @@
 // EXTERNAL INCLUDES
 #include <algorithm>
 #include <sstream>
-#include <boost/functional/hash.hpp>
 
 // INTERNAL INCLUDES
+#include <dali/internal/common/dali-hash.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/resources/resource-client.h>
@@ -220,7 +220,8 @@ size_t ShaderFactory::HashShaderSource(const std::string& vertexSource, const st
   source.erase(std::remove(source.begin(), source.end(), '\n'), source.end());
   source.erase(std::remove(source.begin(), source.end(), '\t'), source.end());
 
-  return boost::hash_value( source );
+  StringHash hasher;
+  return hasher( source );
 }
 
 } // namespace Internal
index 944ef61..1ba1aa0 100644 (file)
@@ -60,12 +60,12 @@ Dali::Integration::PixelBuffer* BitmapPackedPixel::ReserveBuffer(Pixel::Format p
 }
 
 void BitmapPackedPixel::AssignBuffer(Pixel::Format pixelFormat,
-                          Dali::Integration::PixelBuffer* buffer,
-                          std::size_t bufferSize,
-                          unsigned int width,
-                          unsigned int height,
-                          unsigned int bufferWidth,
-                          unsigned int bufferHeight)
+                                     Dali::Integration::PixelBuffer* buffer,
+                                     std::size_t bufferSize,
+                                     unsigned int width,
+                                     unsigned int height,
+                                     unsigned int bufferWidth,
+                                     unsigned int bufferHeight)
 {
   DALI_ASSERT_DEBUG( buffer );
 
index 424ebad..2bb660f 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/internal/common/event-to-update.h>
 #include <dali/internal/event/resources/resource-client.h>
 #include <dali/internal/update/resources/resource-manager.h>
+#include <dali/internal/common/dali-hash.h>
 
 // EXTERNAL INCLUDES
 #include <float.h>
index ef12156..ad8d41c 100644 (file)
@@ -134,7 +134,6 @@ private:
 private:
   ResourceClient*               mResourceClient;
   Integration::BitmapPtr        mBitmap;
-  SceneGraph::UpdateManager*    mUpdateManager;
   Vector4                       mStretchBorders;
   Rect<int>                     mChildRectangle;
   bool                          mParsedBorder;
index effc364..1b0180e 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <string>
-#include <boost/functional/hash.hpp>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/ref-counted-dali-vector.h>
@@ -36,7 +35,6 @@
 namespace Dali
 {
 
-typedef boost::hash<const std::string> StringHash;
 class NativeImage;
 
 namespace Integration
index 0994ca1..03f3574 100644 (file)
@@ -261,7 +261,7 @@ void Atlas::FillAtlasItem( unsigned int blockNum, AtlasItem& atlasItem, UvMode m
   unsigned int block1dPos = blockNum * mBlockSize;
 
   unsigned int blockX = block1dPos  % mSize;
-  unsigned int blockY = mBlockSize * floor( block1dPos / mSize ) ;
+  unsigned int blockY = mBlockSize * floor( block1dPos / mSize );
 
   atlasItem.xPos = blockX;
   atlasItem.yPos = blockY;
@@ -300,7 +300,7 @@ void Atlas::GetPositionOfBlock( unsigned int block1dPos, unsigned int& row, unsi
   {
     column =  block1dPos % GetBlocksPerRow();
   }
-  row =  floor( block1dPos / GetBlocksPerRow() ) ;
+  row =  floor( block1dPos / GetBlocksPerRow() );
 
   unsigned int bytePos, bitPos;
 
index e145b38..9b8ff20 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/resources/resource-client.h>
 #include <dali/internal/event/text/atlas/glyph-atlas-manager.h>
+#include <dali/internal/common/dali-hash.h>
 
 // EXTERNAL INCLUDES
 #include <boost/functional/hash.hpp>
index d85f885..0d4513e 100644 (file)
@@ -106,12 +106,12 @@ void GlyphResourceManager::AddRequests( const GlyphRequestList& requestList,
 {
   // each entry in the request list is for a specific font,
   // style, quality and a list of characters
-
   for( std::size_t n = 0, size = requestList.size(); n < size ; ++n )
   {
     const GlyphResourceRequest& request( requestList[n] );
     SendRequests( request, observer, atlasTextureId );
   }
+
 }
 
 void GlyphResourceManager::GlyphsLoaded( Integration::ResourceId id, const Integration::GlyphSet& glyphSet, LoadStatus loadStatus )
index b60b9eb..28acf87 100644 (file)
@@ -7,6 +7,7 @@ internal_src_files = \
   $(internal_src_dir)/common/message-buffer.cpp \
   $(internal_src_dir)/common/text-parameters.cpp \
   $(internal_src_dir)/common/image-sampler.cpp \
+  $(internal_src_dir)/common/dali-hash.cpp \
   \
   $(internal_src_dir)/event/actor-attachments/actor-attachment-impl.cpp \
   $(internal_src_dir)/event/actor-attachments/camera-attachment-impl.cpp \
index 9c636fc..a3f7716 100644 (file)
@@ -28,4 +28,4 @@
       gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;
     }
 
-</FragmentShader>
\ No newline at end of file
+</FragmentShader>
index 5c0f481..9e80267 100644 (file)
@@ -47,7 +47,7 @@ ConstraintBase::~ConstraintBase()
   }
 
 // TODO - Override new & delete to provide this for everything
-#ifdef DEBUG_ENABLED
+#if defined(DEBUG_ENABLED) && !defined(EMSCRIPTEN)
   // Fill with garbage pattern to help detect invalid memory access
   memset ( &mWeight, 0xFA, sizeof(mWeight) );
 #endif
index 401519b..ac537a5 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <string>
-#include <boost/functional/hash.hpp>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
@@ -48,8 +47,6 @@
 namespace Dali
 {
 
-typedef boost::hash<const std::string> StringHash;
-
 class NativeImage;
 
 namespace Integration
index 9f458b7..88109f2 100644 (file)
@@ -22,9 +22,9 @@
 #include <stdlib.h>
 #include <string>
 #include <cstdio>
-#include <execinfo.h>
 
 #ifndef EMSCRIPTEN // cxxabi not supported
+# include <execinfo.h>
 # include <cxxabi.h>
 #endif
 
index e866ef2..5e756a4 100644 (file)
@@ -22,7 +22,9 @@
 #include <string>
 #include <cstdio>
 
-
+#ifdef EMSCRIPTEN
+#include <emscripten/emscripten.h>
+#endif
 /*
  * Definitions for shared library support
  *
@@ -67,7 +69,7 @@
 
 // clang cpp11 check is per feature
 #if !__has_feature(cxx_constexpr)
-# error constexpr needed for compile-time-math. Use --std=c11
+# error constexpr needed for compile-time-math. Use -std=c+11
 #endif
 
 #define _CPP11
@@ -131,13 +133,27 @@ public:
  * (which it is often equivalent to in effect).
  * It should not be used for simple parameter validation for instance.
  */
-#define DALI_ASSERT_ALWAYS(cond) \
+#ifdef EMSCRIPTEN
+
+#define DALI_ASSERT_ALWAYS(cond)                \
   if(!(cond)) \
   { \
     Dali::DaliAssertMessage(#cond, __FILE__, __LINE__);   \
     throw Dali::DaliException(__PRETTY_FUNCTION__, #cond);  \
+    EM_ASM(print(new Error().stack)); \
   }\
 
+#else
+
+#define DALI_ASSERT_ALWAYS(cond)                \
+  if(!(cond)) \
+  { \
+    Dali::DaliAssertMessage(#cond, __FILE__, __LINE__);   \
+    throw Dali::DaliException(__PRETTY_FUNCTION__, #cond);  \
+  }\
+
+#endif
+
 /**
  * @brief An invariant concurrent assertion to ensure its argument evaluates TRUE in debug builds.
  *
index d8713a1..2b0fa4f 100644 (file)
@@ -74,6 +74,11 @@ const std::string& BaseHandle::GetTypeName() const
   return GetImplementation(*this).GetTypeName();
 }
 
+bool BaseHandle::GetTypeInfo(Dali::TypeInfo& typeInfo) const
+{
+  return GetImplementation(*this).GetTypeInfo(typeInfo);
+}
+
 BaseObject& BaseHandle::GetBaseObject()
 {
   DALI_ASSERT_ALWAYS( mObjectHandle.Get() && "BaseHandle is empty" );
index cdf7b42..e4e226c 100644 (file)
@@ -33,6 +33,7 @@ namespace Dali DALI_IMPORT_API
 
 class BaseObject;
 class ConnectionTrackerInterface;
+class TypeInfo;
 
 /**
  * @brief Dali::BaseHandle is a handle to an internal Dali resource.
@@ -151,6 +152,13 @@ public:
    */
   const std::string& GetTypeName() const;
 
+  /**
+   * @brief Returns the type info for the Handle.
+   *
+   * @return The type info.
+   */
+  bool GetTypeInfo(Dali::TypeInfo& info) const;
+
 public:
 
   // BaseHandle accessors
index 3baa7fe..4535bbe 100644 (file)
@@ -85,6 +85,22 @@ const std::string& BaseObject::GetTypeName() const
   return String::EMPTY;
 }
 
+bool BaseObject::GetTypeInfo(Dali::TypeInfo& typeInfo) const
+{
+  Dali::Internal::TypeRegistry* registry = Dali::Internal::TypeRegistry::Get();
+
+  Dali::TypeInfo info = registry->GetTypeInfo(this);
+  if(info)
+  {
+    typeInfo = info;
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
 bool BaseObject::DoConnectSignal( ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor )
 {
   Dali::Internal::TypeRegistry* registry = Dali::Internal::TypeRegistry::Get();
index c6081a0..ac0d786 100644 (file)
@@ -61,6 +61,11 @@ public:
    */
   const std::string& GetTypeName() const;
 
+  /**
+   * @copydoc Dali::BaseHandle::GetTypeInfo
+   */
+  bool GetTypeInfo(Dali::TypeInfo& info) const;
+
 public: // Not intended for application developers
 
   /**
index 8093309..d03b012 100644 (file)
@@ -882,6 +882,23 @@ Property::Value& Property::Value::GetItem(const int index) const
   return null;
 }
 
+Property::Value& Property::Value::GetItem(const int index, std::string& key) const
+{
+  Property::Value& ret( GetItem(index) );
+
+  if( Property::MAP == GetType() )
+  {
+    Property::Map *container = AnyCast<Property::Map>(&(mImpl->mValue));
+    if( index < static_cast<int>(container->size()) )
+    {
+
+      key = (*container)[ index ].first;
+    }
+  }
+
+  return ret;
+}
+
 void Property::Value::SetItem(const int index, const Property::Value &value)
 {
   switch( GetType() )
index 57efa22..368b5af 100644 (file)
@@ -339,7 +339,7 @@ public:
    *
    * @pre GetType() returns Property::MAP.
    * @param [in] key A string.
-   * @return Property value if avaiable at key or Invalid
+   * @return Property value if available at key or Invalid
    */
   Property::Value& GetValue(const std::string& key) const;
 
@@ -366,7 +366,7 @@ public:
    * @pre GetType() returns Property::MAP.
    * @param [in] key A string key.
    * @param [in] value The value to set.
-   * @return Property value if avaiable at key
+   * @return Property value if available at key
    */
   void SetValue(const std::string& key, const Property::Value &value);
 
@@ -375,11 +375,21 @@ public:
    *
    * @pre GetType() returns Property::ARRAY or Property::MAP.
    * @param [in] index The item index.
-   * @return Property value if avaiable at key or Invalid
+   * @return Property value if available at index or Invalid
    */
   Property::Value& GetItem(const int index) const;
 
   /**
+   * @brief Retrieve a property value from the internal array or map.
+   *
+   * @pre GetType() returns Property::ARRAY or Property::MAP.
+   * @param [in] index The item index.
+   * @param [out] key The key of the index (Applicable only for Property::MAP).
+   * @return Property value if available at index or Invalid
+   */
+  Property::Value& GetItem(const int index, std::string& key) const;
+
+  /**
    * @brief Set a property value in the array or map.
    *
    * @pre GetType() returns Property::ARRAY or Property::MAP.
index 2188fbd..e15c2d9 100644 (file)
@@ -52,34 +52,39 @@ TypeInfo& TypeInfo::operator=(BaseHandle::NullType* rhs)
   return *this;
 }
 
-const std::string& TypeInfo::GetName()
+const std::string& TypeInfo::GetName() const
 {
   return GetImplementation(*this).GetName();
 }
 
-const std::string& TypeInfo::GetBaseName()
+const std::string& TypeInfo::GetBaseName() const
 {
   return GetImplementation(*this).GetBaseName();
 }
 
-BaseHandle TypeInfo::CreateInstance()
+BaseHandle TypeInfo::CreateInstance() const
 {
   return GetImplementation(*this).CreateInstance();
 }
 
-TypeInfo::CreateFunction TypeInfo::GetCreator()
+TypeInfo::CreateFunction TypeInfo::GetCreator() const
 {
   return GetImplementation(*this).GetCreator();
 }
 
-TypeInfo::NameContainer TypeInfo::GetActions()
+void TypeInfo::GetActions( TypeInfo::NameContainer& container ) const
 {
-  return GetImplementation(*this).GetActions();
+  GetImplementation(*this).GetActions( container );
 }
 
-TypeInfo::NameContainer TypeInfo::GetSignals()
+void TypeInfo::GetSignals( TypeInfo::NameContainer& container ) const
 {
-  return GetImplementation(*this).GetSignals();
+  GetImplementation(*this).GetSignals( container );
+}
+
+void TypeInfo::GetProperties( TypeInfo::NameContainer& container ) const
+{
+  GetImplementation(*this).GetProperties( container );
 }
 
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
index 6f1fa92..1c28438 100644 (file)
@@ -122,42 +122,49 @@ public:
    *
    * @return string name
    */
-  const std::string& GetName();
+  const std::string& GetName() const;
 
   /**
    * @brief Retrieve the base type name for this type.
    *
    * @return string of base name
    */
-  const std::string& GetBaseName();
+  const std::string& GetBaseName() const;
 
   /**
    * @brief Create an object from this type.
    *
    * @return the BaseHandle for the newly created object
    */
-  BaseHandle CreateInstance();
+  BaseHandle CreateInstance() const;
 
   /**
    * @brief Retrieve the creator function for this type.
    *
    * @return the creator function
    */
-  CreateFunction GetCreator();
+  CreateFunction GetCreator() const;
 
   /**
    * @brief Retrieve the actions for this type.
    *
-   * @return Container of action names
+   * @param[in] container of action names
    */
-  NameContainer GetActions();
+  void GetActions( NameContainer &container ) const;
 
   /**
    * @brief Retrieve the signals for this type.
    *
-   * @return Container of signal names
+   * @param[in] container of action names
    */
-  NameContainer GetSignals();
+  void GetSignals( NameContainer &container ) const;
+
+  /**
+   * @brief Retrieve the event side registered properties for this type.
+   *
+   * @param[in] container of action names
+   */
+  void GetProperties( NameContainer &container ) const;
 
   // Properties
 
index 71ff408..64fa3e0 100644 (file)
@@ -29,12 +29,6 @@ namespace
 
 const int INVALID_CALLBACK_INDEX = -1;
 
-// Predicate for std::remove_if algorithm
-bool IsNullPredicate(void* ptr)
-{
-  return ptr == NULL;
-}
-
 } // unnamed namespace
 
 namespace Dali
index 87b44b0..4b48cc2 100644 (file)
@@ -29,8 +29,10 @@ namespace
  * functions and regular functions.
  * If this assert fails, please implement the template specialisation for C functions.
  */
+#if !defined(EMSCRIPTEN)
 void Function() { }
 DALI_COMPILE_TIME_ASSERT( sizeof(void*) == sizeof(&Function) );
+#endif
 }
 
 FunctorDelegate::~FunctorDelegate()