} // unnamed namespace
-PanGestureDetector::DefaultPropertyLookup* PanGestureDetector::mDefaultPropertyLookup = NULL;
-
PanGestureDetectorPtr PanGestureDetector::New()
{
return new PanGestureDetector;
mMaximumTouches(1),
mSceneObject(NULL)
{
- if( !mDefaultPropertyLookup )
- {
- mDefaultPropertyLookup = new DefaultPropertyLookup();
- const int start = DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT;
- for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
- {
- ( *mDefaultPropertyLookup )[ DEFAULT_PROPERTIES[i].name ] = i + start;
- }
- }
}
PanGestureDetector::~PanGestureDetector()
// Do nothing
}
-bool PanGestureDetector::IsSceneObjectRemovable() const
-{
- return false;
-}
-
unsigned int PanGestureDetector::GetDefaultPropertyCount() const
{
return DEFAULT_PROPERTY_COUNT;
}
}
-const std::string& PanGestureDetector::GetDefaultPropertyName( Property::Index index ) const
+const char* PanGestureDetector::GetDefaultPropertyName( Property::Index index ) const
{
index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_MAX_COUNT;
if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
}
else
{
- // Index out-of-range... return empty string.
- static const std::string INVALID_PROPERTY_NAME;
- return INVALID_PROPERTY_NAME;
+ return NULL;
}
}
{
Property::Index index = Property::INVALID_INDEX;
- DALI_ASSERT_DEBUG( NULL != mDefaultPropertyLookup );
-
// Look for name in default properties
- DefaultPropertyLookup::const_iterator result = mDefaultPropertyLookup->find( name );
- if ( mDefaultPropertyLookup->end() != result )
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- index = result->second;
+ const Internal::PropertyDetails* property = &DEFAULT_PROPERTIES[ i ];
+ if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
+ {
+ index = i;
+ break;
+ }
}
-
return index;
}
// None of our properties should be settable from Public API
}
-void PanGestureDetector::SetCustomProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value )
-{
- // None of our properties should be settable from Public API
-}
-
Property::Value PanGestureDetector::GetDefaultProperty(Property::Index index) const
{
Property::Value value;
return value;
}
-void PanGestureDetector::InstallSceneObjectProperty( SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index )
-{
- // We do not want the user to install custom properties
- DALI_ASSERT_ALWAYS(false && "PanGestureDetector does not allow custom properties" );
-}
-
const SceneGraph::PropertyOwner* PanGestureDetector::GetSceneObject() const
{
// This method should only return an object connected to the scene-graph
if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
{
- CustomPropertyLookup::const_iterator entry = GetCustomPropertyLookup().find( index );
-
- DALI_ASSERT_ALWAYS( GetCustomPropertyLookup().end() != entry && "property index is invalid" );
-
- property = entry->second.GetSceneGraphProperty();
+ CustomProperty* custom = FindCustomProperty( index );
+ DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
+ property = custom->GetSceneGraphProperty();
}
else
{