Change-Id: I08faedcf31235b3d5a62e5e6e44fcddd1c38e98e
21 files changed:
DALI_TEST_CHECK( visual );
// Register to self
DALI_TEST_CHECK( visual );
// Register to self
- controlWrapperImpl->RegisterVisual( index, visual, 4.0f );
+ controlWrapperImpl->RegisterVisual( index, visual, 4 );
DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
- DALI_TEST_EQUALS( visual.GetDepthIndex(), 4.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( visual.GetDepthIndex(), 4, TEST_LOCATION );
}
DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
}
DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
DALI_TEST_CHECK(visual);
// Register index with a color visual
DALI_TEST_CHECK(visual);
// Register index with a color visual
- controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10.0f );
+ controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10 );
DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
- DALI_TEST_EQUALS( visual.GetDepthIndex(), 10.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( visual.GetDepthIndex(), 10, TEST_LOCATION );
Stage::GetCurrent().Add( controlWrapper );
Stage::GetCurrent().Add( controlWrapper );
propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
Visual::Base visual = factory.CreateVisual( propertyMap );
propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
Visual::Base visual = factory.CreateVisual( propertyMap );
- visual.SetDepthIndex( 1.f );
+ visual.SetDepthIndex( 1 );
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
int depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
DALI_TEST_EQUALS( depthIndex, 1, TEST_LOCATION );
int depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
DALI_TEST_EQUALS( depthIndex, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( visual.GetDepthIndex(), 1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( visual.GetDepthIndex(), 1, TEST_LOCATION );
- visual.SetDepthIndex( -1.f );
+ visual.SetDepthIndex( -1 );
depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
DALI_TEST_EQUALS( depthIndex, -1, TEST_LOCATION );
depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
DALI_TEST_EQUALS( depthIndex, -1, TEST_LOCATION );
- DALI_TEST_EQUALS( visual.GetDepthIndex(), -1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( visual.GetDepthIndex(), -1, TEST_LOCATION );
propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
Visual::Base visual = factory.CreateVisual( propertyMap );
propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
Visual::Base visual = factory.CreateVisual( propertyMap );
- visual.SetDepthIndex( 1.f );
+ visual.SetDepthIndex( 1 );
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
propertyMap.Insert( "verticalAlignment", "CENTER" );
propertyMap.Insert( "textColor", Color::RED );
Visual::Base textVisual = factory.CreateVisual( propertyMap );
propertyMap.Insert( "verticalAlignment", "CENTER" );
propertyMap.Insert( "textColor", Color::RED );
Visual::Base textVisual = factory.CreateVisual( propertyMap );
- textVisual.SetDepthIndex( 1.f );
+ textVisual.SetDepthIndex( 1 );
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
propertyMap.Insert( DevelVisual::Property::TRANSFORM, transformMap );
textVisual = factory.CreateVisual( propertyMap );
propertyMap.Insert( DevelVisual::Property::TRANSFORM, transformMap );
textVisual = factory.CreateVisual( propertyMap );
- textVisual.SetDepthIndex( 1.f );
+ textVisual.SetDepthIndex( 1 );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
dummyControl.SetSize( 720.f, 640.f );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
dummyControl.SetSize( 720.f, 640.f );
propertyMap.Insert( "verticalAlignment", "CENTER" );
propertyMap.Insert( "textColor", Color::RED );
Visual::Base textVisual = factory.CreateVisual( propertyMap );
propertyMap.Insert( "verticalAlignment", "CENTER" );
propertyMap.Insert( "textColor", Color::RED );
Visual::Base textVisual = factory.CreateVisual( propertyMap );
- textVisual.SetDepthIndex( 1.f );
+ textVisual.SetDepthIndex( 1 );
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
tet_infoline( "Register visual, should have depth index of 0.0f" );
Visual::Base testVisual = factory.CreateVisual( propertyMap );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, testVisual );
tet_infoline( "Register visual, should have depth index of 0.0f" );
Visual::Base testVisual = factory.CreateVisual( propertyMap );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, testVisual );
- DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 0, TEST_LOCATION );
tet_infoline( "Register more visuals, each added one should have a depth index greater than previous" );
tet_infoline( "Register more visuals, each added one should have a depth index greater than previous" );
tet_infoline( "Set depth index on a new visual before registering, the depth index should not have been changed" );
Visual::Base labelVisual = factory.CreateVisual( propertyMap );
tet_infoline( "Set depth index on a new visual before registering, the depth index should not have been changed" );
Visual::Base labelVisual = factory.CreateVisual( propertyMap );
- labelVisual.SetDepthIndex( -2000.0f );
+ labelVisual.SetDepthIndex( -2000 );
dummyImpl.RegisterVisual( DummyControl::Property::LABEL_VISUAL, labelVisual );
dummyImpl.RegisterVisual( DummyControl::Property::LABEL_VISUAL, labelVisual );
- DALI_TEST_EQUALS( labelVisual.GetDepthIndex(), -2000.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( labelVisual.GetDepthIndex(), -2000, TEST_LOCATION );
tet_infoline( "Replace visual, the depth index should be the same as what was previously set" );
tet_infoline( "Replace visual, the depth index should be the same as what was previously set" );
- const float testVisual2DepthIndex = testVisual2.GetDepthIndex();
+ const int testVisual2DepthIndex = testVisual2.GetDepthIndex();
Visual::Base testVisual2Replacement = factory.CreateVisual( propertyMap );
DALI_TEST_CHECK( testVisual2Replacement.GetDepthIndex() != testVisual2DepthIndex );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2Replacement );
Visual::Base testVisual2Replacement = factory.CreateVisual( propertyMap );
DALI_TEST_CHECK( testVisual2Replacement.GetDepthIndex() != testVisual2DepthIndex );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2Replacement );
tet_infoline( "Replace visual and set a depth index on the replacement, the depth index of the replacement should be honoured" );
Visual::Base anotherTestVisual2Replacement = factory.CreateVisual( propertyMap );
tet_infoline( "Replace visual and set a depth index on the replacement, the depth index of the replacement should be honoured" );
Visual::Base anotherTestVisual2Replacement = factory.CreateVisual( propertyMap );
- anotherTestVisual2Replacement.SetDepthIndex( 2000.0f );
+ anotherTestVisual2Replacement.SetDepthIndex( 2000 );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, anotherTestVisual2Replacement );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, anotherTestVisual2Replacement );
- DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000, TEST_LOCATION );
dummyControl.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( dummyControl );
dummyControl.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( dummyControl );
tet_infoline( "Register a visual with a depth index, it should be enabled by default too" );
Visual::Base testVisual = factory.CreateVisual( propertyMap );
tet_infoline( "Register a visual with a depth index, it should be enabled by default too" );
Visual::Base testVisual = factory.CreateVisual( propertyMap );
- DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, testVisual, 203.0f );
- DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 203.0f, TEST_LOCATION );
+ DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, testVisual, 203 );
+ DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 203, TEST_LOCATION );
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL ), true, TEST_LOCATION );
tet_infoline( "Register another visual with a depth index and it disabled" );
Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL ), true, TEST_LOCATION );
tet_infoline( "Register another visual with a depth index and it disabled" );
Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
- DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual2, false, 450.0f );
- DALI_TEST_EQUALS( testVisual2.GetDepthIndex(), 450.0f, TEST_LOCATION );
+ DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual2, false, 450 );
+ DALI_TEST_EQUALS( testVisual2.GetDepthIndex(), 450, TEST_LOCATION );
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), false, TEST_LOCATION );
tet_infoline( "Register another visual with a depth index and it enabled using the enabled API" );
Visual::Base testVisual3 = factory.CreateVisual( propertyMap );
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), false, TEST_LOCATION );
tet_infoline( "Register another visual with a depth index and it enabled using the enabled API" );
Visual::Base testVisual3 = factory.CreateVisual( propertyMap );
- DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual3, true, 300.0f );
- DALI_TEST_EQUALS( testVisual3.GetDepthIndex(), 300.0f, TEST_LOCATION );
+ DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual3, true, 300 );
+ DALI_TEST_EQUALS( testVisual3.GetDepthIndex(), 300, TEST_LOCATION );
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
dummyControl.SetSize(200.f, 200.f);
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
dummyControl.SetSize(200.f, 200.f);
controlImpl.RegisterVisual( index, visual );
}
controlImpl.RegisterVisual( index, visual );
}
-void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
{
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
controlImpl.RegisterVisual( index, visual, depthIndex );
{
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
controlImpl.RegisterVisual( index, visual, depthIndex );
controlImpl.RegisterVisual( index, visual, enabled );
}
controlImpl.RegisterVisual( index, visual, enabled );
}
-void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
{
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
{
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
* @see Visual::Base::GetDepthIndex()
* @see Visual::Base::SetDepthIndex()
*/
* @see Visual::Base::GetDepthIndex()
* @see Visual::Base::SetDepthIndex()
*/
-DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
/**
* @brief Register a visual by Property Index with the option of enabling/disabling it.
/**
* @brief Register a visual by Property Index with the option of enabling/disabling it.
* @see Visual::Base::GetDepthIndex()
* @see Visual::Base::SetDepthIndex()
*/
* @see Visual::Base::GetDepthIndex()
* @see Visual::Base::SetDepthIndex()
*/
-DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
/**
* @brief Erase the entry matching the given index from the list of registered visuals
/**
* @brief Erase the entry matching the given index from the list of registered visuals
DevelControl::RegisterVisual( *this, index, visual );
}
DevelControl::RegisterVisual( *this, index, visual );
}
-void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
{
DevelControl::RegisterVisual( *this, index, visual, depthIndex );
}
{
DevelControl::RegisterVisual( *this, index, visual, depthIndex );
}
DevelControl::RegisterVisual( *this, index, visual, enabled );
}
DevelControl::RegisterVisual( *this, index, visual, enabled );
}
-void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
{
DevelControl::RegisterVisual( *this, index, visual, enabled, depthIndex );
}
{
DevelControl::RegisterVisual( *this, index, visual, enabled, depthIndex );
}
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
*/
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
*/
- void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
*/
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
*/
- void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
/**
* @ref Dali::Toolkit::DevelControl::UnregisterVisual()
/**
* @ref Dali::Toolkit::DevelControl::UnregisterVisual()
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
GetImplementation( *this ).GetNaturalSize( naturalSize );
}
GetImplementation( *this ).GetNaturalSize( naturalSize );
}
-void Visual::Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( int index )
{
GetImplementation( *this ).SetDepthIndex( index );
}
{
GetImplementation( *this ).SetDepthIndex( index );
}
-float Visual::Base::GetDepthIndex() const
+int Visual::Base::GetDepthIndex() const
{
return GetImplementation( *this ).GetDepthIndex();
}
{
return GetImplementation( *this ).GetDepthIndex();
}
*
* @param[in] index The depth index of this visual.
*/
*
* @param[in] index The depth index of this visual.
*/
- void SetDepthIndex( float index );
+ void SetDepthIndex( int index );
/**
* @brief Get the depth index of this visual
*
* @return The depth index of this visual.
*/
/**
* @brief Get the depth index of this visual
*
* @return The depth index of this visual.
*/
- float GetDepthIndex() const;
+ int GetDepthIndex() const;
/**
* @brief Create the property map representing this visual.
/**
* @brief Create the property map representing this visual.
* 4) Unregister visual if empty map was provided. This is the method to remove a visual
*/
* 4) Unregister visual if empty map was provided. This is the method to remove a visual
*/
-void Button::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth )
+void Button::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth )
{
DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent index(%d)\n", index );
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
{
DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent index(%d)\n", index );
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
#define DALI_TOOLKIT_INTERNAL_BUTTON_H
/*
#define DALI_TOOLKIT_INTERNAL_BUTTON_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* @param[in] value the value to set on the component
* @param[in] visualDepth the depth of the visual if overlapping another
*/
* @param[in] value the value to set on the component
* @param[in] visualDepth the depth of the visual if overlapping another
*/
- void CreateVisualsForComponent( Property::Index index ,const Property::Value& value, const float visualDepth );
+ void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
/**
* @brief Get the Property map for the given Visual
/**
* @brief Get the Property map for the given Visual
RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
}
RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
}
-void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
{
RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::SET, depthIndex );
}
{
RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::SET, depthIndex );
}
RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::NOT_SET );
}
RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::NOT_SET );
}
-void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
{
RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::SET, depthIndex );
}
{
RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::SET, depthIndex );
}
-void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, float depthIndex )
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
{
bool visualReplaced ( false );
Actor self = mControlImpl.Self();
{
bool visualReplaced ( false );
Actor self = mControlImpl.Self();
// If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
// If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
- EqualsZero( visual.GetDepthIndex() ) )
+ ( visual.GetDepthIndex() == 0 ) )
- const float currentDepthIndex = (*iter)->visual.GetDepthIndex();
+ const int currentDepthIndex = (*iter)->visual.GetDepthIndex();
visual.SetDepthIndex( currentDepthIndex );
}
visual.SetDepthIndex( currentDepthIndex );
}
// If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
( mVisuals.Size() > 1 ) &&
// If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
( mVisuals.Size() > 1 ) &&
- EqualsZero( visual.GetDepthIndex() ) )
+ ( visual.GetDepthIndex() == 0 ) )
- float maxDepthIndex = std::numeric_limits< float >::min();
+ int maxDepthIndex = std::numeric_limits< int >::min();
RegisteredVisualContainer::ConstIterator iter;
const RegisteredVisualContainer::ConstIterator endIter = mVisuals.End();
for ( iter = mVisuals.Begin(); iter != endIter; iter++ )
{
RegisteredVisualContainer::ConstIterator iter;
const RegisteredVisualContainer::ConstIterator endIter = mVisuals.End();
for ( iter = mVisuals.Begin(); iter != endIter; iter++ )
{
- const float visualDepthIndex = (*iter)->visual.GetDepthIndex();
+ const int visualDepthIndex = (*iter)->visual.GetDepthIndex();
if ( visualDepthIndex > maxDepthIndex )
{
maxDepthIndex = visualDepthIndex;
if ( visualDepthIndex > maxDepthIndex )
{
maxDepthIndex = visualDepthIndex;
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, ImageDimensions() );
if( visual )
{
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, ImageDimensions() );
if( visual )
{
- controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
+ controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
}
}
else if( value.Get( color ) )
}
}
else if( value.Get( color ) )
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
*/
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
*/
- void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
*/
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
*/
- void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
/**
* @copydoc Dali::Toolkit::DevelControl::UnregisterVisual()
/**
* @copydoc Dali::Toolkit::DevelControl::UnregisterVisual()
* @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
* @param[in] depthIndex The visual's depth-index is set to this
*/
* @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
* @param[in] depthIndex The visual's depth-index is set to this
*/
- void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, float depthIndex = 0.0f );
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex = 0 );
mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren );
mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren );
- DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, float( DepthIndex::CONTENT + 1 ) );
+ DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, DepthIndex::CONTENT + 1 );
mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
TextureSet textureSet = TextureSet::New();
mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
TextureSet textureSet = TextureSet::New();
* 4) Unregister visual if empty map was provided. This is the method to remove a visual
*/
* 4) Unregister visual if empty map was provided. This is the method to remove a visual
*/
-void ProgressBar::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth )
+void ProgressBar::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth )
{
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
Toolkit::Visual::Base progressVisual;
{
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
Toolkit::Visual::Base progressVisual;
#define DALI_TOOLKIT_INTERNAL_PROGRESS_BAR_H
/*
#define DALI_TOOLKIT_INTERNAL_PROGRESS_BAR_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* Update progress bar label when progress value is changed
*/
/**
* Update progress bar label when progress value is changed
*/
- void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth );
+ void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
/**
* Update progress bar label when progress value is changed
/**
* Update progress bar label when progress value is changed
Actor self( Self() );
mVisuals[0] = Toolkit::VisualFactory::Get().CreateVisual( mInputImage );
Actor self( Self() );
mVisuals[0] = Toolkit::VisualFactory::Get().CreateVisual( mInputImage );
- DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0.0f ); // Will clean up previously registered visuals for this index.
+ DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0 ); // Will clean up previously registered visuals for this index.
// custom shader is not applied on the original image.
BlurImage( 0, inputImage);
// custom shader is not applied on the original image.
BlurImage( 0, inputImage);
GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT );
mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] );
GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT );
mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] );
- DevelControl::RegisterVisual( *this, i, mVisuals[i], float( i ) ); // Will clean up existing visual with same index.
+ DevelControl::RegisterVisual( *this, i, mVisuals[i], int( i ) ); // Will clean up existing visual with same index.
SetShaderEffect( mVisuals[i] );
}
SetShaderEffect( mVisuals[i] );
}
- DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual, float( DepthIndex::CONTENT ) );
+ DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual, DepthIndex::CONTENT );
#define DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H
/*
#define DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Transform mTransform;
Vector4 mMixColor;
Size mControlSize;
Transform mTransform;
Vector4 mMixColor;
Size mControlSize;
Property::Index mMixColorIndex;
Property::Index mOpacityIndex;
int mFlags;
Property::Index mMixColorIndex;
Property::Index mOpacityIndex;
int mFlags;
naturalSize = Vector2::ZERO;
}
naturalSize = Vector2::ZERO;
}
-void Visual::Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( int index )
{
mImpl->mDepthIndex = index;
if( mImpl->mRenderer )
{
mImpl->mDepthIndex = index;
if( mImpl->mRenderer )
-float Visual::Base::GetDepthIndex() const
+int Visual::Base::GetDepthIndex() const
{
return mImpl->mDepthIndex;
}
{
return mImpl->mDepthIndex;
}
#define DALI_TOOLKIT_INTERNAL_VISUAL_H
/*
#define DALI_TOOLKIT_INTERNAL_VISUAL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* @copydoc Toolkit::Visual::Base::SetDepthIndex
*/
/**
* @copydoc Toolkit::Visual::Base::SetDepthIndex
*/
- void SetDepthIndex( float index );
+ void SetDepthIndex( int index );
/**
* @copydoc Toolkit::Visual::Base::GetDepthIndex
*/
/**
* @copydoc Toolkit::Visual::Base::GetDepthIndex
*/
- float GetDepthIndex() const;
+ int GetDepthIndex() const;
/**
* @copydoc Toolkit::Visual::Base::SetOnStage
/**
* @copydoc Toolkit::Visual::Base::SetOnStage
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
if( visual )
{
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
if( visual )
{
- mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
+ mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
// Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
RelayoutRequest();
// Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
RelayoutRequest();
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
if( visual )
{
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
if( visual )
{
- mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
+ mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );