DummyControl actor = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, smallVisual );
actor.SetSize( 200.f, 200.f );
- Toolkit::Visual::ResourceStatus resourceStatus = DevelControl::GetVisualResourceStatus(dummyImpl, DummyControl::Property::TEST_VISUAL);
+ Toolkit::Visual::ResourceStatus resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
application.SendNotification();
application.Render();
- resourceStatus = DevelControl::GetVisualResourceStatus(dummyImpl, DummyControl::Property::TEST_VISUAL);
+ resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, largeVisual, false );
- resourceStatus = DevelControl::GetVisualResourceStatus(dummyImpl, DummyControl::Property::TEST_VISUAL2);
+ resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
application.SendNotification();
- resourceStatus = DevelControl::GetVisualResourceStatus(dummyImpl, DummyControl::Property::TEST_VISUAL2);
+ resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
application.SendNotification();
- resourceStatus = DevelControl::GetVisualResourceStatus(dummyImpl, DummyControl::Property::TEST_VISUAL2);
+ resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION );
END_TEST;
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+#include <dali-toolkit/public-api/image-loader/texture-manager.h>
#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
Property::Map imageMap;
imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ DevelImageVisual::Property::LOAD_POLICY ] = DevelImageVisual::LoadPolicy::IMMEDIATE;
+ imageMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
tet_infoline("Creating ImageView without URL so image does not start loading");
ImageView imageView = ImageView::New();
Property::Map imageMap;
imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ DevelImageVisual::Property::LOAD_POLICY ] = DevelImageVisual::LoadPolicy::IMMEDIATE;
+ imageMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
ImageView imageView = ImageView::New();
imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
Property::Map imageImmediateLoadingMap;
imageImmediateLoadingMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageImmediateLoadingMap[ DevelImageVisual::Property::LOAD_POLICY ] = DevelImageVisual::LoadPolicy::IMMEDIATE;
+ imageImmediateLoadingMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
tet_infoline("Immediate load an image");
ImageView imageView = ImageView::New();
Property::Map propertyMap;
propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE );
propertyMap.Insert( ImageVisual::Property::URL, TEST_LARGE_IMAGE_FILE_NAME );
- propertyMap.Insert( DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::DETACHED );
+ propertyMap.Insert( ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DETACHED );
TestGlAbstraction& gl = application.GetGlAbstraction();
TraceCallStack& textureTrace = gl.GetTextureTrace();
ToolkitTestApplication application;
tet_infoline( "UtcDaliImageVisualReleasePolicy01 Detached Policy, disabling visual with this policy deletes texture" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::DETACHED );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DETACHED );
DALI_TEST_CHECK( imageVisual );
// Set up debug trace
ToolkitTestApplication application;
tet_infoline( "UtcDaliImageVisualReleasePolicy02 Destroyed Policy, Texture should be deleted when visual destroyed" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::DESTROYED );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DESTROYED );
DALI_TEST_CHECK( imageVisual );
// Setup debug trace
ToolkitTestApplication application;
tet_infoline( "UtcDaliImageVisualReleasePolicy03 Never Policy, texture should not be deleted after visual destroyed" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::NEVER );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::NEVER );
DALI_TEST_CHECK( imageVisual );
TestGlAbstraction& gl = application.GetGlAbstraction();
tet_infoline( "UtcDaliImageVisualReleasePolicy04 Two visuals with different policies sharing a texture" );
tet_infoline( "Create first visual with Never release policy" );
- Visual::Base imageVisualNever = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::NEVER );
+ Visual::Base imageVisualNever = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::NEVER );
tet_infoline( "Create second visual with Destroyed release policy");
- Visual::Base imageVisualDestroyed = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::DESTROYED );
+ Visual::Base imageVisualDestroyed = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DESTROYED );
// Set up trace debug
TestGlAbstraction& gl = application.GetGlAbstraction();
imageVisualNever.CreatePropertyMap( resultMap );
DALI_TEST_CHECK( ! resultMap.Empty() );
- DALI_TEST_EQUALS( ( resultMap.Find( DevelImageVisual::Property::RELEASE_POLICY ) )->Get<int>(), (int)DevelImageVisual::ReleasePolicy::NEVER, TEST_LOCATION );
+ DALI_TEST_EQUALS( ( resultMap.Find( ImageVisual::Property::RELEASE_POLICY ) )->Get<int>(), (int)ImageVisual::ReleasePolicy::NEVER, TEST_LOCATION );
END_TEST;
}
ToolkitTestApplication application;
tet_infoline( "UtcDaliImageVisualReleasePolicy06 Never Policy, texture should not be affected by Disabling and Enabling visual" );
- Visual::Base imageVisual= CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::NEVER );
+ Visual::Base imageVisual= CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::NEVER );
DALI_TEST_CHECK( imageVisual );
TestGlAbstraction& gl = application.GetGlAbstraction();
tet_infoline( "UtcDaliImageVisualReleasePolicy07 Two visuals with different policies sharing a texture DETACHED and DESTROYED" );
tet_infoline( "Create first visual with DESTROYED release policy" );
- Visual::Base imageVisualDestroyed = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::DESTROYED );
+ Visual::Base imageVisualDestroyed = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DESTROYED );
tet_infoline( "Create second visual with DETACHED release policy");
- Visual::Base imageVisualDetached = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::RELEASE_POLICY, DevelImageVisual::ReleasePolicy::DETACHED );
+ Visual::Base imageVisualDetached = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DETACHED );
// Set up trace debug
TestGlAbstraction& gl = application.GetGlAbstraction();
textureTrace.Enable(true);
tet_infoline( "Create visual with IMMEDIATE load policy" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::IMMEDIATE );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
textureTrace.Enable(true);
tet_infoline( "Create visual with IMMEDIATE load policy" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::ATTACHED );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::ATTACHED );
const unsigned int TIME_OUT_3_SECONDS = 3;
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, TIME_OUT_3_SECONDS ), false, TEST_LOCATION );
actor.SetSize(200.f, 200.f);
tet_infoline( "Create visual with IMMEDIATE load policy" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::IMMEDIATE );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
tet_infoline( "Registering visual allows control to get a signal once loaded even if visual not enabled( not staged )" );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual, VISUAL_NOT_ENABLED );
actor.SetSize(200.f, 200.f);
tet_infoline( "Create visual with IMMEDIATE load policy" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::IMMEDIATE );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
tet_infoline( "Registering visual allows control to get a signal once loaded even if visual not enabled( staged )" );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual, VISUAL_NOT_ENABLED );
tet_infoline( "Original control correctly signalled, now testing for signal with new Control reusing the image" );
gResourceReadySignalFired = false; // Reset signal check ready for testing next Control
- Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::IMMEDIATE );
+ Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
DummyControl actor2 = DummyControl::New(true);
Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(actor.GetImplementation());
actor2.ResourceReadySignal().Connect( &ResourceReadySignal);
Stage::GetCurrent().Add( actor );
tet_infoline( "Create visual with ATTACHED load policy" );
- Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::ATTACHED );
+ Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::ATTACHED );
tet_infoline( "Registering visual allows control to get a signal once loaded" );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
tet_infoline( "Original control correctly signalled, now testing for signal with new Control reusing the image" );
gResourceReadySignalFired = false; // Reset signal check ready for testing next Control
- Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, DevelImageVisual::Property::LOAD_POLICY, DevelImageVisual::LoadPolicy::ATTACHED );
+ Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::ATTACHED );
DummyControl actor2 = DummyControl::New(true);
Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(actor.GetImplementation());
actor2.ResourceReadySignal().Connect( &ResourceReadySignal);
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
propertyMap.Insert( ImageVisual::Property::URL, TEST_ROTATED_IMAGE );
- propertyMap.Insert( DevelImageVisual::Property::ORIENTATION_CORRECTION, false );
+ propertyMap.Insert( ImageVisual::Property::ORIENTATION_CORRECTION, false );
Visual::Base imageVisual = factory.CreateVisual( propertyMap );
tet_infoline( "Create control for visual, need to loaded it" );
propertyMap.Clear();
propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
propertyMap.Insert( ImageVisual::Property::URL, TEST_ROTATED_IMAGE );
- propertyMap.Insert( DevelImageVisual::Property::ORIENTATION_CORRECTION, true );
+ propertyMap.Insert( ImageVisual::Property::ORIENTATION_CORRECTION, true );
imageVisual = factory.CreateVisual( propertyMap );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
imageVisual.CreatePropertyMap( resultMap );
// check the Property::ORIENTATION_CORRECTION value from the returned map
- Property::Value* typeValue = resultMap.Find( DevelImageVisual::Property::ORIENTATION_CORRECTION, Property::BOOLEAN );
+ Property::Value* typeValue = resultMap.Find( ImageVisual::Property::ORIENTATION_CORRECTION, Property::BOOLEAN );
DALI_TEST_EQUALS( typeValue->Get<bool>(), true, TEST_LOCATION );
END_TEST;
if( NULL != valueSet )
{
- if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+ if( valueSet->GetType() == Dali::Property::STRING && ( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() ) )
{
- tet_printf( " Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ tet_printf( "Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::BOOLEAN && ( valueGet.second.Get<bool>() != valueSet->Get<bool>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<bool>(), valueSet->Get<bool>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::INTEGER && ( valueGet.second.Get<int>() != valueSet->Get<int>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::FLOAT && ( valueGet.second.Get<float>() != valueSet->Get<float>() ) )
+ {
+ tet_printf( "Value got : [%f], expected : [%f]", valueGet.second.Get<float>(), valueSet->Get<float>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR2 && ( valueGet.second.Get<Vector2>() != valueSet->Get<Vector2>() ) )
+ {
+ Vector2 vector2Get = valueGet.second.Get<Vector2>();
+ Vector2 vector2Set = valueSet->Get<Vector2>();
+ tet_printf( "Value got : [%f, %f], expected : [%f, %f]", vector2Get.x, vector2Get.y, vector2Set.x, vector2Set.y );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR4 && ( valueGet.second.Get<Vector4>() != valueSet->Get<Vector4>() ) )
+ {
+ Vector4 vector4Get = valueGet.second.Get<Vector4>();
+ Vector4 vector4Set = valueSet->Get<Vector4>();
+ tet_printf( "Value got : [%f, %f, %f, %f], expected : [%f, %f, %f, %f]", vector4Get.r, vector4Get.g, vector4Get.b, vector4Get.a, vector4Set.r, vector4Set.g, vector4Set.b, vector4Set.a );
return false;
}
}
editor.SetProperty( TextEditor::Property::OUTLINE, outlineMapSet );
- outlineMapSet["color"] = "red";
- outlineMapSet["width"] = "2";
outlineMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::OUTLINE );
DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
{
const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
- if( valueGet.first.type == Property::Key::STRING )
+ Property::Value* valueSet = NULL;
+ if ( valueGet.first.type == Property::Key::INDEX )
{
- Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
- if( NULL != valueSet )
+ valueSet = fontStyleMapSet.Find( valueGet.first.indexKey );
+ }
+ else
+ {
+ // Get Key is a string so searching Set Map for a string key
+ valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+ }
+
+ if( NULL != valueSet )
+ {
+ if( valueSet->GetType() == Dali::Property::STRING && ( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() ) )
{
- if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
- {
- tet_printf( " Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
- return false;
- }
+ tet_printf( "Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ return false;
}
- else
+ else if( valueSet->GetType() == Dali::Property::BOOLEAN && ( valueGet.second.Get<bool>() != valueSet->Get<bool>() ) )
{
- tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<bool>(), valueSet->Get<bool>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::INTEGER && ( valueGet.second.Get<int>() != valueSet->Get<int>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::FLOAT && ( valueGet.second.Get<float>() != valueSet->Get<float>() ) )
+ {
+ tet_printf( "Value got : [%f], expected : [%f]", valueGet.second.Get<float>(), valueSet->Get<float>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR2 && ( valueGet.second.Get<Vector2>() != valueSet->Get<Vector2>() ) )
+ {
+ Vector2 vector2Get = valueGet.second.Get<Vector2>();
+ Vector2 vector2Set = valueSet->Get<Vector2>();
+ tet_printf( "Value got : [%f, %f], expected : [%f, %f]", vector2Get.x, vector2Get.y, vector2Set.x, vector2Set.y );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR4 && ( valueGet.second.Get<Vector4>() != valueSet->Get<Vector4>() ) )
+ {
+ Vector4 vector4Get = valueGet.second.Get<Vector4>();
+ Vector4 vector4Set = valueSet->Get<Vector4>();
+ tet_printf( "Value got : [%f, %f, %f, %f], expected : [%f, %f, %f, %f]", vector4Get.r, vector4Get.g, vector4Get.b, vector4Get.a, vector4Set.r, vector4Set.g, vector4Set.b, vector4Set.a );
return false;
}
}
else
{
- Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.indexKey );
- if( NULL != valueSet )
+ if ( valueGet.first.type == Property::Key::INDEX )
{
- if( valueGet.second.Get<int>() != valueSet->Get<int>() )
- {
- tet_printf( " Integer Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
- return false;
- }
+ tet_printf( " The key %d doesn't exist.", valueGet.first.indexKey );
}
else
{
- tet_printf( " The Int key %d doesn't exist.", valueGet.first.indexKey );
- return false;
+ tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
}
+ return false;
}
}
}
field.SetProperty( TextField::Property::OUTLINE, outlineMapSet );
- outlineMapSet["color"] = "red";
- outlineMapSet["width"] = "2";
outlineMapGet = field.GetProperty<Property::Map>( TextField::Property::OUTLINE );
DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
{
const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
- Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+ Property::Value* valueSet = NULL;
+ if ( valueGet.first.type == Property::Key::INDEX )
+ {
+ valueSet = fontStyleMapSet.Find( valueGet.first.indexKey );
+ }
+ else
+ {
+ // Get Key is a string so searching Set Map for a string key
+ valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+ }
+
if( NULL != valueSet )
{
- if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+ if( valueSet->GetType() == Dali::Property::STRING && ( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() ) )
{
- tet_printf( " Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ tet_printf( "Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::BOOLEAN && ( valueGet.second.Get<bool>() != valueSet->Get<bool>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<bool>(), valueSet->Get<bool>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::INTEGER && ( valueGet.second.Get<int>() != valueSet->Get<int>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::FLOAT && ( valueGet.second.Get<float>() != valueSet->Get<float>() ) )
+ {
+ tet_printf( "Value got : [%f], expected : [%f]", valueGet.second.Get<float>(), valueSet->Get<float>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR2 && ( valueGet.second.Get<Vector2>() != valueSet->Get<Vector2>() ) )
+ {
+ Vector2 vector2Get = valueGet.second.Get<Vector2>();
+ Vector2 vector2Set = valueSet->Get<Vector2>();
+ tet_printf( "Value got : [%f, %f], expected : [%f, %f]", vector2Get.x, vector2Get.y, vector2Set.x, vector2Set.y );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR4 && ( valueGet.second.Get<Vector4>() != valueSet->Get<Vector4>() ) )
+ {
+ Vector4 vector4Get = valueGet.second.Get<Vector4>();
+ Vector4 vector4Set = valueSet->Get<Vector4>();
+ tet_printf( "Value got : [%f, %f, %f, %f], expected : [%f, %f, %f, %f]", vector4Get.r, vector4Get.g, vector4Get.b, vector4Get.a, vector4Set.r, vector4Set.g, vector4Set.b, vector4Set.a );
return false;
}
}
else
{
- tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+ if ( valueGet.first.type == Property::Key::INDEX )
+ {
+ tet_printf( " The key %d doesn't exist.", valueGet.first.indexKey );
+ }
+ else
+ {
+ tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+ }
return false;
}
}
outlineMapSet["width"] = 2.0f;
label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
- outlineMapSet["color"] = "red";
- outlineMapSet["width"] = "2";
outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
#include <dali-toolkit-test-suite-utils.h>
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/texture.h>
-#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+#include <dali-toolkit/public-api/image-loader/texture-manager.h>
using namespace Dali;
using namespace Dali::Toolkit;
#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties-devel.h>
#include <dali-toolkit/devel-api/visuals/animated-gradient-visual-properties-devel.h>
#include <dali-toolkit/dali-toolkit.h>
{
const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
- Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+ Property::Value* valueSet = NULL;
+ if ( valueGet.first.type == Property::Key::INDEX )
+ {
+ valueSet = fontStyleMapSet.Find( valueGet.first.indexKey );
+ }
+ else
+ {
+ // Get Key is a string so searching Set Map for a string key
+ valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+ }
+
if( NULL != valueSet )
{
- if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+ if( valueSet->GetType() == Dali::Property::STRING && ( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() ) )
+ {
+ tet_printf( "Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::BOOLEAN && ( valueGet.second.Get<bool>() != valueSet->Get<bool>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<bool>(), valueSet->Get<bool>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::INTEGER && ( valueGet.second.Get<int>() != valueSet->Get<int>() ) )
+ {
+ tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::FLOAT && ( valueGet.second.Get<float>() != valueSet->Get<float>() ) )
{
- tet_printf( " Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+ tet_printf( "Value got : [%f], expected : [%f]", valueGet.second.Get<float>(), valueSet->Get<float>() );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR2 && ( valueGet.second.Get<Vector2>() != valueSet->Get<Vector2>() ) )
+ {
+ Vector2 vector2Get = valueGet.second.Get<Vector2>();
+ Vector2 vector2Set = valueSet->Get<Vector2>();
+ tet_printf( "Value got : [%f, %f], expected : [%f, %f]", vector2Get.x, vector2Get.y, vector2Set.x, vector2Set.y );
+ return false;
+ }
+ else if( valueSet->GetType() == Dali::Property::VECTOR4 && ( valueGet.second.Get<Vector4>() != valueSet->Get<Vector4>() ) )
+ {
+ Vector4 vector4Get = valueGet.second.Get<Vector4>();
+ Vector4 vector4Set = valueSet->Get<Vector4>();
+ tet_printf( "Value got : [%f, %f, %f, %f], expected : [%f, %f, %f, %f]", vector4Get.r, vector4Get.g, vector4Get.b, vector4Get.a, vector4Set.r, vector4Set.g, vector4Set.b, vector4Set.a );
return false;
}
}
else
{
- tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+ if ( valueGet.first.type == Property::Key::INDEX )
+ {
+ tet_printf( " The key %d doesn't exist.", valueGet.first.indexKey );
+ }
+ else
+ {
+ tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+ }
return false;
}
}
propertyMap.Insert( "horizontalAlignment", "CENTER" );
propertyMap.Insert( "verticalAlignment", "CENTER" );
propertyMap.Insert( "textColor", Color::RED );
+
+ Property::Map shadowMapSet;
+ propertyMap.Insert( "shadow", shadowMapSet.Add("color", Color::RED).Add("offset", Vector2(2.0f, 2.0f)).Add("blurRadius", 3.0f) );
+
+ Property::Map underlineMapSet;
+ propertyMap.Insert( "underline", underlineMapSet.Add("enable", "true").Add("color", "green").Add("height", "1") );
+
+ Property::Map outlineMapSet;
+ propertyMap.Insert( "outline", outlineMapSet.Add("color", Color::YELLOW).Add("width", 1) );
+
Visual::Base textVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( !value->Get<bool>() );
+ value = resultMap.Find( TextVisual::Property::SHADOW, Property::MAP );
+ DALI_TEST_CHECK( value );
+
+ Property::Map shadowMapGet = value->Get<Property::Map>();
+ DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet ), true, TEST_LOCATION );
+
+ value = resultMap.Find( TextVisual::Property::UNDERLINE, Property::MAP );
+ DALI_TEST_CHECK( value );
+
+ Property::Map underlineMapGet = value->Get<Property::Map>();
+ DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
+
+ value = resultMap.Find( DevelTextVisual::Property::OUTLINE, Property::MAP );
+ DALI_TEST_CHECK( value );
+
+ Property::Map outlineMapGet = value->Get<Property::Map>();
+ DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
+
END_TEST;
}
ALIASES += SINCE_1_2_14="@since 1.2.14"
ALIASES += SINCE_1_2_32="@since 1.2.32"
+# Extra tags for Tizen 4.0
+ALIASES += SINCE_1_3_4="@since 1.3.4"
+ALIASES += SINCE_1_3_5="@since 1.3.5"
+
ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 1.0"
ALIASES += DEPRECATED_1_1="@deprecated Deprecated since 1.1"
ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 1.2.8"
#ALIASES += SINCE_1_2_14="\par Since:\n 3.0, DALi version 1.2.14"
#ALIASES += SINCE_1_2_32="\par Since:\n 3.0, DALi version 1.2.32"
+## Extra tags for Tizen 4.0
+#ALIASES += SINCE_1_3_4="\par Since:\n 4.0, DALi version 1.3.4"
+#ALIASES += SINCE_1_3_5="\par Since:\n 4.0, DALi version 1.3.5"
+
## DALi has no deprecated API in Tizen 2.4 because it's DALi's first release.
## Thus deprecated APIs in DALi 1.0.xx will be deprecated in Tizen 3.0.
#ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 3.0, DALi version 1.0"
#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
#include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
+#include <dali-toolkit/public-api/image-loader/texture-manager.h>
#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
return controlDataImpl.IsVisualEnabled( index );
}
-Toolkit::Visual::ResourceStatus GetVisualResourceStatus( const Internal::Control& control, Dali::Property::Index index )
-{
- const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
- return controlDataImpl.GetVisualResourceStatus( index );
-}
-
Dali::Animation CreateTransition( Internal::Control& control, const Toolkit::TransitionData& handle )
{
Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( control );
DALI_IMPORT_API bool IsVisualEnabled( const Internal::Control& control, Dali::Property::Index index );
/**
- * @brief Get the loading state of the visual resource.
- *
- * @param[in] control The control
- * @param[in] index The Property index of the visual
- * @return Return the loading status (PREPARING, READY and FAILED) of visual resource
- */
-DALI_IMPORT_API Toolkit::Visual::ResourceStatus GetVisualResourceStatus( const Internal::Control& control, Dali::Property::Index index );
-
-/**
* @brief Create a transition effect on the control.
*
* Only generates an animation if the properties described in the transition
$(devel_api_src_dir)/image-loader/async-image-loader-devel.cpp \
$(devel_api_src_dir)/image-loader/atlas-upload-observer.cpp \
$(devel_api_src_dir)/image-loader/image-atlas.cpp \
- $(devel_api_src_dir)/image-loader/texture-manager.cpp \
$(devel_api_src_dir)/scripting/script.cpp \
$(devel_api_src_dir)/styling/style-manager-devel.cpp \
$(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
$(devel_api_src_dir)/visuals/image-visual-properties-devel.h \
$(devel_api_src_dir)/visuals/image-visual-actions-devel.h \
$(devel_api_src_dir)/visuals/animated-gradient-visual-properties-devel.h \
+ $(devel_api_src_dir)/visuals/text-visual-properties-devel.h \
$(devel_api_src_dir)/visuals/visual-properties-devel.h
devel_api_shadow_view_header_files = \
devel_api_image_loader_header_files = \
$(devel_api_src_dir)/image-loader/async-image-loader-devel.h \
$(devel_api_src_dir)/image-loader/atlas-upload-observer.h \
- $(devel_api_src_dir)/image-loader/image-atlas.h \
- $(devel_api_src_dir)/image-loader/texture-manager.h
+ $(devel_api_src_dir)/image-loader/image-atlas.h
devel_api_scripting_header_files = \
$(devel_api_src_dir)/scripting/script.h \
return GetImplementation( *this ).GetName();
}
-void Visual::Base::SetTransformAndSize( const Property::Map& transform, Size controlSize )
+void Visual::Base::SetTransformAndSize( const Dali::Property::Map& transform, Size controlSize )
{
GetImplementation( *this ).SetTransformAndSize( transform, controlSize );
}
return GetImplementation( *this ).GetDepthIndex();
}
-void Visual::Base::CreatePropertyMap( Property::Map& map ) const
+void Visual::Base::CreatePropertyMap( Dali::Property::Map& map ) const
{
GetImplementation( *this ).CreatePropertyMap( map );
}
namespace Visual
{
-enum class ResourceStatus
-{
- PREPARING,
- READY,
- FAILED
-};
-
/**
* @brief A Visual provides a renderer for drawing a control component. A control may have multiple visuals.
*
namespace DevelImageVisual
{
-/**
- * @brief The policy determining if the image is loaded when the visual is staged or created.
- */
-namespace LoadPolicy
-{
-
-/**
- * @brief The available named elements that define the LoadPolicy.
- */
-enum Type
-{
- IMMEDIATE = 0, ///< The image is loaded when the ImageVisual is created.
- ATTACHED ///< The image is loaded when the ImageVisual is attached to the stage.
-};
-
-} // namespace LoadPolicy
-
-/**
- * @brief The policy determining when a image is deleted from the cache in relation to the ImageVisual lifetime.
- * @note If the texture is being shared by another visual it persist if still required.
- */
-namespace ReleasePolicy
-{
-
-/**
- * @brief The available named elements that define the ReleasePolicy.
- */
-enum Type
-{
- DETACHED = 0, ///< Image deleted from cache when ImageVisual detached from stage.
- DESTROYED, ///< Image deleted from cache when ImageVisual destroyed.
- NEVER ///< Image is never deleted, will survive the lifetime of the application.
-};
-
-} // namespace ReleasePolicy;
-
namespace Property
{
FRAME_DELAY = Dali::Toolkit::ImageVisual::Property::FRAME_DELAY,
MASK_CONTENT_SCALE = Dali::Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE,
CROP_TO_MASK = Dali::Toolkit::ImageVisual::Property::CROP_TO_MASK,
-
- /**
- * @brief The policy to determine when an image should be loaded.
- * @details Name "loadPolicy", Type LoadPolicy::Type (Property::INTEGER)or Property::STRING.
- * @note Default LoadPolicy::ATTACHED
- * @see LoadPolicy::Type
- */
- LOAD_POLICY = CROP_TO_MASK + 1,
-
- /**
- * @brief The policy to determine when an image should no longer be cached.
- * @details Name "releasePolicy", Type ReleasePolicy::Type (Property::INTEGER) or Property::STRING
- * @note Default ReleasePolicy::DESTROYED
- * @see ReleasePolicy::Type
- */
- RELEASE_POLICY = CROP_TO_MASK + 2,
-
- /**
- * @brief Determines if image orientation should be corrected so the image displays as it was intended.
- * @details Name "orientationCorrection", Type Property::BOOLEAN, if true the image's orientation will be corrected.
- * @note Default true
- */
- ORIENTATION_CORRECTION = CROP_TO_MASK + 3,
+ LOAD_POLICY = Dali::Toolkit::ImageVisual::Property::LOAD_POLICY,
+ RELEASE_POLICY = Dali::Toolkit::ImageVisual::Property::RELEASE_POLICY,
+ ORIENTATION_CORRECTION = Dali::Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION,
/**
* @brief Overlays the auxiliary iamge on top of an NPatch image.
* @details Name "auxiliaryImage", Type Property::STRING, URL of the image.
* @note Default true
*/
- AUXILIARY_IMAGE = CROP_TO_MASK + 4,
+ AUXILIARY_IMAGE = ORIENTATION_CORRECTION + 1,
/**
* @brief An alpha value for mixing between the masked main NPatch image and the auxiliary image
* @details Name "auxiliaryImageAlpha", Type Property::FLOAT, between 0 and 1
* @note Default 0
*/
- AUXILIARY_IMAGE_ALPHA = CROP_TO_MASK + 5,
+ AUXILIARY_IMAGE_ALPHA = ORIENTATION_CORRECTION + 2,
};
--- /dev/null
+#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_TEXT_VISUAL_PROPERTIES_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_VISUALS_TEXT_VISUAL_PROPERTIES_DEVEL_H
+
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/visuals/text-visual-properties.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelTextVisual
+{
+
+namespace Property
+{
+
+/**
+ * @brief All the visual types.
+ */
+enum
+{
+ TEXT = Dali::Toolkit::TextVisual::Property::TEXT,
+ FONT_FAMILY = Dali::Toolkit::TextVisual::Property::FONT_FAMILY,
+ FONT_STYLE = Dali::Toolkit::TextVisual::Property::FONT_STYLE,
+ POINT_SIZE = Dali::Toolkit::TextVisual::Property::POINT_SIZE,
+ MULTI_LINE = Dali::Toolkit::TextVisual::Property::MULTI_LINE,
+ HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextVisual::Property::HORIZONTAL_ALIGNMENT,
+ VERTICAL_ALIGNMENT = Dali::Toolkit::TextVisual::Property::VERTICAL_ALIGNMENT,
+ TEXT_COLOR = Dali::Toolkit::TextVisual::Property::TEXT_COLOR,
+ ENABLE_MARKUP = Dali::Toolkit::TextVisual::Property::ENABLE_MARKUP,
+ SHADOW = Dali::Toolkit::TextVisual::Property::SHADOW,
+ UNDERLINE = Dali::Toolkit::TextVisual::Property::UNDERLINE,
+
+ /**
+ * @brief The default outline parameters.
+ * @details name "outline", type Property::MAP.
+ */
+ OUTLINE = UNDERLINE + 1
+};
+
+
+} // namespace Property
+
+} // namespace DevelTextVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_TEXT_VISUAL_PROPERTIES_DEVEL_H
#include <dali-toolkit/internal/controls/tooltip/tooltip.h>
#include <dali-toolkit/internal/builder/style.h>
#include <dali-toolkit/internal/builder/dictionary.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
namespace Dali
{
mBoundingBox(),
mHighlightColor( LIGHT_BLUE ),
mHighlightPosition( Vector2::ZERO ),
+ mHighlightSize( Vector2::ZERO ),
+ mControlSize( Vector2::ZERO ),
+ mHighlightOutlineOffset( 0.f ),
mActiveCursor( ACTIVE_CURSOR_NONE ),
mCursorBlinkInterval( CURSOR_BLINK_INTERVAL ),
mCursorBlinkDuration( 0.0f ),
if ( mHighlightActor )
{
// Sets the position of the highlight actor inside the decorator.
- mHighlightActor.SetPosition( mHighlightPosition.x,
- mHighlightPosition.y );
+ mHighlightActor.SetPosition( mHighlightPosition.x + mHighlightOutlineOffset,
+ mHighlightPosition.y + mHighlightOutlineOffset );
const unsigned int numberOfQuads = mHighlightQuadList.Count();
if( 0u != numberOfQuads )
Vector2 mHighlightPosition; ///< The position of the highlight actor.
Size mHighlightSize; ///< The size of the highlighted text.
Size mControlSize; ///< The control's size. Set by the Relayout.
+ float mHighlightOutlineOffset; ///< The outline's offset.
unsigned int mActiveCursor;
unsigned int mCursorBlinkInterval;
*( mImpl->mHighlightQuadList.Begin() + index ) = quad;
}
-void Decorator::SetHighLightBox( const Vector2& position, const Size& size )
+void Decorator::SetHighLightBox( const Vector2& position, const Size& size, float outlineOffset )
{
mImpl->mHighlightPosition = position;
mImpl->mHighlightSize = size;
+ mImpl->mHighlightOutlineOffset = outlineOffset;
}
void Decorator::ClearHighlights()
{
mImpl->mHighlightQuadList.Clear();
mImpl->mHighlightPosition = Vector2::ZERO;
+ mImpl->mHighlightOutlineOffset = 0.f;
}
void Decorator::ResizeHighlightQuads( unsigned int numberOfQuads )
*
* @param[in] position The position of the highlighted text in decorator's coords.
* @param[in] size The size of the highlighted text.
+ * @param[in] outlineOffset The outline's offset.
*/
void SetHighLightBox( const Vector2& position,
- const Size& size );
+ const Size& size,
+ float outlineOffset );
/**
* @brief Removes all of the previously added highlights.
lastFontId = glyph.fontId; // Prevents searching for existing blocksizes when string of the same fontId.
}
- if( isOutline&& ( 0u != slotOutline.mImageId ) ) // invalid slot id, glyph has failed to be added to atlas
+ if( isOutline && ( 0u != slotOutline.mImageId ) ) // invalid slot id, glyph has failed to be added to atlas
{
GenerateMesh( glyph,
position,
const SelectionBoxInfo& firstSelectionBoxLineInfo = *( selectionBoxLinesInfo.Begin() );
highLightPosition.y = firstSelectionBoxLineInfo.lineOffset;
- mEventData->mDecorator->SetHighLightBox( highLightPosition, highLightSize );
+ mEventData->mDecorator->SetHighLightBox( highLightPosition, highLightSize, static_cast<float>( mModel->GetOutlineWidth() ) );
if( !mEventData->mDecorator->IsSmoothHandlePanEnabled() )
{
Text::GetCursorPosition( parameters,
cursorInfo );
+ // Adds Outline offset.
+ const float outlineWidth = static_cast<float>( mModel->GetOutlineWidth() );
+ cursorInfo.primaryPosition.x += outlineWidth;
+ cursorInfo.primaryPosition.y += outlineWidth;
+ cursorInfo.secondaryPosition.x += outlineWidth;
+ cursorInfo.secondaryPosition.y += outlineWidth;
+
if( isMultiLine )
{
// If the text is editable and multi-line, the cursor position after a white space shouldn't exceed the boundaries of the text control.
const Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters;
const Vector<Length>& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph;
const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin();
- float outlineWidth = mImpl->mModel->GetOutlineWidth();
+ const float outlineWidth = static_cast<float>( mImpl->mModel->GetOutlineWidth() );
// Set the layout parameters.
Layout::Parameters layoutParameters( size,
const unsigned int width = controller->GetOutlineWidth();
Property::Map map;
-
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
-
- std::string widthStr;
- UintToString( width, widthStr );
- map.Insert( WIDTH_KEY, widthStr );
+ map.Insert( COLOR_KEY, color );
+ map.Insert( WIDTH_KEY, static_cast<int>( width ) );
value = map;
//INTERNAL INCLUDES
#include <dali-toolkit/devel-api/visuals/animated-gradient-visual-properties-devel.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
// load policies
DALI_ENUM_TO_STRING_TABLE_BEGIN( LOAD_POLICY )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::LoadPolicy, IMMEDIATE )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::LoadPolicy, ATTACHED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::LoadPolicy, IMMEDIATE )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::LoadPolicy, ATTACHED )
DALI_ENUM_TO_STRING_TABLE_END( LOAD_POLICY )
// release policies
DALI_ENUM_TO_STRING_TABLE_BEGIN( RELEASE_POLICY )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::ReleasePolicy, DETACHED )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::ReleasePolicy, DESTROYED )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::ReleasePolicy, NEVER )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::ReleasePolicy, DETACHED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::ReleasePolicy, DESTROYED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::ReleasePolicy, NEVER )
DALI_ENUM_TO_STRING_TABLE_END( RELEASE_POLICY )
const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
mSamplingMode( samplingMode ),
mWrapModeU( WrapMode::DEFAULT ),
mWrapModeV( WrapMode::DEFAULT ),
- mLoadPolicy( DevelImageVisual::LoadPolicy::ATTACHED ),
- mReleasePolicy( DevelImageVisual::ReleasePolicy::DETACHED ),
+ mLoadPolicy( Toolkit::ImageVisual::LoadPolicy::ATTACHED ),
+ mReleasePolicy( Toolkit::ImageVisual::ReleasePolicy::DETACHED ),
mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
mAttemptAtlasing( false ),
mLoading( false ),
mSamplingMode( SamplingMode::DEFAULT ),
mWrapModeU( WrapMode::DEFAULT ),
mWrapModeV( WrapMode::DEFAULT ),
- mLoadPolicy( DevelImageVisual::LoadPolicy::ATTACHED ),
- mReleasePolicy( DevelImageVisual::ReleasePolicy::DESTROYED ),
+ mLoadPolicy( Toolkit::ImageVisual::LoadPolicy::ATTACHED ),
+ mReleasePolicy( Toolkit::ImageVisual::ReleasePolicy::DESTROYED ),
mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
mAttemptAtlasing( false ),
mLoading( false ),
}
// ImageVisual destroyed so remove texture unless ReleasePolicy is set to never release
- if( ( mTextureId != TextureManager::INVALID_TEXTURE_ID ) && ( mReleasePolicy != DevelImageVisual::ReleasePolicy::NEVER ) )
+ if( ( mTextureId != TextureManager::INVALID_TEXTURE_ID ) && ( mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER ) )
{
RemoveTexture();
}
}
else if ( keyValue.first == LOAD_POLICY_NAME )
{
- DoSetProperty( Toolkit::DevelImageVisual::Property::LOAD_POLICY, keyValue.second );
+ DoSetProperty( Toolkit::ImageVisual::Property::LOAD_POLICY, keyValue.second );
}
else if( keyValue.first == RELEASE_POLICY_NAME )
{
- DoSetProperty( Toolkit::DevelImageVisual::Property::RELEASE_POLICY, keyValue.second );
+ DoSetProperty( Toolkit::ImageVisual::Property::RELEASE_POLICY, keyValue.second );
}
else if( keyValue.first == ORIENTATION_CORRECTION_NAME )
{
- DoSetProperty( Toolkit::DevelImageVisual::Property::ORIENTATION_CORRECTION, keyValue.second );
+ DoSetProperty( Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION, keyValue.second );
}
}
}
// Load image immediately if LOAD_POLICY requires it
- if ( mLoadPolicy == DevelImageVisual::LoadPolicy::IMMEDIATE )
+ if ( mLoadPolicy == Toolkit::ImageVisual::LoadPolicy::IMMEDIATE )
{
auto attemptAtlasing = AttemptAtlasing();
LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection,
break;
}
- case Toolkit::DevelImageVisual::Property::RELEASE_POLICY:
+ case Toolkit::ImageVisual::Property::RELEASE_POLICY:
{
int releasePolicy;
Scripting::GetEnumerationProperty( value, RELEASE_POLICY_TABLE, RELEASE_POLICY_TABLE_COUNT, releasePolicy );
- mReleasePolicy = DevelImageVisual::ReleasePolicy::Type( releasePolicy );
+ mReleasePolicy = Toolkit::ImageVisual::ReleasePolicy::Type( releasePolicy );
break;
}
- case Toolkit::DevelImageVisual::Property::LOAD_POLICY:
+ case Toolkit::ImageVisual::Property::LOAD_POLICY:
{
int loadPolicy;
Scripting::GetEnumerationProperty( value, LOAD_POLICY_TABLE, LOAD_POLICY_TABLE_COUNT, loadPolicy );
- mLoadPolicy = DevelImageVisual::LoadPolicy::Type( loadPolicy );
+ mLoadPolicy = Toolkit::ImageVisual::LoadPolicy::Type( loadPolicy );
break;
}
- case Toolkit::DevelImageVisual::Property::ORIENTATION_CORRECTION:
+ case Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION:
{
bool orientationCorrection( mOrientationCorrection );
if( value.Get( orientationCorrection ) )
// Image release is dependent on the ReleasePolicy, renderer is destroyed.
actor.RemoveRenderer( mImpl->mRenderer);
- if( mReleasePolicy == DevelImageVisual::ReleasePolicy::DETACHED )
+ if( mReleasePolicy == Toolkit::ImageVisual::ReleasePolicy::DETACHED )
{
RemoveTexture(); // If INVALID_TEXTURE_ID then removal will be attempted on atlas
}
map.Insert( Toolkit::ImageVisual::Property::CROP_TO_MASK, mMaskingData->mCropToMask );
}
- map.Insert( Toolkit::DevelImageVisual::Property::LOAD_POLICY, mLoadPolicy );
- map.Insert( Toolkit::DevelImageVisual::Property::RELEASE_POLICY, mReleasePolicy );
- map.Insert( Toolkit::DevelImageVisual::Property::ORIENTATION_CORRECTION, mOrientationCorrection );
+ map.Insert( Toolkit::ImageVisual::Property::LOAD_POLICY, mLoadPolicy );
+ map.Insert( Toolkit::ImageVisual::Property::RELEASE_POLICY, mReleasePolicy );
+ map.Insert( Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION, mOrientationCorrection );
}
void ImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
namespace Dali
{
Dali::SamplingMode::Type mSamplingMode:4;
Dali::WrapMode::Type mWrapModeU:3;
Dali::WrapMode::Type mWrapModeV:3;
- DevelImageVisual::LoadPolicy::Type mLoadPolicy;
- DevelImageVisual::ReleasePolicy::Type mReleasePolicy;
+ Dali::Toolkit::ImageVisual::LoadPolicy::Type mLoadPolicy;
+ Dali::Toolkit::ImageVisual::ReleasePolicy::Type mReleasePolicy;
Vector4 mAtlasRect;
bool mAttemptAtlasing; ///< If true will attempt atlasing, otherwise create unique texture
bool mLoading; ///< True if the texture is still loading.
data->textureSet = mCache[ cachedIndex ]->textureSet;
NinePatchImage::StretchRanges stretchRangesX;
- stretchRangesX.PushBack( Uint16Pair( border.left, data->croppedWidth - border.right ) );
+ stretchRangesX.PushBack( Uint16Pair( border.left, ( (data->croppedWidth >= static_cast< unsigned int >( border.right )) ? data->croppedWidth - border.right : 0 ) ) );
NinePatchImage::StretchRanges stretchRangesY;
- stretchRangesY.PushBack( Uint16Pair( border.top, data->croppedHeight - border.bottom ) );
+ stretchRangesY.PushBack( Uint16Pair( border.top, ( (data->croppedHeight >= static_cast< unsigned int >( border.bottom )) ? data->croppedHeight - border.bottom : 0 ) ) );
data->stretchPixelsX = stretchRangesX;
data->stretchPixelsY = stretchRangesY;
data->textureSet.SetTexture( 0u, texture );
NinePatchImage::StretchRanges stretchRangesX;
- stretchRangesX.PushBack( Uint16Pair( border.left, data->croppedWidth - border.right ) );
+ stretchRangesX.PushBack( Uint16Pair( border.left, ( (data->croppedWidth >= static_cast< unsigned int >( border.right )) ? data->croppedWidth - border.right : 0 ) ) );
NinePatchImage::StretchRanges stretchRangesY;
- stretchRangesY.PushBack( Uint16Pair( border.top, data->croppedHeight - border.bottom ) );
+ stretchRangesY.PushBack( Uint16Pair( border.top, ( (data->croppedHeight >= static_cast< unsigned int >( border.bottom )) ? data->croppedHeight - border.bottom : 0 ) ) );
data->stretchPixelsX = stretchRangesX;
data->stretchPixelsY = stretchRangesY;
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
varying mediump vec2 vTexCoord;\n
+ varying mediump vec2 vMaskTexCoord;\n
uniform mediump mat4 uMvpMatrix;\n
uniform mediump vec3 uSize;\n
uniform mediump vec2 uNinePatchFactorsX[ FACTOR_SIZE_X ];\n
mediump vec4 gridPosition = vec4( fixedFactor + ( visualSize.xy - fixedTotal ) * stretch / stretchTotal, 0.0, 1.0 );\n
mediump vec4 vertexPosition = gridPosition;\n
vertexPosition.xy -= visualSize.xy * vec2( 0.5, 0.5 );\n
- vertexPostion.xy += anchorPoint*visualSize + (visualOffset + origin)*uSize.xy;\n
+ vertexPosition.xy += anchorPoint*visualSize + (visualOffset + origin)*uSize.xy;\n
vertexPosition = uMvpMatrix * vertexPosition;\n
\n
vTexCoord = ( fixedFactor + stretch ) / ( fixedTotal + stretchTotal );\n
Uint16Pair stretchX = data->stretchPixelsX[ 0 ];
Uint16Pair stretchY = data->stretchPixelsY[ 0 ];
- uint16_t stretchWidth = stretchX.GetY() - stretchX.GetX();
- uint16_t stretchHeight = stretchY.GetY() - stretchY.GetX();
+ uint16_t stretchWidth = ( stretchX.GetY() >= stretchX.GetX() ) ? stretchX.GetY() - stretchX.GetX() : 0;
+ uint16_t stretchHeight = ( stretchY.GetY() >= stretchY.GetX() ) ? stretchY.GetY() - stretchY.GetX() : 0;
mImpl->mRenderer.RegisterProperty( "uFixed[0]", Vector2::ZERO );
mImpl->mRenderer.RegisterProperty( "uFixed[1]", Vector2( stretchX.GetX(), stretchY.GetX()) );
// INTERNAL HEADER
#include <dali-toolkit/public-api/visuals/text-visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties-devel.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
const char * const ENABLE_MARKUP_PROPERTY( "enableMarkup" );
const char * const SHADOW_PROPERTY( "shadow" );
const char * const UNDERLINE_PROPERTY( "underline" );
+const char * const OUTLINE_PROPERTY( "outline" );
const Vector4 FULL_TEXTURE_RECT( 0.f, 0.f, 1.f, 1.f );
{
result = Toolkit::TextVisual::Property::UNDERLINE;
}
+ else if( stringKey == OUTLINE_PROPERTY )
+ {
+ result = Toolkit::DevelTextVisual::Property::OUTLINE;
+ }
return result;
}
GetUnderlineProperties( mController, value, Text::EffectStyle::DEFAULT );
map.Insert( Toolkit::TextVisual::Property::UNDERLINE, value );
+
+ GetOutlineProperties( mController, value, Text::EffectStyle::DEFAULT );
+ map.Insert( Toolkit::DevelTextVisual::Property::OUTLINE, value );
}
void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
SetUnderlineProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
break;
}
+ case Toolkit::DevelTextVisual::Property::OUTLINE:
+ {
+ SetOutlineProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
+ break;
+ }
}
}
auto numberString = GetEnvironmentVariable(environmentVariable);
auto numberOfThreads = numberString ? std::strtoul(numberString, nullptr, 10) : 0;
constexpr auto MAX_NUMBER_OF_THREADS = 100u;
- DALI_ASSERT_ALWAYS( numberOfThreads < MAX_NUMBER_OF_THREADS );
- return (numberOfThreads > 0) ? numberOfThreads : defaultValue;
+ DALI_ASSERT_DEBUG( numberOfThreads < MAX_NUMBER_OF_THREADS );
+ return ( numberOfThreads > 0 && numberOfThreads < MAX_NUMBER_OF_THREADS ) ? numberOfThreads : defaultValue;
}
size_t GetNumberOfLocalLoaderThreads()
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-resource-observer.h>
#include <dali-toolkit/public-api/align-enumerations.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
namespace Dali
{
#include <dali-toolkit/internal/visuals/transition-data-impl.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
#include <dali-toolkit/devel-api/direction-enums.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
namespace Dali
{
return controlDataImpl.IsResourceReady();
}
+Toolkit::Visual::ResourceStatus Control::GetVisualResourceStatus( Dali::Property::Index index )
+{
+ const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
+ const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
+ return controlDataImpl.GetVisualResourceStatus( index );
+}
+
Control::KeyEventSignalType& Control::KeyEventSignal()
{
return Internal::GetImplementation(*this).KeyEventSignal();
#include <dali/public-api/events/tap-gesture-detector.h>
#include <dali/public-api/images/image.h>
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+
namespace Dali
{
*/
bool IsResourceReady() const;
+ /**
+ * @brief Get the loading state of the visual resource.
+ *
+ * @SINCE_1_3_5
+ * @param[in] index The Property index of the visual
+ * @return Return the loading status (PREPARING, READY and FAILED) of visual resource
+ */
+ Visual::ResourceStatus GetVisualResourceStatus( Dali::Property::Index index );
+
// Signals
/**
INPUT_LINE_SPACING,
/**
- * @brief The default underline parameters.
- * @details Name "underline", type Property::MAP.
- * @SINCE_1_2.13
+ * @copydoc Dali::Toolkit::TextLabel::Property::UNDERLINE
*/
UNDERLINE,
INPUT_UNDERLINE,
/**
- * @brief The default shadow parameters.
- * @details Name "shadow", type Property::MAP.
- * @SINCE_1_2.13
+ * @copydoc Dali::Toolkit::TextLabel::Property::SHADOW
*/
SHADOW,
INPUT_EMBOSS,
/**
- * @brief The default outline parameters.
- * @details Name "outline", type Property::MAP.
- * @SINCE_1_2.13
+ * @copydoc Dali::Toolkit::TextLabel::Property::OUTLINE
*/
OUTLINE,
INPUT_POINT_SIZE,
/**
- * @brief The default underline parameters.
- * @details Name "underline", type Property::MAP.
- * @SINCE_1_2.13
+ * @copydoc Dali::Toolkit::TextLabel::Property::UNDERLINE
*/
UNDERLINE,
INPUT_UNDERLINE,
/**
- * @brief The default shadow parameters.
- * @details Name "shadow", type Property::MAP.
- * @SINCE_1_2.13
+ * @copydoc Dali::Toolkit::TextLabel::Property::SHADOW
*/
SHADOW,
INPUT_EMBOSS,
/**
- * @brief The default outline parameters.
- * @details Name "outline", type Property::MAP.
- * @SINCE_1_2.13
+ * @copydoc Dali::Toolkit::TextLabel::Property::OUTLINE
*/
OUTLINE,
/**
* @brief The default underline parameters.
* @details Name "underline", type Property::MAP.
+ *
+ * The underline map contains the following keys:
+ *
+ * | %Property Name | Type | Required | Description |
+ * |----------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------|
+ * | enable | BOOLEAN | No | True to enable the underline or false to disable (the default value is false) |
+ * | color | VECTOR4 | No | The color of the underline (the default value is Color::BLACK) |
+ * | height | FLOAT | No | The height of the underline (the default value is 0) |
+ *
* @SINCE_1_2.13
*/
UNDERLINE,
/**
* @brief The default shadow parameters.
* @details Name "shadow", type Property::MAP.
+ *
+ * The shadow map contains the following keys:
+ *
+ * | %Property Name | Type | Required | Description |
+ * |----------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------|
+ * | color | VECTOR4 | No | The color of the shadow (the default value is Color::BLACK) |
+ * | offset | VECTOR2 | No | The offset from the text to draw the shadow in the X and Y axes (the default value is 0 which means no shadow) |
+ * | blurRadius | FLOAT | No | The radius of blur to be applied to the shadow (the default value is 0 which means no blur) |
+ *
* @SINCE_1_2.13
*/
SHADOW,
/**
* @brief The default outline parameters.
* @details Name "outline", type Property::MAP.
+ *
+ * The outline map contains the following keys:
+ *
+ * | %Property Name | Type | Required | Description |
+ * |----------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------|
+ * | color | VECTOR4 | No | The color of the outline (the default value is Color::WHITE) |
+ * | width | INTEGER | No | The width of the outline (the default value is 0 which means no outline) |
+ *
* @SINCE_1_2.13
*/
OUTLINE,
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 3;
+const unsigned int TOOLKIT_MICRO_VERSION = 4;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
$(public_api_src_dir)/controls/video-view/video-view.cpp \
$(public_api_src_dir)/image-loader/async-image-loader.cpp \
$(public_api_src_dir)/image-loader/sync-image-loader.cpp \
+ $(public_api_src_dir)/image-loader/texture-manager.cpp \
$(public_api_src_dir)/styling/style-manager.cpp \
$(public_api_src_dir)/accessibility-manager/accessibility-manager.cpp \
$(public_api_src_dir)/focus-manager/keyboard-focus-manager.cpp \
public_api_image_loader_header_files = \
$(public_api_src_dir)/image-loader/async-image-loader.h \
- $(public_api_src_dir)/image-loader/sync-image-loader.h
+ $(public_api_src_dir)/image-loader/sync-image-loader.h \
+ $(public_api_src_dir)/image-loader/texture-manager.h
public_api_progress_bar_header_files = \
$(public_api_src_dir)/controls/progress-bar/progress-bar.h
*/
// CLASS HEADER
-#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+#include <dali-toolkit/public-api/image-loader/texture-manager.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
return textureMgr.RemoveExternalTexture( textureUrl );
}
-} // TextureManager
+} // namespace TextureManager
-} // Toolkit
+} // namespace Toolkit
-} // Dali
+} // namespace Dali
-#ifndef DALI_TOOLKIT_DEVEL_API_TEXTURE_MANAGER_H
-#define DALI_TOOLKIT_DEVEL_API_TEXTURE_MANAGER_H
+#ifndef DALI_TOOLKIT_TEXTURE_MANAGER_H
+#define DALI_TOOLKIT_TEXTURE_MANAGER_H
/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd.
/**
* API to interface with the toolkit texture manager
* Allows developers to add Textures through TextureSets to toolkit so that visuals can use them to render
+ * @SINCE_1_3_5
*/
namespace TextureManager
{
/**
* @brief Add a Texture to texture manager
* Toolkit keeps the Texture handle until RemoveTexture is called.
+ * @SINCE_1_3_5
* @note this method does not check for duplicates,
* if same Texture is added multiple times, a different URL is returned each time
* @param[in] texture the Texture to add
/**
* @brief Add a TextureSet to texture manager
* Toolkit keeps the TextureSet handle until RemoveTexture is called.
+ * @SINCE_1_3_5
* @note this method does not check for duplicates,
* if same TextureSet is added multiple times, a different URL is returned each time
* @param[in] textureSet the TextureSet to add
/**
* @brief Removes a TextureSet from toolkit
+ * @SINCE_1_3_5
* @note TextureSet may still be used by visuals and kept alive by them
* @param[in] textureUrl to remove
* @return the handle to the TextureSet or empty handle in case TextureSet is not found
*/
DALI_IMPORT_API TextureSet RemoveTexture( const std::string& textureUrl );
-}
+} // namespace TextureManager
-} // Toolkit
+} // namespace Toolkit
-} // Dali
+} // namespace Dali
-#endif // DALI_TOOLKIT_DEVEL_API_TEXTURE_MANAGER_H
+#endif // DALI_TOOLKIT_TEXTURE_MANAGER_H
* @note If this is false, then the mask is scaled to fit the image before being applied.
*/
CROP_TO_MASK,
+
+/**
+ * @brief The policy to determine when an image should be loaded.
+ * @details Name "loadPolicy", Type LoadPolicy::Type (Property::INTEGER)or Property::STRING.
+ * @SINCE_1_3_5
+ * @note Default LoadPolicy::ATTACHED
+ * @see LoadPolicy::Type
+ */
+
+ LOAD_POLICY,
+
+ /**
+ * @brief The policy to determine when an image should no longer be cached.
+ * @details Name "releasePolicy", Type ReleasePolicy::Type (Property::INTEGER) or Property::STRING
+ * @SINCE_1_3_5
+ * @note Default ReleasePolicy::DESTROYED
+ * @see ReleasePolicy::Type
+ */
+
+ RELEASE_POLICY,
+
+ /**
+ * @brief Determines if image orientation should be corrected so the image displays as it was intended.
+ * @details Name "orientationCorrection", Type Property::BOOLEAN, if true the image's orientation will be corrected.
+ * @SINCE_1_3_5
+ * @note Default true
+ */
+
+ ORIENTATION_CORRECTION,
+
};
} // namespace Property
+/**
+ * @brief The policy determining if the image is loaded when the visual is staged or created.
+ * @SINCE_1_3_5
+ */
+namespace LoadPolicy
+{
+
+/**
+ * @brief The available named elements that define the LoadPolicy.
+ * @SINCE_1_3_5
+ */
+enum Type
+{
+ IMMEDIATE = 0, ///< The image is loaded when the ImageVisual is created.
+ ATTACHED ///< The image is loaded when the ImageVisual is attached to the stage.
+};
+
+} // namespace LoadPolicy
+
+/**
+ * @brief The policy determining when a image is deleted from the cache in relation to the ImageVisual lifetime.
+ * @SINCE_1_3_5
+ * @note If the texture is being shared by another visual it persist if still required.
+ */
+namespace ReleasePolicy
+{
+
+/**
+ * @brief The available named elements that define the ReleasePolicy.
+ * @SINCE_1_3_5
+ */
+enum Type
+{
+ DETACHED = 0, ///< Image deleted from cache when ImageVisual detached from stage.
+ DESTROYED, ///< Image deleted from cache when ImageVisual destroyed.
+ NEVER ///< Image is never deleted, will survive the lifetime of the application.
+};
+
+} // namespace ReleasePolicy;
+
} // namespace ImageVisual
/**
} // namespace Shader
+
+/**
+ * @brief Status of resource which is used for visual.
+ * @SINCE_1_3_5
+ */
+enum class ResourceStatus
+{
+ PREPARING, /// Resource is prepared. @SINCE_1_3_5
+ READY, /// Resource is ready. @SINCE_1_3_5
+ FAILED /// Resource is fail to load @SINCE_1_3_5
+};
+
} // namespace Visual
/**
Name: dali-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.3.3
+Version: 1.3.4
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT