/*
- * 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.
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 );
}
int componentIndex,
ConditionType condition,
RawArgumentContainer& arguments,
- NotifyMode notifyMode)
+ NotifyMode notifyMode,
+ bool compare)
: mObject(&object),
mPropertyIndex(propertyIndex),
mPropertyType(propertyType),
mConditionType(condition),
mArguments(arguments),
mValid(false),
- mNotifyMode( Dali::PropertyNotification::Disabled )
+ mNotifyMode( Dali::PropertyNotification::Disabled ),
+ mConditionFunction(NULL)
{
SetNotifyMode(notifyMode);
}
case PropertyCondition::Step:
{
- mConditionFunction = Step::GetFunction(mPropertyType);
+ if( compare == true )
+ {
+ mConditionFunction = Step::GetCompareFunction(mPropertyType);
+ }
+ else
+ {
+ mConditionFunction = Step::GetFunction(mPropertyType);
+ }
break;
}
case PropertyCondition::VariableStep:
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
}
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