X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fcommon%2Fscene-graph-property-notification.cpp;h=57a78eb61dafb71d3e6d7e22fc0b53f02009e353;hb=75ca1fe7eb4e9a9bd002226d0522ab88b6510973;hp=ed33b3c246c1fa89b1b7b11972f8b744eb997cc5;hpb=44e58219df5016af2640db8c065cfc1520451f8e;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/common/scene-graph-property-notification.cpp b/dali/internal/update/common/scene-graph-property-notification.cpp index ed33b3c..57a78eb 100644 --- a/dali/internal/update/common/scene-graph-property-notification.cpp +++ b/dali/internal/update/common/scene-graph-property-notification.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -39,9 +39,10 @@ PropertyNotification* PropertyNotification::New(Object& object, int componentIndex, ConditionType condition, RawArgumentContainer& arguments, - NotifyMode notifyMode) + NotifyMode notifyMode, + bool compare) { - return new PropertyNotification( object, propertyIndex, propertyType, componentIndex, condition, arguments, notifyMode ); + return new PropertyNotification( object, propertyIndex, propertyType, componentIndex, condition, arguments, notifyMode, compare ); } @@ -51,7 +52,8 @@ PropertyNotification::PropertyNotification(Object& object, int componentIndex, ConditionType condition, RawArgumentContainer& arguments, - NotifyMode notifyMode) + NotifyMode notifyMode, + bool compare) : mObject(&object), mPropertyIndex(propertyIndex), mPropertyType(propertyType), @@ -60,7 +62,8 @@ PropertyNotification::PropertyNotification(Object& object, mConditionType(condition), mArguments(arguments), mValid(false), - mNotifyMode( Dali::PropertyNotification::Disabled ) + mNotifyMode( Dali::PropertyNotification::Disabled ), + mConditionFunction(NULL) { SetNotifyMode(notifyMode); @@ -88,7 +91,14 @@ PropertyNotification::PropertyNotification(Object& object, } case PropertyCondition::Step: { - mConditionFunction = Step::GetFunction(mPropertyType); + if( compare == true ) + { + mConditionFunction = Step::GetCompareFunction(mPropertyType); + } + else + { + mConditionFunction = Step::GetFunction(mPropertyType); + } break; } case PropertyCondition::VariableStep: @@ -134,8 +144,8 @@ bool PropertyNotification::Check( BufferIndex bufferIndex ) if ( Property::INVALID_COMPONENT_INDEX != mComponentIndex ) { // Evaluate Condition - const PropertyInputComponentAccessor component( mProperty, mComponentIndex ); - const PropertyInputIndexer< PropertyInputComponentAccessor > input( bufferIndex, &component ); + const PropertyInputAccessor component( mProperty, mComponentIndex ); + const PropertyInputIndexer< PropertyInputAccessor > input( bufferIndex, &component ); currentValid = mConditionFunction(input, mArguments); } else @@ -146,8 +156,8 @@ bool PropertyNotification::Check( BufferIndex bufferIndex ) } if( mValid != currentValid - || (currentValid && ((mConditionType == PropertyCondition::Step) - || (mConditionType == PropertyCondition::VariableStep))) ) + || ( currentValid && ( ( mConditionType == PropertyCondition::Step ) + || ( mConditionType == PropertyCondition::VariableStep ) ) ) ) { mValid = currentValid; // means don't notify so notifyRequired stays false