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;
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;
{
public:
+ virtual ~PlatformAbstraction() {}
+
// Dali Lifecycle
/**
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
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() );
if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
{
- TypeInfo* typeInfo( GetTypeInfo() );
+ const TypeInfo* typeInfo( GetTypeInfo() );
if ( typeInfo )
{
return typeInfo->GetPropertyName( index );
if ( index == Property::INVALID_INDEX )
{
- TypeInfo* typeInfo( GetTypeInfo() );
+ const TypeInfo* typeInfo( GetTypeInfo() );
if ( typeInfo )
{
index = typeInfo->GetPropertyIndex( name );
if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
{
- TypeInfo* typeInfo( GetTypeInfo() );
+ const TypeInfo* typeInfo( GetTypeInfo() );
if ( typeInfo )
{
return typeInfo->IsPropertyWritable( index );
if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
{
- TypeInfo* typeInfo( GetTypeInfo() );
+ const TypeInfo* typeInfo( GetTypeInfo() );
if ( typeInfo )
{
return typeInfo->GetPropertyType( index );
}
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 );
}
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 );
GetDefaultPropertyIndices( indices );
// Manual Properties
- TypeInfo* typeInfo( GetTypeInfo() );
+ const TypeInfo* typeInfo( GetTypeInfo() );
if ( typeInfo )
{
typeInfo->GetPropertyIndices( indices );
return *mCustomProperties;
}
-TypeInfo* ProxyObject::GetTypeInfo() const
+const TypeInfo* ProxyObject::GetTypeInfo() const
{
if ( !mTypeInfo )
{
}
}
-void ProxyObject::SetTypeInfo( TypeInfo* typeInfo )
+void ProxyObject::SetTypeInfo( const TypeInfo* typeInfo )
{
mTypeInfo = 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:
* 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;
{
}
-BaseHandle TypeInfo::CreateInstance()
+BaseHandle TypeInfo::CreateInstance() const
{
BaseHandle ret;
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);
}
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);
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);
}
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);
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
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" );
}
}
-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" );
}
}
-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 ) );
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 ) );
/**
* @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.
* @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.
* @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.
* @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.
* @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:
// 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>
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
}
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 );
#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>
private:
ResourceClient* mResourceClient;
Integration::BitmapPtr mBitmap;
- SceneGraph::UpdateManager* mUpdateManager;
Vector4 mStretchBorders;
Rect<int> mChildRectangle;
bool mParsedBorder;
// EXTERNAL INCLUDES
#include <string>
-#include <boost/functional/hash.hpp>
// INTERNAL INCLUDES
#include <dali/public-api/common/ref-counted-dali-vector.h>
namespace Dali
{
-typedef boost::hash<const std::string> StringHash;
class NativeImage;
namespace Integration
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;
{
column = block1dPos % GetBlocksPerRow();
}
- row = floor( block1dPos / GetBlocksPerRow() ) ;
+ row = floor( block1dPos / GetBlocksPerRow() );
unsigned int bytePos, bitPos;
#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>
{
// 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 )
$(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 \
gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;
}
-</FragmentShader>
\ No newline at end of file
+</FragmentShader>
}
// 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
// EXTERNAL INCLUDES
#include <string>
-#include <boost/functional/hash.hpp>
// INTERNAL INCLUDES
#include <dali/public-api/images/image.h>
namespace Dali
{
-typedef boost::hash<const std::string> StringHash;
-
class NativeImage;
namespace Integration
#include <stdlib.h>
#include <string>
#include <cstdio>
-#include <execinfo.h>
#ifndef EMSCRIPTEN // cxxabi not supported
+# include <execinfo.h>
# include <cxxabi.h>
#endif
#include <string>
#include <cstdio>
-
+#ifdef EMSCRIPTEN
+#include <emscripten/emscripten.h>
+#endif
/*
* Definitions for shared library support
*
// 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
* (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.
*
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" );
class BaseObject;
class ConnectionTrackerInterface;
+class TypeInfo;
/**
* @brief Dali::BaseHandle is a handle to an internal Dali resource.
*/
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
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();
*/
const std::string& GetTypeName() const;
+ /**
+ * @copydoc Dali::BaseHandle::GetTypeInfo
+ */
+ bool GetTypeInfo(Dali::TypeInfo& info) const;
+
public: // Not intended for application developers
/**
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() )
*
* @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;
* @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);
*
* @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.
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
*
* @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
const int INVALID_CALLBACK_INDEX = -1;
-// Predicate for std::remove_if algorithm
-bool IsNullPredicate(void* ptr)
-{
- return ptr == NULL;
-}
-
} // unnamed namespace
namespace Dali
* 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()