From 5f6befa398f1c68fcc8edff409a086f54af4d5f9 Mon Sep 17 00:00:00 2001 From: Richard Underhill Date: Thu, 30 Apr 2015 13:40:38 +0100 Subject: [PATCH] Merged with Tizen Branch ( builds ) Conflicts: automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp dali-toolkit/internal/atlas-manager/atlas-manager-impl.h dali-toolkit/internal/atlas-manager/atlas-manager.cpp dali-toolkit/internal/atlas-manager/atlas-manager.h dali-toolkit/internal/builder/builder-animations.cpp dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp dali-toolkit/internal/controls/text-controls/text-field-impl.cpp dali-toolkit/internal/controls/text-controls/text-field-impl.h dali-toolkit/internal/controls/text-controls/text-label-impl.cpp dali-toolkit/internal/controls/text-controls/text-label-impl.h dali-toolkit/internal/controls/view/view-impl.cpp dali-toolkit/internal/controls/view/view-impl.h dali-toolkit/internal/text/decorator/text-decorator.cpp dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h dali-toolkit/internal/text/rendering/text-renderer.h dali-toolkit/internal/text/text-controller-impl.cpp dali-toolkit/internal/text/text-controller-impl.h dali-toolkit/internal/text/text-controller.cpp dali-toolkit/internal/text/text-controller.h dali-toolkit/internal/text/visual-model-impl.cpp dali-toolkit/public-api/controls/control-impl.cpp dali-toolkit/public-api/controls/text-controls/text-field.h dali-toolkit/public-api/controls/view/view.h dali-toolkit/public-api/dali-toolkit-version.cpp docs/content/programming-guide/size-negotiation.h packaging/dali-toolkit.spec Change-Id: Ia6caabe5e4dc83995a0f10cd68a3a6487a1b7dba Signed-off-by: Richard Underhill --- .../src/dali-toolkit/utc-Dali-TextLabel.cpp | 1 - .../internal/atlas-manager/atlas-manager-impl.cpp | 289 ++--- .../internal/atlas-manager/atlas-manager-impl.h | 27 +- .../internal/atlas-manager/atlas-manager.cpp | 21 +- .../internal/atlas-manager/atlas-manager.h | 35 +- .../internal/builder/builder-animations.cpp | 8 +- dali-toolkit/internal/builder/builder-impl.cpp | 4 +- .../controls/bubble-effect/bubble-emitter-impl.h | 2 - .../controls/scrollable/bouncing-effect-actor.cpp | 2 - .../scrollable/scroll-view/merge.sublime-project | 8 + .../scrollable/scroll-view/merge.sublime-workspace | 1282 ++++++++++++++++++++ .../scrollable/scroll-view/tizen.sublime-project | 8 + .../scrollable/scroll-view/tizen.sublime-workspace | 545 +++++++++ .../controls/text-controls/text-field-impl.cpp | 105 +- .../controls/text-controls/text-field-impl.h | 2 +- .../controls/text-controls/text-label-impl.cpp | 2 +- .../controls/text-controls/text-label-impl.h | 2 +- .../internal/controls/tool-bar/tool-bar-impl.cpp | 4 +- dali-toolkit/internal/controls/view/view-impl.cpp | 346 ++++++ dali-toolkit/internal/controls/view/view-impl.h | 208 ++++ dali-toolkit/internal/file.list | 3 - .../internal/text/decorator/text-decorator.cpp | 36 +- .../rendering/atlas/atlas-glyph-manager-impl.cpp | 13 +- .../rendering/atlas/atlas-glyph-manager-impl.h | 15 +- .../text/rendering/atlas/atlas-glyph-manager.cpp | 13 +- .../text/rendering/atlas/atlas-glyph-manager.h | 15 +- .../text/rendering/atlas/text-atlas-renderer.cpp | 430 ++++--- .../text/rendering/atlas/text-atlas-renderer.h | 2 +- .../text/rendering/basic/text-basic-renderer.cpp | 21 +- .../text/rendering/basic/text-basic-renderer.h | 2 +- .../text/rendering/shaders/text-basic-shader.cpp | 1 + .../rendering/shaders/text-basic-shadow-shader.cpp | 63 - .../rendering/shaders/text-basic-shadow-shader.h | 53 - .../text/rendering/shaders/text-bgra-shader.cpp | 1 + .../internal/text/rendering/text-renderer.h | 4 +- .../internal/text/text-controller-impl.cpp | 307 ++++- dali-toolkit/internal/text/text-controller-impl.h | 126 +- dali-toolkit/internal/text/text-controller.cpp | 584 +++++---- dali-toolkit/internal/text/text-controller.h | 93 +- dali-toolkit/internal/text/visual-model-impl.cpp | 8 +- dali-toolkit/public-api/controls/control-impl.cpp | 23 +- .../public-api/controls/text-controls/text-field.h | 4 +- dali-toolkit/public-api/controls/view/view.h | 218 ++++ dali-toolkit/public-api/dali-toolkit-version.cpp | 2 +- dali-toolkit/public-api/file.list | 1 - .../shader-effects/motion-blur-effect.cpp | 2 +- .../public-api/shader-effects/motion-blur-effect.h | 4 +- .../shader-effects/motion-stretch-effect.cpp | 2 +- .../shader-effects/motion-stretch-effect.h | 4 +- docs/content/main-page.h | 4 +- docs/content/programming-guide/constraints-intro.h | 32 - docs/content/programming-guide/constraints.h | 232 ++++ docs/content/programming-guide/script-howto.h | 101 -- docs/content/programming-guide/script-overview.h | 3 +- packaging/dali-toolkit.spec | 2 +- 55 files changed, 4284 insertions(+), 1041 deletions(-) create mode 100644 dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-project create mode 100644 dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-workspace create mode 100644 dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-project create mode 100644 dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-workspace create mode 100644 dali-toolkit/internal/controls/view/view-impl.cpp create mode 100644 dali-toolkit/internal/controls/view/view-impl.h delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h create mode 100644 dali-toolkit/public-api/controls/view/view.h delete mode 100644 docs/content/programming-guide/constraints-intro.h create mode 100644 docs/content/programming-guide/constraints.h delete mode 100644 docs/content/programming-guide/script-howto.h diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 498c40e..2578643 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -178,7 +178,6 @@ int UtcDaliToolkitTextLabelGetPropertyP(void) // Check label defaults are correct DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::TEXT_COLOR ), Color::WHITE, TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::UNDERLINE_ENABLED ), false, TEST_LOCATION ); diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp index 853c0ae..4a55e59 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp +++ b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDE #include #include +#include +#include #include namespace Dali @@ -41,6 +43,47 @@ namespace const uint32_t DOUBLE_PIXEL_PADDING( SINGLE_PIXEL_PADDING << 1 ); const uint32_t FILLED_PIXEL( -1 ); Toolkit::AtlasManager::AtlasSize EMPTY_SIZE; + + #define MAKE_SHADER(A)#A + + const char* VERTEX_SHADER = MAKE_SHADER( + attribute mediump vec2 aPosition; + attribute mediump vec2 aTexCoord; + uniform mediump mat4 uMvpMatrix; + uniform mediump vec3 uSize; + varying mediump vec2 vTexCoord; + + void main() + { + mediump vec4 position = vec4( aPosition, 0.0, 1.0 ); + position.xyz *= uSize; + gl_Position = uMvpMatrix * position; + vTexCoord = aTexCoord; + } + ); + + const char* FRAGMENT_SHADER_L8 = MAKE_SHADER( + uniform lowp vec4 uColor; + uniform sampler2D sTexture; + varying mediump vec2 vTexCoord; + + void main() + { + mediump vec4 color = texture2D( sTexture, vTexCoord ); + gl_FragColor = vec4( uColor.rgb, uColor.a * color.r ); + } + ); + + const char* FRAGMENT_SHADER_BGRA = MAKE_SHADER( + uniform sampler2D sTexture; + varying mediump vec2 vTexCoord; + + void main() + { + gl_FragColor = texture2D( sTexture, vTexCoord ); + } + ); + } AtlasManager::AtlasManager() @@ -87,11 +130,6 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa atlasDescriptor.mAtlas = atlas; atlasDescriptor.mSize = size; atlasDescriptor.mPixelFormat = pixelformat; - std::stringstream materialLabel; - materialLabel << "Atlas Material - "; - materialLabel << mAtlasList.size(); - atlasDescriptor.mMaterial = Material::New( materialLabel.str() ); - atlasDescriptor.mMaterial.SetDiffuseTexture( atlas ); atlasDescriptor.mNextFreeBlock = 1u; // indicate next free block will be the first ( +1 ) // What size do we need for this atlas' strip buffer ( assume 32bit pixel format )? @@ -110,6 +148,22 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasMa pixelformat ); atlasDescriptor.mFilledPixelImage = BufferImage::New( reinterpret_cast< PixelBuffer* >( &mFilledPixel ), 1, 1, pixelformat ); atlas.Upload( atlasDescriptor.mFilledPixelImage, 0, 0 ); + + Sampler sampler = Sampler::New( atlas, "sTexture" ); + sampler.SetFilterMode( Sampler::NEAREST, Sampler::NEAREST ); + sampler.SetProperty( Sampler::Property::AFFECTS_TRANSPARENCY, true ); + Shader shader; + if ( pixelformat == Pixel::BGRA8888 ) + { + shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_BGRA ); + } + else + { + shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_L8 ); + } + atlasDescriptor.mMaterial = Material::New( shader ); + atlasDescriptor.mMaterial.AddSampler( sampler ); + atlasDescriptor.mMaterial.SetBlendMode( BlendingMode::ON ); mAtlasList.push_back( atlasDescriptor ); return mAtlasList.size(); } @@ -169,7 +223,7 @@ void AtlasManager::Add( const BufferImage& image, if ( Toolkit::AtlasManager::FAIL_ON_ADD_FAILS == mAddFailPolicy || !foundAtlas-- ) { // Haven't found an atlas for this image!!!!!! - return; + return; } } @@ -265,16 +319,12 @@ void AtlasManager::CreateMesh( SizeType atlas, const Vector2& position, SizeType widthInBlocks, SizeType heightInBlocks, - Dali::MeshData& meshData, + Toolkit::AtlasManager::Mesh2D& mesh, AtlasSlotDescriptor& desc ) { - Dali::MeshData::Vertex vertex; - Dali::MeshData::VertexContainer vertices; - Dali::MeshData::FaceIndices faces; - Dali::MeshData::FaceIndex faceIndex = 0; - meshData.SetHasNormals( false ); - meshData.SetHasColor( true ); - meshData.SetHasTextureCoords( true ); + + Toolkit::AtlasManager::Vertex2D vertex; + uint32_t faceIndex = 0; // TODO change to unsigned short when property type is available SizeType blockWidth = mAtlasList[ atlas ].mSize.mBlockWidth; SizeType blockHeight = mAtlasList[ atlas ].mSize.mBlockHeight; @@ -354,49 +404,45 @@ void AtlasManager::CreateMesh( SizeType atlas, } // Top left - vertex.x = topLeft.x; - vertex.y = topLeft.y; - vertex.z = 0.0f; - vertex.u = fBlockX; - vertex.v = fBlockY; + vertex.mPosition.x = topLeft.x; + vertex.mPosition.y = topLeft.y; + vertex.mTexCoords.x = fBlockX; + vertex.mTexCoords.y = fBlockY; - vertices.push_back( vertex ); + mesh.mVertices.PushBack( vertex ); // Top Right - vertex.x = topLeft.x + ndcVWidth; - vertex.y = topLeft.y; - vertex.z = 0.0f; - vertex.u = fBlockX + ndcWidth; - vertex.v = fBlockY; + vertex.mPosition.x = topLeft.x + ndcVWidth; + vertex.mPosition.y = topLeft.y; + vertex.mTexCoords.x = fBlockX + ndcWidth; + vertex.mTexCoords.y = fBlockY; - vertices.push_back( vertex ); + mesh.mVertices.PushBack( vertex ); // Bottom Left - vertex.x = topLeft.x; - vertex.y = topLeft.y + ndcVHeight; - vertex.z = 0.0f; - vertex.u = fBlockX; - vertex.v = fBlockY + ndcHeight; + vertex.mPosition.x = topLeft.x; + vertex.mPosition.y = topLeft.y + ndcVHeight; + vertex.mTexCoords.x = fBlockX; + vertex.mTexCoords.y = fBlockY + ndcHeight; - vertices.push_back( vertex ); + mesh.mVertices.PushBack( vertex ); // Bottom Right topLeft.x += ndcVWidth; - vertex.x = topLeft.x; - vertex.y = topLeft.y + ndcVHeight; - vertex.z = 0.0f; - vertex.u = fBlockX + ndcWidth; - vertex.v = fBlockY + ndcHeight; + vertex.mPosition.x = topLeft.x; + vertex.mPosition.y = topLeft.y + ndcVHeight; + vertex.mTexCoords.x = fBlockX + ndcWidth; + vertex.mTexCoords.y = fBlockY + ndcHeight; - vertices.push_back( vertex ); + mesh.mVertices.PushBack( vertex ); // Six indices in counter clockwise winding - faces.push_back( faceIndex + 1u ); - faces.push_back( faceIndex ); - faces.push_back( faceIndex + 2u ); - faces.push_back( faceIndex + 2u ); - faces.push_back( faceIndex + 3u ); - faces.push_back( faceIndex + 1u ); + mesh.mIndices.PushBack( faceIndex + 1u ); + mesh.mIndices.PushBack( faceIndex ); + mesh.mIndices.PushBack( faceIndex + 2u ); + mesh.mIndices.PushBack( faceIndex + 2u ); + mesh.mIndices.PushBack( faceIndex + 3u ); + mesh.mIndices.PushBack( faceIndex + 1u ); faceIndex += 4; } @@ -408,62 +454,53 @@ void AtlasManager::CreateMesh( SizeType atlas, // If there's only one block then skip this next vertex optimisation if ( widthInBlocks * heightInBlocks > 1 ) { - Dali::MeshData::VertexContainer optimizedVertices; - OptimizeVertices( vertices, faces, optimizedVertices ); - meshData.SetVertices( optimizedVertices ); + Toolkit::AtlasManager::Mesh2D optimizedMesh; + OptimizeMesh( mesh, optimizedMesh ); } - else - { - meshData.SetVertices( vertices ); - } - - meshData.SetFaceIndices( faces ); - meshData.SetMaterial( mAtlasList[ atlas ].mMaterial ); + //PrintMeshData( mesh ); } -void AtlasManager::PrintMeshData( const MeshData& meshData ) +void AtlasManager::PrintMeshData( const Toolkit::AtlasManager::Mesh2D& mesh ) { - std::cout << "\nMesh Data for Image: VertexCount = " << meshData.GetVertexCount(); - std::cout << ", Triangles = " << meshData.GetFaceCount() << std::endl; - - Dali::MeshData::VertexContainer vertices = meshData.GetVertices(); - Dali::MeshData::FaceIndices faces = meshData.GetFaces(); + uint32_t vertexCount = mesh.mVertices.Size(); + uint32_t indexCount = mesh.mIndices.Size(); + std::cout << "\nMesh Data for Image: VertexCount = " << vertexCount; + std::cout << ", Triangles = " << indexCount / 3 << std::endl; - for ( SizeType v = 0; v < vertices.size(); ++v ) + for ( SizeType v = 0; v < vertexCount; ++v ) { - std::cout << " Vertex(" << v << ") x = " << vertices[v].x << ", "; - std::cout << "y = " << vertices[v].y << ", " << "z = " << vertices[v].z << ", "; - std::cout << "u = " << vertices[v].u << ", " << "v = " << vertices[v].v << std::endl; + std::cout << " Vertex(" << v << ") x = " << mesh.mVertices[v].mPosition.x << ", "; + std::cout << "y = " << mesh.mVertices[v].mPosition.y << ", "; + std::cout << "u = " << mesh.mVertices[v].mTexCoords.x << ", "; + std::cout << "v = " << mesh.mVertices[v].mTexCoords.y << std::endl; } std::cout << "\n Indices: "; - for ( SizeType i = 0; i < faces.size(); ++i ) + for ( SizeType i = 0; i < indexCount; ++i ) { - std::cout << " " << faces[ i ]; + std::cout << " " << mesh.mIndices[ i ]; } std::cout << std::endl; } -void AtlasManager::OptimizeVertices( const MeshData::VertexContainer& in, - MeshData::FaceIndices& faces, - MeshData::VertexContainer& out ) +void AtlasManager::OptimizeMesh( const Toolkit::AtlasManager::Mesh2D& in, + Toolkit::AtlasManager::Mesh2D& out ) { unsigned short vertexIndex = 0; // We could check to see if blocks are next to each other, but it's probably just as quick to compare verts - for ( SizeType i = 0; i < faces.size(); ++i ) + for ( SizeType i = 0; i < in.mIndices.Size(); ++i ) { // Fetch a vertex, has it already been assigned? bool foundVertex = false; - Dali::MeshData::Vertex v = in[ faces [ i ] ]; - for ( SizeType j = 0; j < vertexIndex; ++j ) + Toolkit::AtlasManager::Vertex2D v = in.mVertices[ in.mIndices[ i ] ]; + for ( SizeType j = 0; j < out.mVertices.Size(); ++j ) { - if ( v.x == out[ j ].x && v.y == out[ j ].y && v.z == out[ j ].z && - v.u == out[ j ].u && v.v == out[ j ].v && v.nX == out[ j ].nX && - v.nY == out[ j ].nY && v.nZ == out[ j ].nZ ) + if ( v.mPosition.x == out.mVertices[ j ].mPosition.x && v.mPosition.y == out.mVertices[ j ].mPosition.y && + v.mTexCoords.x == out.mVertices[ j ].mTexCoords.x && v.mTexCoords.y == out.mVertices[ j ].mTexCoords.y ) { // Yes, so store this down as the vertex to use - faces[ i ] = j; + out.mIndices.PushBack( j ); foundVertex = true; break; } @@ -472,103 +509,70 @@ void AtlasManager::OptimizeVertices( const MeshData::VertexContainer& in, // Did we find a vertex ? if ( !foundVertex ) { - // Add a new vertex - faces[ i ] = vertexIndex++; - out.push_back( v ); + // No so add a new one + out.mVertices.PushBack( v ); + vertexIndex++; } } } -void AtlasManager::StitchMesh( MeshData& first, - const MeshData& second, +void AtlasManager::StitchMesh( Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second, bool optimize ) { + uint32_t vc = first.mVertices.Size(); - // Would be much quicker to be able to get a non-const reference to these containers and update in situ - MeshData::VertexContainer v1 = first.GetVertices(); - MeshData::VertexContainer v2 = second.GetVertices(); - MeshData::FaceIndices f1 = first.GetFaces(); - MeshData::FaceIndices f2 = second.GetFaces(); - - uint32_t vc1 = first.GetVertexCount(); - uint32_t vc2 = second.GetVertexCount(); - - for ( uint32_t v = 0; v < vc2; ++v ) + for ( uint32_t v = 0; v < second.mVertices.Size(); ++v ) { - v1.push_back( v2[ v ] ); + first.mVertices.PushBack( second.mVertices[ v ] ); } - for ( uint32_t f = 0; f < f2.size(); ++f ) + for ( uint32_t i = 0; i < second.mIndices.Size(); ++i ) { - f1.push_back( f2[ f ] + vc1 ); + first.mIndices.PushBack( second.mIndices[ i ] + vc ); } if ( optimize ) { - MeshData::VertexContainer optimizedVertices; - OptimizeVertices( v1, f1, optimizedVertices ); - first.SetVertices( optimizedVertices ); + Toolkit::AtlasManager::Mesh2D optimizedMesh; + OptimizeMesh( first, optimizedMesh ); + first = optimizedMesh; } - else - { - first.SetVertices( v1 ); - } - - first.SetFaceIndices( f1 ); } -void AtlasManager::StitchMesh( const MeshData& first, - const MeshData& second, - MeshData& out, +void AtlasManager::StitchMesh( const Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second, + Toolkit::AtlasManager::Mesh2D& out, bool optimize ) { - MeshData::VertexContainer v1 = first.GetVertices(); - MeshData::VertexContainer v2 = second.GetVertices(); - MeshData::FaceIndices f1 = first.GetFaces(); - MeshData::FaceIndices f2 = second.GetFaces(); - - uint32_t vc1 = first.GetVertexCount(); - uint32_t vc2 = second.GetVertexCount(); - - MeshData::VertexContainer vertices; + uint32_t vc = first.mVertices.Size(); - MeshData::FaceIndices faces; - - MeshData::Vertex vertex; - - for ( uint32_t v = 0; v < vc1; ++v ) + for ( uint32_t v = 0; v < vc; ++v ) { - vertices.push_back( v1[ v ] ); + out.mVertices.PushBack( first.mVertices[ v ] ); } - for ( uint32_t v = 0; v < vc2; ++v ) + for ( uint32_t v = 0; v < second.mVertices.Size(); ++v ) { - vertices.push_back( v2[ v ] ); + out.mVertices.PushBack( second.mVertices[ v ] ); } - for ( uint32_t f = 0; f < f1.size(); ++f ) + for ( uint32_t i = 0; i < first.mIndices.Size(); ++i ) { - faces.push_back( f1[ f ] ); + out.mIndices.PushBack( first.mIndices[ i ] ); } - for ( uint32_t f = 0; f < f2.size(); ++f ) + for ( uint32_t i = 0; i < second.mIndices.Size(); ++i ) { - faces.push_back( f2[ f ] + vc1 ); + out.mIndices.PushBack( second.mIndices[ i ] + vc ); } if ( optimize ) { - MeshData::VertexContainer optimizedVertices; - OptimizeVertices( vertices, faces, optimizedVertices ); - out.SetVertices( optimizedVertices ); - } - else - { - out.SetVertices( vertices ); + Toolkit::AtlasManager::Mesh2D optimizedMesh; + OptimizeMesh( out, optimizedMesh ); + out = optimizedMesh; } - - out.SetMaterial( first.GetMaterial() ); - out.SetFaceIndices( faces ); } void AtlasManager::UploadImage( const BufferImage& image, @@ -651,7 +655,7 @@ void AtlasManager::UploadImage( const BufferImage& image, void AtlasManager::GenerateMeshData( ImageId id, const Vector2& position, - MeshData& meshData ) + Toolkit::AtlasManager::Mesh2D& meshData ) { // Read the atlas Id to use for this image SizeType imageId = id - 1u; @@ -826,6 +830,15 @@ void AtlasManager::GetMetrics( Toolkit::AtlasManager::Metrics& metrics ) metrics.mTextureMemoryUsed = textureMemoryUsed; } +Material AtlasManager::GetMaterial( AtlasId atlas ) const +{ + if ( atlas && atlas <= mAtlasList.size() ) + { + return mAtlasList[ atlas -1u ].mMaterial; + } + Material null; + return null; +} } // namespace Internal diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h index ef078f8..02a2e7d 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h +++ b/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h @@ -111,21 +111,22 @@ public: */ void GenerateMeshData( ImageId id, const Vector2& position, - MeshData& mesh ); + Toolkit::AtlasManager::Mesh2D& mesh ); /** * @copydoc Toolkit::AtlasManager::StitchMesh */ - void StitchMesh( MeshData& first, - const MeshData& second, + void StitchMesh( Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second, bool optimize ); /** * @copydoc Toolkit::AtlasManager::StitchMesh */ - void StitchMesh( const MeshData& first, - const MeshData& second, - MeshData& out, bool optimize ); + void StitchMesh( const Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second, + Toolkit::AtlasManager::Mesh2D& out, + bool optimize ); /** * @copydoc Toolkit::AtlasManager::Remove @@ -177,6 +178,11 @@ public: */ void GetMetrics( Toolkit::AtlasManager::Metrics& metrics ); + /** + * @copydoc Toolkit::AtlasManager::GetMaterial + */ + Material GetMaterial( AtlasId atlas ) const; + private: std::vector< AtlasDescriptor > mAtlasList; // List of atlases created @@ -195,17 +201,16 @@ private: const Vector2& position, SizeType widthInBlocks, SizeType heightInBlocks, - Dali::MeshData& meshData, + Toolkit::AtlasManager::Mesh2D& mesh, AtlasSlotDescriptor& desc ); - void OptimizeVertices( const MeshData::VertexContainer& in, - MeshData::FaceIndices& faces, - MeshData::VertexContainer& out ); + void OptimizeMesh( const Toolkit::AtlasManager::Mesh2D& in, + Toolkit::AtlasManager::Mesh2D& out ); void UploadImage( const BufferImage& image, const AtlasSlotDescriptor& desc ); - void PrintMeshData( const MeshData& meshData ); + void PrintMeshData( const Toolkit::AtlasManager::Mesh2D& mesh ); Toolkit::AtlasManager::AtlasSize mNewAtlasSize; Toolkit::AtlasManager::AddFailPolicy mAddFailPolicy; diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager.cpp b/dali-toolkit/internal/atlas-manager/atlas-manager.cpp index e46eb1d..61c46f5 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager.cpp +++ b/dali-toolkit/internal/atlas-manager/atlas-manager.cpp @@ -69,23 +69,23 @@ bool AtlasManager::Remove( ImageId id ) void AtlasManager::GenerateMeshData( ImageId id, const Vector2& position, - MeshData& meshData) + Mesh2D& mesh ) { GetImplementation(*this).GenerateMeshData( id, position, - meshData ); + mesh ); } -void AtlasManager::StitchMesh( MeshData& first, - const MeshData& second, +void AtlasManager::StitchMesh( Mesh2D& first, + const Mesh2D& second, bool optimize ) { GetImplementation(*this).StitchMesh( first, second, optimize ); } -void AtlasManager::StitchMesh( const MeshData& first, - const MeshData& second, - MeshData& out, +void AtlasManager::StitchMesh( const Mesh2D& first, + const Mesh2D& second, + Mesh2D& out, bool optimize ) { GetImplementation(*this).StitchMesh( first, second, out, optimize ); @@ -128,7 +128,12 @@ Pixel::Format AtlasManager::GetPixelFormat( AtlasId atlas ) void AtlasManager::GetMetrics( Metrics& metrics ) { - return GetImplementation(*this).GetMetrics( metrics ); + GetImplementation(*this).GetMetrics( metrics ); +} + +Material AtlasManager::GetMaterial( AtlasId atlas ) const +{ + return GetImplementation(*this).GetMaterial( atlas ); } } // namespace Toolkit diff --git a/dali-toolkit/internal/atlas-manager/atlas-manager.h b/dali-toolkit/internal/atlas-manager/atlas-manager.h index 5fc10d0..6f654ff 100644 --- a/dali-toolkit/internal/atlas-manager/atlas-manager.h +++ b/dali-toolkit/internal/atlas-manager/atlas-manager.h @@ -20,9 +20,9 @@ // EXTERNAL INCLUDES #include #include -#include #include #include +#include namespace Dali { @@ -187,6 +187,18 @@ public: Dali::Vector< AtlasMetricsEntry > mAtlasMetrics; // container of atlas information }; + struct Vertex2D + { + Vector2 mPosition; + Vector2 mTexCoords; + }; + + struct Mesh2D + { + Vector< Vertex2D > mVertices; + Vector< unsigned short> mIndices; + }; + /** * Create an AtlasManager handle; this can be initialised with AtlasManager::New() * Calling member functions with an uninitialised handle is not allowed. @@ -277,7 +289,7 @@ public: */ void GenerateMeshData( ImageId id, const Vector2& position, - MeshData& mesh ); + Mesh2D& mesh ); /** * @brief Append second mesh to the first mesh @@ -286,8 +298,8 @@ public: * @param[in] second Second mesh * @param[in] optimize should we optimize vertex data */ - void StitchMesh( MeshData& first, - const MeshData& second, + void StitchMesh( Mesh2D& first, + const Mesh2D& second, bool optimize = false ); /** @@ -298,9 +310,9 @@ public: * @param[in] optimize should we optimize vertex data * @param[out] out resulting mesh */ - void StitchMesh( const MeshData& first, - const MeshData& second, - MeshData& out, + void StitchMesh( const Mesh2D& first, + const Mesh2D& second, + Mesh2D& out, bool optimize = false ); /** @@ -370,6 +382,15 @@ public: */ void GetMetrics( Metrics& metrics ); + /** + * @brief Get Material used by atlas + * + * @param atlas[in] atlas AtlasId + * + * @return Material used by atlas + */ + Material GetMaterial( AtlasId atlas ) const; + private: explicit DALI_INTERNAL AtlasManager(Internal::AtlasManager *impl); diff --git a/dali-toolkit/internal/builder/builder-animations.cpp b/dali-toolkit/internal/builder/builder-animations.cpp index 6caf392..12a87c5 100644 --- a/dali-toolkit/internal/builder/builder-animations.cpp +++ b/dali-toolkit/internal/builder/builder-animations.cpp @@ -17,7 +17,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include // INTERNAL INCLUDES @@ -229,13 +229,13 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D // to allow animating shader uniforms if( propIndex == Property::INVALID_INDEX ) { - RenderableActor renderable = RenderableActor::DownCast( targetHandle ); - if( renderable ) + ImageActor imageActor = ImageActor::DownCast( targetHandle ); + if( imageActor ) { // A limitation here is that its possible that between creation of animation // and running it the ShaderEffect of the actor has been changed. // However this is a unlikely use case especially when using scripts. - if( ShaderEffect effect = renderable.GetShaderEffect() ) + if( ShaderEffect effect = imageActor.GetShaderEffect() ) { propIndex = effect.GetPropertyIndex( *property ); if(propIndex != Property::INVALID_INDEX) diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index be1993c..a6c74b0 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -278,7 +278,7 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace // special field 'effect' references the shader effect instances if(key == "effect") { - RenderableActor actor = RenderableActor::DownCast(handle); + ImageActor actor = ImageActor::DownCast(handle); if( actor ) { OptionalString str = constant.IsString( keyChild.second ); @@ -302,7 +302,7 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace if( Property::INVALID_INDEX == index ) { - RenderableActor actor = RenderableActor::DownCast(handle); + ImageActor actor = ImageActor::DownCast(handle); if( actor ) { if( ShaderEffect effect = actor.GetShaderEffect() ) diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h index 3ae36a1..6cac58b 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h @@ -21,10 +21,8 @@ // EXTERNAL INCLUDES #include #include -#include #include #include -#include #include // INTERNAL INCLUDES diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index 5ea5753..7225beb 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -20,9 +20,7 @@ // EXTERNAL INCLUDES #include -#include #include -#include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-project b/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-project new file mode 100644 index 0000000..d4bef92 --- /dev/null +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "/homeSERILOCALr.underhill/dev/new" + } + ] +} diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-workspace b/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-workspace new file mode 100644 index 0000000..ed39525 --- /dev/null +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-workspace @@ -0,0 +1,1282 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "Set", + "SetBlendMode" + ], + [ + "STYLE_", + "STYLE_DROP_SHADOW" + ], + [ + "nom", + "normIndices" + ], + [ + "norm", + "normVerts" + ], + [ + "nomr", + "normVerts" + ], + [ + "shadow", + "shadowOffset" + ], + [ + "mesh", + "meshRecord" + ], + [ + "Text", + "TextLabel" + ], + [ + "FRAGMENT_SHADER_", + "FRAGMENT_SHADER_BGRA" + ], + [ + "complete", + "completeCount" + ], + [ + "mV", + "mVertices" + ], + [ + "print", + "PrintMeshData" + ], + [ + "vetex", + "vertexBuffer" + ], + [ + "inde", + "indexBuffer" + ], + [ + "ind", + "indexCount" + ], + [ + "ver", + "vertexBuffer" + ], + [ + "quad", + "quadData" + ], + [ + "qua", + "quadData" + ], + [ + "q", + "quadData" + ], + [ + "C", + "Count" + ], + [ + "gl", + "gl_FragColor" + ], + [ + "mAtlas", + "mAtlasId" + ], + [ + "mAtl", + "mAtlasId" + ], + [ + "texturedQuad", + "texturedQuadGeometry" + ], + [ + "Mesh", + "MeshRecord" + ], + [ + "Atlas", + "AtlasGlyphManager" + ], + [ + "Property", + "PropertyBuffer" + ], + [ + "atlas", + "atlasDescriptor" + ], + [ + "op", + "optimizedMesh" + ], + [ + "vertex", + "vertexCount" + ], + [ + "Atl", + "AtlasSlotDescriptor" + ], + [ + "he", + "heightInBlocks" + ], + [ + "wid", + "widthInBlocks" + ], + [ + "imag", + "imageHeight" + ], + [ + "image", + "imageWidth" + ] + ] + }, + "buffers": + [ + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "settings": + { + "buffer_size": 13752, + "line_ending": "Unix" + } + }, + { + "file": "scroll-overshoot-indicator-impl.h", + "settings": + { + "buffer_size": 8339, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp", + "settings": + { + "buffer_size": 33180, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-field-impl.h", + "settings": + { + "buffer_size": 6419, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.h", + "settings": + { + "buffer_size": 3898, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "settings": + { + "buffer_size": 16273, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.cpp", + "settings": + { + "buffer_size": 29679, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.h", + "settings": + { + "buffer_size": 21305, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control.h", + "settings": + { + "buffer_size": 13810, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/file.list", + "settings": + { + "buffer_size": 14166, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/file.list", + "settings": + { + "buffer_size": 6651, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/view/view-impl.cpp", + "settings": + { + "buffer_size": 9817, + "line_ending": "Unix" + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/dali-toolkit.h", + "settings": + { + "buffer_size": 7449, + "line_ending": "Unix" + } + }, + { + "contents": "Searching 483 files for \"controlbehaviour\"\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/alignment/alignment-impl.cpp:\n 549 \n 550 Alignment::Alignment( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical )\n 551: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 552 mHorizontal( horizontal ),\n 553 mVertical( vertical ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp:\n 127 \n 128 BloomView::BloomView()\n 129: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )\n 130 , mBlurNumSamples(BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_NUM_SAMPLES)\n 131 , mBlurBellCurveWidth(BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_BELL_CURVE_WIDTH)\n ...\n 149 BloomView::BloomView( const unsigned int blurNumSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat,\n 150 const float downsampleWidthScale, const float downsampleHeightScale)\n 151: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )\n 152 , mBlurNumSamples(blurNumSamples)\n 153 , mBlurBellCurveWidth(blurBellCurveWidth)\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp:\n 40 unsigned int maximumNumberOfBubble,\n 41 const Vector2& bubbleSizeRange )\n 42: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),\n 43 mMovementArea( movementArea ),\n 44 mShapeImage( shapeImage ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp.orig:\n 40 unsigned int maximumNumberOfBubble,\n 41 const Vector2& bubbleSizeRange )\n 42: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),\n 43 mMovementArea( movementArea ),\n 44 mShapeImage( shapeImage ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/buttons/button-impl.cpp:\n 101 \n 102 Button::Button()\n 103: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 104 mAutoRepeatingTimer(),\n 105 mDisabled( false ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp:\n 113 \n 114 EffectsView::EffectsView()\n 115: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 116 mEffectType( Toolkit::EffectsView::INVALID_TYPE ),\n 117 mPixelFormat( EFFECTS_VIEW_DEFAULT_PIXEL_FORMAT ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp:\n 117 \n 118 GaussianBlurView::GaussianBlurView()\n 119: : Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) )\n 120 , mNumSamples(GAUSSIAN_BLUR_VIEW_DEFAULT_NUM_SAMPLES)\n 121 , mBlurBellCurveWidth( 0.001f )\n ...\n 139 const float downsampleWidthScale, const float downsampleHeightScale,\n 140 bool blurUserImage)\n 141: : Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) )\n 142 , mNumSamples(numSamples)\n 143 , mBlurBellCurveWidth( 0.001f )\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp:\n 476 \n 477 MaskedImageView::MaskedImageView()\n 478: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 479 mEditMode( Dali::Toolkit::MaskedImageView::EDIT_DISABLED ),\n 480 mSelfPropertySetting( false ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp:\n 124 \n 125 Magnifier::Magnifier()\n 126: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),\n 127 mPropertySourcePosition(Property::INVALID_INDEX),\n 128 mDefaultCameraDistance(1000.f),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp:\n 61 \n 62 NavigationControl::NavigationControl()\n 63: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),\n 64 mToolBar(NULL),\n 65 mTitleBar(NULL),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp:\n 48 \n 49 Page::Page()\n 50: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 51 mTitle(\"\"),\n 52 mSubTitle(\"\")\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp:\n 260 \n 261 PageTurnView::PageTurnView( PageFactory& pageFactory, const Vector2& pageSize )\n 262: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),\n 263 mPageFactory( pageFactory ),\n 264 mPageSize( pageSize ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/popup/popup-impl.cpp:\n 105 \n 106 Popup::Popup(PopupStyle& style)\n 107: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 108 mShowing(false),\n 109 mState(Toolkit::Popup::POPUP_NONE), // Initially, the popup state should not be set, it's set in OnInitialize\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp:\n 293 \n 294 ItemView::ItemView(ItemFactory& factory)\n 295: : Scrollable( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | REQUIRES_MOUSE_WHEEL_EVENTS | REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),\n 296 mItemFactory(factory),\n 297 mActiveLayout(NULL),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp:\n 41 }\n 42 \n 43: ScrollBase::ScrollBase( ControlBehaviour behaviourFlags )\n 44 : Scrollable( behaviourFlags ),\n 45 mParent(NULL),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h:\n 197 * @param[in] behaviourFlags Flags to enable\n 198 */\n 199: ScrollBase( ControlBehaviour behaviourFlags );\n 200 \n 201 protected:\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp:\n 535 \n 536 ScrollView::ScrollView()\n 537: : ScrollBase( ControlBehaviour( REQUIRES_MOUSE_WHEEL_EVENTS ) ), // Enable size negotiation\n 538 mTouchDownTime(0u),\n 539 mGestureStackDepth(0),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp:\n 76 // we dont want size negotiation while scrolling if we can avoid it\n 77 Scrollable::Scrollable()\n 78: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | DISABLE_SIZE_NEGOTIATION ) ),\n 79 mOvershootEffectColor( DEFAULT_OVERSHOOT_COLOUR ),\n 80 mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),\n ..\n 83 }\n 84 \n 85: Scrollable::Scrollable( ControlBehaviour behaviourFlags )\n 86: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | behaviourFlags ) ),\n 87 mOvershootEffectColor( DEFAULT_OVERSHOOT_COLOUR ),\n 88 mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scrollable-impl.h:\n 187 * @param[in] behaviourFlags Flags to enable\n 188 */\n 189: Scrollable( ControlBehaviour behaviourFlags );\n 190 \n 191 /**\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp:\n 109 \n 110 ShadowView::ShadowView( float downsampleWidthScale, float downsampleHeightScale )\n 111: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 112 mChildrenRoot(Actor::New()),\n 113 mCachedShadowColor(DEFAULT_SHADOW_COLOR),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/slider/slider-impl.cpp:\n 148 \n 149 Slider::Slider()\n 150: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 151 mState( NORMAL ),\n 152 mDisableColor( 0.0f, 0.0f, 0.0f, 0.0f ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp:\n 105 \n 106 SuperBlurView::SuperBlurView( unsigned int blurLevels )\n 107: : Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) ),\n 108 mBlurLevels( blurLevels ),\n 109 mBlurStrengthPropertyIndex(Property::INVALID_INDEX),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/table-view/table-view-impl.cpp:\n 941 \n 942 TableView::TableView( unsigned int initialRows, unsigned int initialColumns )\n 943: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 944 mCellData( initialRows, initialColumns ),\n 945 mLayoutingChild( false ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp:\n 1007 \n 1008 TextField::TextField()\n 1009: : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 1010 mRenderingBackend( DEFAULT_RENDERING_BACKEND ),\n 1011 mExceedPolicy( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP )\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp:\n 488 \n 489 TextLabel::TextLabel()\n 490: : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),\n 491 mRenderingBackend( DEFAULT_RENDERING_BACKEND )\n 492 {\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp:\n 589 \n 590 TextSelectionPopup::TextSelectionPopup()\n 591: : Control( ControlBehaviour( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ) ),\n 592 mMaxSize ( DEFAULT_POPUP_MAX_SIZE ),\n 593 mVisiblePopUpSize( DEFAULT_POPUP_MAX_SIZE ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp:\n 297 \n 298 ToolBar::ToolBar()\n 299: : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 300 mLayout(),\n 301 mLeftOffset( 0 ),\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.cpp:\n 196 mCurrentSize(),\n 197 mNaturalSize(),\n 198: mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 199 mIsKeyboardNavigationSupported( false ),\n 200 mIsKeyboardFocusGroup( false ),\n ...\n 394 Vector3 mNaturalSize; ///< Stores the size set through the Actor's API. This is size the actor wants to be. Useful when reset to the initial size is needed.\n 395 \n 396: ControlBehaviour mFlags :CONTROL_BEHAVIOUR_FLAG_COUNT; ///< Flags passed in from constructor.\n 397 bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control.\n 398 bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group.\n ...\n 415 {\n 416 // Create the implementation, temporarily owned on stack\n 417: IntrusivePtr controlImpl = new Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) );\n 418 \n 419 // Pass ownership to handle\n ...\n 781 }\n 782 \n 783: Control::Control( ControlBehaviour behaviourFlags )\n 784 : CustomActorImpl( static_cast< ActorFlags >( behaviourFlags ) ),\n 785 mImpl(new Impl(*this))\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.cpp.orig:\n 170 mCurrentSize(),\n 171 mNaturalSize(),\n 172: mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),\n 173 mIsKeyboardNavigationSupported( false ),\n 174 mIsKeyboardFocusGroup( false ),\n ...\n 368 Vector3 mNaturalSize; ///< Stores the size set through the Actor's API. This is size the actor wants to be. Useful when reset to the initial size is needed.\n 369 \n 370: ControlBehaviour mFlags :CONTROL_BEHAVIOUR_FLAG_COUNT; ///< Flags passed in from constructor.\n 371 bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control.\n 372 bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group.\n ...\n 389 {\n 390 // Create the implementation, temporarily owned on stack\n 391: IntrusivePtr controlImpl = new Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) );\n 392 \n 393 // Pass ownership to handle\n ...\n 754 }\n 755 \n 756: Control::Control( ControlBehaviour behaviourFlags )\n 757 : CustomActorImpl( static_cast< ActorFlags >( behaviourFlags ) ),\n 758 mImpl(new Impl(*this))\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.h:\n 357 \n 358 // Flags for the constructor\n 359: enum ControlBehaviour\n 360 {\n 361 REQUIRES_STYLE_CHANGE_SIGNALS = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ), ///< True if needs to monitor style change signals such as theme/font change\n ...\n 370 * @brief Create a Control.\n 371 *\n 372: * @param[in] behaviourFlags Behavioural flags from ControlBehaviour enum\n 373 */\n 374: Control(ControlBehaviour behaviourFlags);\n 375 \n 376 /**\n\n/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/scrollable/scroll-component-impl.cpp:\n 59 \n 60 ScrollComponentImpl::ScrollComponentImpl()\n 61: : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) )\n 62 {\n 63 }\n\n44 matches across 31 files\n", + "settings": + { + "buffer_size": 13597, + "line_ending": "Unix", + "name": "Find Results", + "scratch": true + } + }, + { + "file": "/homeSERILOCALr.underhill/dev/new/dali-demo/demo/dali-demo.cpp", + "settings": + { + "buffer_size": 3296, + "line_ending": "Unix" + } + } + ], + "build_system": "", + "build_system_choices": + [ + ], + "build_varint": "", + "command_palette": + { + "height": 375.0, + "last_filter": "Package Control: ", + "selected_items": + [ + [ + "Package Control: ", + "Package Control: Install Package" + ], + [ + "Package Cont", + "Package Control: Install Package" + ] + ], + "width": 462.0 + }, + "console": + { + "height": 0.0, + "history": + [ + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + "/homeSERILOCALr.underhill/dev/new", + "/homeSERILOCALr.underhill/dev/new/dali-demo", + "/homeSERILOCALr.underhill/dev/new/dali-demo/demo", + "/homeSERILOCALr.underhill/dev/new/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new/dali-demo/examples/atlas", + "/homeSERILOCALr.underhill/dev/new/dali-demo/shared", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-view", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/view", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls" + ], + "file_history": + [ + "/homeSERILOCALr.underhill/dev/new/dali-demo/shared/view.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/public-api/controls/control-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/file.list", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder/builder-impl.cpp", + "/homeSERILOCALr.underhill/dev/clash/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/dali/public-api/animation/alpha-function.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/dali/internal/event/animation/animation-impl.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/automated-tests/src/dali/utc-Dali-AlphaFunction.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-signals.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/public-api/file.list", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/decorator/text-decorator.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/text-view.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/shader-effects/material.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/shader-effects/sampler.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/shader-effects/shader.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-impl.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/public-api/builder/builder.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h", + "/homeSERILOCALr.underhill/dev/apr28/dali-demo/build/tizen/examples/out", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/effects/scene-graph-material.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/demo/dali-table-view.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/shared/view.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/file.list", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/actors/renderer.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/object/property-buffer.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/geometry/geometry.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/geometry/scene-graph-geometry.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-label-multi-language/text-label-multi-language-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-label/text-label-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-label-emojis/text-label-emojis.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/point-mesh/point-mesh-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/resources/complete-status-manager.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/node-attachments/scene-graph-renderer-attachment.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/event/images/atlas-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/mesh-morph/mesh-morph-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/atlas/atlas-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-view/text-view-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/size-negotiation/size-negotiation-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/scroll-view/scroll-view-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/motion-stretch/motion-stretch-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/motion-blur/motion-blur-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/logging/logging-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/item-view/item-view-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/dissolve-effect/dissolve-effect-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/cube-transition-effect/cube-transition-effect-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/cluster/cluster-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/buttons/buttons-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/builder/examples.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/blocks/blocks-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/textured-mesh/textured-mesh-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/docs/generated/html/font_8h_source.html", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/build/tizen/dali-toolkit/Makefile.in", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/User/Preferences.sublime-settings", + "/homeSERILOCALr.underhill/dev/test/dali-core/dali/public-api/object/any.h", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/User/trailing_spaces.sublime-settings", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/User/Default (Linux).sublime-keymap", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/TrailingSpaces/trailing_spaces.sublime-settings", + "/homeSERILOCALr.underhill/.scripts/nmgrab", + "/homeSERILOCALr.underhill/dev/test/dali-core/dali/public-api/object/any.cpp", + "/homeSERILOCALr.underhill/.ssh/id_rsa.pub", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/Package Control/Package Control.sublime-settings" + ], + "find": + { + "height": 37.0 + }, + "find_in_files": + { + "height": 95.0, + "where_history": + [ + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/mesh-merge/", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/demo", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core", + "/homeSERILOCALr.underhill/dev/new_mesh", + "/homeSERILOCALr.underhill/dev/check/dali-toolkit", + "/homeSERILOCALr.underhill/dev/check/dali-adaptor", + "/homeSERILOCALr.underhill/dev/check/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit" + ] + }, + "find_state": + { + "case_sensitive": false, + "find_history": + [ + "controlbehaviour", + "CONTROL_BEHAVIOUR", + "view", + "style_na", + "setsty", + "scrollovershooteffectr", + "EaseOutQuint50", + "alphafunction", + "alphafunctions", + "alphafunction", + "stage.add", + "mrenderable", + "mrenderableactor", + "blend", + "textab", + "invalid write", + "atlas", + "textabstraction", + "text", + "uniformmap", + "setsortmodifier", + "fragment_shader_b", + "mface", + "blendfunc", + "blendingfunc", + "blendingmode", + "blend", + "mface", + "createme", + "createmes", + "remove", + "index", + "createmes", + "texturedq", + "createmes", + "createmeshac", + "createmesh", + "createmes", + "createan", + "createanim", + "CreateAni", + "createani", + "createanimation", + "CreateBouncingEffect", + "createbou", + "setrelayout", + "setresizepolicy", + "SetResizePolicy", + "TextView", + "textview", + "font", + "font_parameters", + "default_font_parameters", + "default_font", + "defaul", + "DEFAULT_FONT_PARAMETERS", + "default_font_parameters", + "default_font_paramters", + "defaultfontparameter", + "filterscript", + "text-view", + "text-label", + "text-view", + "text-view.cpp", + "text-view", + "public-api/controls/text-view/", + "text-view", + "textview", + "textvie", + "text-view", + "fragment", + "optimize", + "optimizemesh", + "mesh" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": false, + "replace_history": + [ + "TextLabel" + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 12, + "sheets": + [ + { + "buffer": 0, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 13752, + "regions": + { + }, + "selection": + [ + [ + 8968, + 8968 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 3705.0, + "zoom_level": 1.0 + }, + "stack_index": 14, + "type": "text" + }, + { + "buffer": 1, + "file": "scroll-overshoot-indicator-impl.h", + "semi_transient": false, + "settings": + { + "buffer_size": 8339, + "regions": + { + }, + "selection": + [ + [ + 7228, + 7228 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": -0.0, + "translation.y": 2940.0, + "zoom_level": 1.0 + }, + "stack_index": 13, + "type": "text" + }, + { + "buffer": 2, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 33180, + "regions": + { + }, + "selection": + [ + [ + 27892, + 27892 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 11715.0, + "zoom_level": 1.0 + }, + "stack_index": 12, + "type": "text" + }, + { + "buffer": 3, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-field-impl.h", + "semi_transient": false, + "settings": + { + "buffer_size": 6419, + "regions": + { + }, + "selection": + [ + [ + 5679, + 5679 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": -0.0, + "translation.y": 2475.0, + "zoom_level": 1.0 + }, + "stack_index": 11, + "type": "text" + }, + { + "buffer": 4, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.h", + "semi_transient": false, + "settings": + { + "buffer_size": 3898, + "regions": + { + }, + "selection": + [ + [ + 3179, + 3179 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": -0.0, + "translation.y": 1290.0, + "zoom_level": 1.0 + }, + "stack_index": 10, + "type": "text" + }, + { + "buffer": 5, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 16273, + "regions": + { + }, + "selection": + [ + [ + 15457, + 15457 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 6390.0, + "zoom_level": 1.0 + }, + "stack_index": 9, + "type": "text" + }, + { + "buffer": 6, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 29679, + "regions": + { + }, + "selection": + [ + [ + 9233, + 9233 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 3459.0, + "zoom_level": 1.0 + }, + "stack_index": 3, + "type": "text" + }, + { + "buffer": 7, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control-impl.h", + "semi_transient": false, + "settings": + { + "buffer_size": 21305, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1440.0, + "zoom_level": 1.0 + }, + "stack_index": 4, + "type": "text" + }, + { + "buffer": 8, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/controls/control.h", + "semi_transient": false, + "settings": + { + "buffer_size": 13810, + "regions": + { + }, + "selection": + [ + [ + 12233, + 12233 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1646.0, + "zoom_level": 1.0 + }, + "stack_index": 5, + "type": "text" + }, + { + "buffer": 9, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/public-api/file.list", + "semi_transient": false, + "settings": + { + "buffer_size": 14166, + "regions": + { + }, + "selection": + [ + [ + 10429, + 10429 + ] + ], + "settings": + { + "syntax": "Packages/Text/Plain text.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 2490.0, + "zoom_level": 1.0 + }, + "stack_index": 7, + "type": "text" + }, + { + "buffer": 10, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/file.list", + "semi_transient": false, + "settings": + { + "buffer_size": 6651, + "regions": + { + }, + "selection": + [ + [ + 5037, + 5037 + ] + ], + "settings": + { + "syntax": "Packages/Text/Plain text.tmLanguage", + "tab_size": 3, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 495.0, + "zoom_level": 1.0 + }, + "stack_index": 6, + "type": "text" + }, + { + "buffer": 11, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/view/view-impl.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 9817, + "regions": + { + }, + "selection": + [ + [ + 8636, + 8636 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 3915.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + }, + { + "buffer": 12, + "file": "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/dali-toolkit.h", + "semi_transient": true, + "settings": + { + "buffer_size": 7449, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage" + }, + "translation.x": -0.0, + "translation.y": 765.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + }, + { + "buffer": 13, + "semi_transient": false, + "settings": + { + "buffer_size": 13597, + "regions": + { + "match": + { + "flags": 112, + "regions": + [ + [ + 280, + 296 + ], + [ + 561, + 577 + ], + [ + 1043, + 1059 + ], + [ + 1459, + 1475 + ], + [ + 1864, + 1880 + ], + [ + 2139, + 2155 + ], + [ + 2452, + 2468 + ], + [ + 2815, + 2831 + ], + [ + 3167, + 3183 + ], + [ + 3476, + 3492 + ], + [ + 3827, + 3843 + ], + [ + 4169, + 4185 + ], + [ + 4422, + 4438 + ], + [ + 4742, + 4758 + ], + [ + 5023, + 5039 + ], + [ + 5442, + 5458 + ], + [ + 5793, + 5809 + ], + [ + 6100, + 6116 + ], + [ + 6346, + 6362 + ], + [ + 6723, + 6739 + ], + [ + 7015, + 7031 + ], + [ + 7067, + 7083 + ], + [ + 7492, + 7508 + ], + [ + 7776, + 7792 + ], + [ + 8062, + 8078 + ], + [ + 8426, + 8442 + ], + [ + 8794, + 8810 + ], + [ + 9127, + 9143 + ], + [ + 9478, + 9494 + ], + [ + 9794, + 9810 + ], + [ + 9812, + 9828 + ], + [ + 10117, + 10133 + ], + [ + 10389, + 10405 + ], + [ + 10717, + 10733 + ], + [ + 11172, + 11188 + ], + [ + 11309, + 11325 + ], + [ + 11634, + 11650 + ], + [ + 11962, + 11978 + ], + [ + 12417, + 12433 + ], + [ + 12554, + 12570 + ], + [ + 12850, + 12866 + ], + [ + 13173, + 13189 + ], + [ + 13225, + 13241 + ], + [ + 13475, + 13491 + ] + ], + "scope": "" + } + }, + "selection": + [ + [ + 280, + 320 + ] + ], + "settings": + { + "detect_indentation": false, + "line_numbers": false, + "output_tag": 1, + "result_base_dir": "", + "result_file_regex": "^([A-Za-z\\\\/<].*):$", + "result_line_regex": "^ +([0-9]+):", + "scroll_past_end": true, + "syntax": "Packages/Default/Find Results.hidden-tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 2, + "type": "text" + }, + { + "buffer": 14, + "file": "/homeSERILOCALr.underhill/dev/new/dali-demo/demo/dali-demo.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 3296, + "regions": + { + }, + "selection": + [ + [ + 984, + 984 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 8, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 23.0 + }, + "input": + { + "height": 0.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "output.find_results": + { + "height": 0.0 + }, + "pinned_build_system": "", + "project": "merge.sublime-project", + "replace": + { + "height": 42.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "last_filter": "", + "selected_items": + [ + [ + "", + "~/dev/newmesh.sublime-project" + ] + ], + "width": 380.0 + }, + "select_symbol": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "selected_group": 0, + "settings": + { + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 503.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-project b/dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-project new file mode 100644 index 0000000..79164c3 --- /dev/null +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "/homeSERILOCALr.underhill/dev/tizen" + } + ] +} diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-workspace b/dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-workspace new file mode 100644 index 0000000..a7478df --- /dev/null +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/tizen.sublime-workspace @@ -0,0 +1,545 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "Set", + "SetBlendMode" + ], + [ + "STYLE_", + "STYLE_DROP_SHADOW" + ], + [ + "nom", + "normIndices" + ], + [ + "norm", + "normVerts" + ], + [ + "nomr", + "normVerts" + ], + [ + "shadow", + "shadowOffset" + ], + [ + "mesh", + "meshRecord" + ], + [ + "Text", + "TextLabel" + ], + [ + "FRAGMENT_SHADER_", + "FRAGMENT_SHADER_BGRA" + ], + [ + "complete", + "completeCount" + ], + [ + "mV", + "mVertices" + ], + [ + "print", + "PrintMeshData" + ], + [ + "vetex", + "vertexBuffer" + ], + [ + "inde", + "indexBuffer" + ], + [ + "ind", + "indexCount" + ], + [ + "ver", + "vertexBuffer" + ], + [ + "quad", + "quadData" + ], + [ + "qua", + "quadData" + ], + [ + "q", + "quadData" + ], + [ + "C", + "Count" + ], + [ + "gl", + "gl_FragColor" + ], + [ + "mAtlas", + "mAtlasId" + ], + [ + "mAtl", + "mAtlasId" + ], + [ + "texturedQuad", + "texturedQuadGeometry" + ], + [ + "Mesh", + "MeshRecord" + ], + [ + "Atlas", + "AtlasGlyphManager" + ], + [ + "Property", + "PropertyBuffer" + ], + [ + "atlas", + "atlasDescriptor" + ], + [ + "op", + "optimizedMesh" + ], + [ + "vertex", + "vertexCount" + ], + [ + "Atl", + "AtlasSlotDescriptor" + ], + [ + "he", + "heightInBlocks" + ], + [ + "wid", + "widthInBlocks" + ], + [ + "imag", + "imageHeight" + ], + [ + "image", + "imageWidth" + ] + ] + }, + "buffers": + [ + { + "file": "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h", + "settings": + { + "buffer_size": 8339, + "line_ending": "Unix" + } + } + ], + "build_system": "", + "build_system_choices": + [ + ], + "build_varint": "", + "command_palette": + { + "height": 375.0, + "last_filter": "Package Control: ", + "selected_items": + [ + [ + "Package Control: ", + "Package Control: Install Package" + ], + [ + "Package Cont", + "Package Control: Install Package" + ] + ], + "width": 462.0 + }, + "console": + { + "height": 0.0, + "history": + [ + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + "/homeSERILOCALr.underhill/dev/tizen", + "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit", + "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit/internal", + "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit/internal/controls", + "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit/internal/controls/scrollable", + "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view" + ], + "file_history": + [ + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/public-api/controls/control-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/file.list", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h", + "/homeSERILOCALr.underhill/dev/new/dali-toolkit/dali-toolkit/internal/builder/builder-impl.cpp", + "/homeSERILOCALr.underhill/dev/clash/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/dali/public-api/animation/alpha-function.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/dali/internal/event/animation/animation-impl.cpp", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/automated-tests/src/dali/utc-Dali-AlphaFunction.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-signals.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/public-api/file.list", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/decorator/text-decorator.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/text-view.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/shader-effects/material.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/shader-effects/sampler.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/shader-effects/shader.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-impl.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/public-api/builder/builder.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-animations.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/atlas-manager/atlas-manager-impl.h", + "/homeSERILOCALr.underhill/dev/apr28/dali-demo/build/tizen/examples/out", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/effects/scene-graph-material.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/demo/dali-table-view.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/shared/view.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/builder/builder-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/file.list", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/actors/renderer.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/object/property-buffer.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/public-api/geometry/geometry.h", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/geometry/scene-graph-geometry.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-label-multi-language/text-label-multi-language-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-label/text-label-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-label-emojis/text-label-emojis.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/point-mesh/point-mesh-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/resources/complete-status-manager.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/update/node-attachments/scene-graph-renderer-attachment.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali/internal/event/images/atlas-impl.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/mesh-morph/mesh-morph-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/atlas/atlas-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/text-view/text-view-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/size-negotiation/size-negotiation-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/scroll-view/scroll-view-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/motion-stretch/motion-stretch-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/motion-blur/motion-blur-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/logging/logging-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/item-view/item-view-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/dissolve-effect/dissolve-effect-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/cube-transition-effect/cube-transition-effect-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/cluster/cluster-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/buttons/buttons-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/builder/examples.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/blocks/blocks-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples/textured-mesh/textured-mesh-example.cpp", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/docs/generated/html/font_8h_source.html", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/build/tizen/dali-toolkit/Makefile.in", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/User/Preferences.sublime-settings", + "/homeSERILOCALr.underhill/dev/test/dali-core/dali/public-api/object/any.h", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/User/trailing_spaces.sublime-settings", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/User/Default (Linux).sublime-keymap", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/TrailingSpaces/trailing_spaces.sublime-settings", + "/homeSERILOCALr.underhill/.scripts/nmgrab", + "/homeSERILOCALr.underhill/dev/test/dali-core/dali/public-api/object/any.cpp", + "/homeSERILOCALr.underhill/.ssh/id_rsa.pub", + "/homeSERILOCALr.underhill/.config/sublime-text-3/Packages/Package Control/Package Control.sublime-settings" + ], + "find": + { + "height": 37.0 + }, + "find_in_files": + { + "height": 95.0, + "where_history": + [ + "/homeSERILOCALr.underhill/dev/mesh-merge/", + "/homeSERILOCALr.underhill/dev/mesh-merge/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit/", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/demo", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-demo/examples", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core", + "/homeSERILOCALr.underhill/dev/new_mesh", + "/homeSERILOCALr.underhill/dev/check/dali-toolkit", + "/homeSERILOCALr.underhill/dev/check/dali-adaptor", + "/homeSERILOCALr.underhill/dev/check/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-core/dali", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/", + "/homeSERILOCALr.underhill/dev/new_mesh/dali-toolkit/dali-toolkit" + ] + }, + "find_state": + { + "case_sensitive": false, + "find_history": + [ + "style_na", + "setsty", + "scrollovershooteffectr", + "EaseOutQuint50", + "alphafunction", + "alphafunctions", + "alphafunction", + "stage.add", + "mrenderable", + "mrenderableactor", + "blend", + "textab", + "invalid write", + "atlas", + "textabstraction", + "text", + "uniformmap", + "setsortmodifier", + "fragment_shader_b", + "mface", + "blendfunc", + "blendingfunc", + "blendingmode", + "blend", + "mface", + "createme", + "createmes", + "remove", + "index", + "createmes", + "texturedq", + "createmes", + "createmeshac", + "createmesh", + "createmes", + "createan", + "createanim", + "CreateAni", + "createani", + "createanimation", + "CreateBouncingEffect", + "createbou", + "setrelayout", + "setresizepolicy", + "SetResizePolicy", + "TextView", + "textview", + "font", + "font_parameters", + "default_font_parameters", + "default_font", + "defaul", + "DEFAULT_FONT_PARAMETERS", + "default_font_parameters", + "default_font_paramters", + "defaultfontparameter", + "filterscript", + "text-view", + "text-label", + "text-view", + "text-view.cpp", + "text-view", + "public-api/controls/text-view/", + "text-view", + "textview", + "textvie", + "text-view", + "fragment", + "optimize", + "optimizemesh", + "mesh" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": false, + "replace_history": + [ + "TextLabel" + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 0, + "sheets": + [ + { + "buffer": 0, + "file": "/homeSERILOCALr.underhill/dev/tizen/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h", + "semi_transient": true, + "settings": + { + "buffer_size": 8339, + "regions": + { + }, + "selection": + [ + [ + 7226, + 7331 + ] + ], + "settings": + { + "syntax": "Packages/C++/C++.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": -0.0, + "translation.y": 3225.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 23.0 + }, + "input": + { + "height": 0.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "output.find_results": + { + "height": 0.0 + }, + "pinned_build_system": "", + "project": "tizen.sublime-project", + "replace": + { + "height": 42.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "last_filter": "", + "selected_items": + [ + [ + "", + "~/dev/new/dali-toolkit/dali-toolkit/internal/controls/scrollable/scroll-view/merge.sublime-project" + ] + ], + "width": 380.0 + }, + "select_symbol": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "selected_group": 0, + "settings": + { + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 390.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index d6e763d..8778a9a 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include #include #include #include @@ -81,8 +82,9 @@ BaseHandle Create() DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextField, Toolkit::Control, Create ); DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "rendering-backend", INTEGER, RENDERING_BACKEND ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text", STRING, PLACEHOLDER_TEXT ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text", STRING, TEXT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text", STRING, PLACEHOLDER_TEXT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text-focused", STRING, PLACEHOLDER_TEXT_FOCUSED ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-family", STRING, FONT_FAMILY ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-style", STRING, FONT_STYLE ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "point-size", FLOAT, POINT_SIZE ) @@ -91,6 +93,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceed-policy", DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontal-alignment", STRING, HORIZONTAL_ALIGNMENT ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "vertical-alignment", STRING, VERTICAL_ALIGNMENT ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text-color", VECTOR4, TEXT_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text-color", VECTOR4, PLACEHOLDER_TEXT_COLOR ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-offset", VECTOR2, SHADOW_OFFSET ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-color", VECTOR4, SHADOW_COLOR ) DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "primary-cursor-color", VECTOR4, PRIMARY_CURSOR_COLOR ) @@ -151,19 +154,27 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } + case Toolkit::TextField::Property::TEXT: + { + if( impl.mController ) + { + impl.mController->SetText( value.Get< std::string >() ); + } + break; + } case Toolkit::TextField::Property::PLACEHOLDER_TEXT: { if( impl.mController ) { - //impl.mController->SetPlaceholderText( value.Get< std::string >() ); TODO + impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, value.Get< std::string >() ); } break; } - case Toolkit::TextField::Property::TEXT: + case Toolkit::TextField::Property::PLACEHOLDER_TEXT_FOCUSED: { if( impl.mController ) { - impl.mController->SetText( value.Get< std::string >() ); + impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, value.Get< std::string >() ); } break; } @@ -255,6 +266,19 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } + case Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR: + { + if ( impl.mController ) + { + Vector4 textColor = value.Get< Vector4 >(); + if ( impl.mController->GetPlaceholderTextColor() != textColor ) + { + impl.mController->SetPlaceholderTextColor( textColor ); + impl.RequestTextRelayout(); + } + } + break; + } case Toolkit::TextField::Property::SHADOW_OFFSET: { if( impl.mController ) @@ -448,22 +472,32 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde value = impl.mRenderingBackend; break; } + case Toolkit::TextField::Property::TEXT: + { + if( impl.mController ) + { + std::string text; + impl.mController->GetText( text ); + value = text; + } + break; + } case Toolkit::TextField::Property::PLACEHOLDER_TEXT: { if( impl.mController ) { std::string text; - impl.mController->GetPlaceholderText( text ); + impl.mController->GetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, text ); value = text; } break; } - case Toolkit::TextField::Property::TEXT: + case Toolkit::TextField::Property::PLACEHOLDER_TEXT_FOCUSED: { if( impl.mController ) { std::string text; - impl.mController->GetText( text ); + impl.mController->GetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, text ); value = text; } break; @@ -501,6 +535,14 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } break; } + case Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR: + { + if ( impl.mController ) + { + value = impl.mController->GetPlaceholderTextColor(); + } + break; + } case Toolkit::TextField::Property::SHADOW_OFFSET: { if ( impl.mController ) @@ -756,7 +798,7 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container ) mRenderer = Backend::Get().NewRenderer( mRenderingBackend ); } - RenderableActor renderableActor; + Actor renderableActor; if( mRenderer ) { renderableActor = mRenderer->Render( mController->GetView() ); @@ -840,9 +882,10 @@ void TextField::OnTap( const TapGesture& gesture ) VirtualKeyboard::Show(); } - SetKeyInputFocus(); - + // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y ); + + SetKeyInputFocus(); } void TextField::OnPan( const PanGesture& gesture ) @@ -852,9 +895,11 @@ void TextField::OnPan( const PanGesture& gesture ) bool TextField::OnKeyEvent( const KeyEvent& event ) { - if( Dali::DALI_KEY_ESCAPE == event.keyCode ) + if( Dali::DALI_KEY_ESCAPE == event.keyCode || + "Return" == event.keyPressedName ) // Make a Dali key code for this { ClearKeyInputFocus(); + return true; } return mController->KeyEvent( event ); @@ -862,24 +907,54 @@ bool TextField::OnKeyEvent( const KeyEvent& event ) ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ) { + bool update( false ); + + std::string text; + unsigned int cursorPosition( 0 ); + switch ( imfEvent.eventName ) { case ImfManager::COMMIT: { - KeyEvent event( "", imfEvent.predictiveString, 0, 0, 0, KeyEvent::Down ); - mController->KeyEvent( event ); + mController->InsertText( imfEvent.predictiveString, Text::Controller::COMMIT ); + break; + } + case ImfManager::PREEDIT: + { + mController->InsertText( imfEvent.predictiveString, Text::Controller::PRE_EDIT ); + update = true; break; } - case ImfManager::PREEDIT: // fall through case ImfManager::DELETESURROUNDING: + { + mController->RemoveText( imfEvent.cursorOffset, imfEvent.numberOfChars ); + break; + } case ImfManager::GETSURROUNDING: + { + mController->GetText( text ); + cursorPosition = mController->GetLogicalCursorPosition(); + + imfManager.SetSurroundingText( text ); + imfManager.SetCursorPosition( cursorPosition ); + break; + } case ImfManager::VOID: { // do nothing + break; } } // end switch - return ImfManager::ImfCallbackData(); + if( ImfManager::GETSURROUNDING != imfEvent.eventName ) + { + mController->GetText( text ); + cursorPosition = mController->GetLogicalCursorPosition(); + } + + ImfManager::ImfCallbackData callbackData( update, cursorPosition, text, false ); + + return callbackData; } void TextField::RequestTextRelayout() diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.h b/dali-toolkit/internal/controls/text-controls/text-field-impl.h index 63ded84..3d29f40 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -199,7 +199,7 @@ private: // Data Text::DecoratorPtr mDecorator; Text::ClipperPtr mClipper; ///< For EXCEED_POLICY_CLIP - RenderableActor mRenderableActor; + Actor mRenderableActor; int mRenderingBackend; int mExceedPolicy; diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 3f0cf0d..c260a63 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -453,7 +453,7 @@ void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container ) mRenderer = Backend::Get().NewRenderer( mRenderingBackend ); } - RenderableActor renderableActor; + Actor renderableActor; if( mRenderer ) { renderableActor = mRenderer->Render( mController->GetView() ); diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.h b/dali-toolkit/internal/controls/text-controls/text-label-impl.h index 54c2554..528a16f 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.h @@ -124,7 +124,7 @@ private: // Data Text::ControllerPtr mController; Text::RendererPtr mRenderer; - RenderableActor mRenderableActor; + Actor mRenderableActor; int mRenderingBackend; }; diff --git a/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp b/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp index a04ff9a..a0ca86e 100644 --- a/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp +++ b/dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp @@ -19,7 +19,7 @@ #include "tool-bar-impl.h" // EXTERNAL INCLUDES -#include +#include #include #include #include @@ -76,7 +76,7 @@ void ToolBar::SetBackground( Actor background ) background.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); background.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) ); - RenderableActor renderableActor = RenderableActor::DownCast( background ); + ImageActor renderableActor = ImageActor::DownCast( background ); if ( renderableActor ) { renderableActor.SetSortModifier( 1.f ); diff --git a/dali-toolkit/internal/controls/view/view-impl.cpp b/dali-toolkit/internal/controls/view/view-impl.cpp new file mode 100644 index 0000000..280bd24 --- /dev/null +++ b/dali-toolkit/internal/controls/view/view-impl.cpp @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2014 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. + * + */ + +// CLASS HEADER +#include "view-impl.h" + +// EXTERNAL INCLUDES +#include // for strcmp +#include +#include +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal +{ + +namespace +{ + +BaseHandle Create() +{ + return Toolkit::View::New(); +} + +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::View, Toolkit::Control, Create ) + +//DALI_SIGNAL_REGISTRATION( View, "orientation-animation-start", SIGNAL_ORIENTATION_ANIMATION_START ) + +DALI_TYPE_REGISTRATION_END() + +const float ROTATION_ANIMATION_DURATION = 0.5f; + +} + +Toolkit::View View::New( bool fullscreen ) +{ + // Create the implementation, temporarily owned by this handle on stack + IntrusivePtr< View > internalView = new View(fullscreen); + + // Pass ownership to CustomActor handle + Toolkit::View view( *internalView ); + + // Second-phase init of the implementation + // This can only be done after the CustomActor connection has been made... + internalView->Initialize(); + + return view; +} + +Layer View::GetContentLayer( unsigned int index ) const +{ + // Returns the layer stored in the layer map. + Layer layer; + + LayerConstIt it = mContentLayers.find( index ); + + if( it != mContentLayers.end() ) + { + layer = it->second; + } + + return layer; +} + +unsigned int View::AddContentLayer( Layer layer ) +{ + // layer must exist. + DALI_ASSERT_ALWAYS( layer ); + + unsigned int index = mNextLayerIndex; + LayerIt it = FindLayer( layer ); + + if( it == mContentLayers.end() ) + { + // Add layer to the custom actor. + Self().Add( layer ); + + // Store the layer. + mContentLayers[mNextLayerIndex] = layer; + + // Increase the index. + ++mNextLayerIndex; + } + + return index; +} + +void View::RemoveContentLayer( Layer layer ) +{ + // Check if layer was added in this view. + LayerIt it = FindLayer( layer ); + if( it != mContentLayers.end() ) + { + // Remove layer from custom actor. + Self().Remove( layer ); + + // Remove layer from layer map. + mContentLayers.erase( it ); + } +} + +Layer View::GetBackgroundLayer() const +{ + return mBackgroundLayer; +} + +void View::SetBackground( ImageActor backgroundImage ) +{ + // Create background layer if doesn't exist. + + if( !mBackgroundLayer ) + { + mBackgroundLayer = Layer::New(); + + mBackgroundLayer.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION ); + mBackgroundLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); + + // Add background layer to custom actor. + Self().Add( mBackgroundLayer ); + + // Drop the background layer + + DALI_ASSERT_ALWAYS( mBackgroundLayer.OnStage() ); // We need to be on-stage to drop the layer + mBackgroundLayer.LowerToBottom(); + } + else + { + // It removes the old background + if( 0 < mBackgroundLayer.GetChildCount() ) + { + mBackgroundLayer.Remove( mBackgroundLayer.GetChildAt(0) ); + } + } + + backgroundImage.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION ); + backgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); + backgroundImage.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO ); + mBackgroundLayer.Add( backgroundImage ); + + RelayoutRequest(); +} + +void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse ) +{ + mOrientationFunction[View::PORTRAIT] = portrait.degree; + mOrientationFunction[View::LANDSCAPE] = landscale.degree; + mOrientationFunction[View::PORTRAIT_INVERSE] = portraitInverse.degree; + mOrientationFunction[View::LANDSCAPE_INVERSE] = landscapeInverse.degree; +} + +void View::OrientationChanged( Dali::Orientation orientation ) +{ + /* + Actor self = Self(); + + // Nothing to do if orientation doesn't really change. + if ( orientation.GetDegrees() == mOrientation || !mAutoRotateEnabled ) + { + return; + } + + mOrientation = orientation.GetDegrees(); + + // has parent so we expect it to be on stage + mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( -orientation.GetRadians() ), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); + + // Resize the view + if( mFullScreen ) + { + const Vector2& stageSize( Stage::GetCurrent().GetSize() ); + const Vector3& currentSize( self.GetCurrentSize() ); + + float minSize = std::min( stageSize.width, stageSize.height ); + float maxSize = std::max( stageSize.width, stageSize.height ); + + Vector3 targetSize; + View::Orientation viewOrientation = DegreeToViewOrientation( Degree( orientation.GetDegrees() ) ); + switch( viewOrientation ) + { + case View::PORTRAIT: // Fallthrough + case View::PORTRAIT_INVERSE: + targetSize = Vector3( minSize, maxSize, currentSize.depth ); + break; + case View::LANDSCAPE: // Fallthrough + case View::LANDSCAPE_INVERSE: + targetSize = Vector3( maxSize, minSize, currentSize.depth ); + break; + default: + DALI_ASSERT_ALWAYS( false ); + } + + // if we linearly resize from portrait to landscape halfway through the animation + // we get size which is square between the both. This would cause a square image to grow + // if it is fitted to be 100% of view size. Therefore we do a nonlinear size animation + // where we shrink faster + // which one grows + if( targetSize.width > currentSize.width ) + { + // width grows, shrink height faster + Vector3 shrink( currentSize );shrink.height = targetSize.height; + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) ); + } + else + { + // height grows, shrink width faster + Vector3 shrink( currentSize );shrink.width = targetSize.width; + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) ); + } + } + + Toolkit::View handle( GetOwner() ); + mOrientationAnimationStartedSignal.Emit( handle, mRotateAnimation, orientation ); + + mRotateAnimation.Play(); + */ +} + +void View::SetAutoRotate( bool enabled ) +{ + mAutoRotateEnabled = enabled; +} + +Toolkit::View::OrientationAnimationStartedSignalType& View::OrientationAnimationStartedSignal() +{ + return mOrientationAnimationStartedSignal; +} + +bool View::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + return true; + + /* + Dali::BaseHandle handle( object ); + + bool connected( true ); + Toolkit::View view = Toolkit::View::DownCast(handle); + + if( 0 == strcmp( signalName.c_str(), SIGNAL_ORIENTATION_ANIMATION_START ) ) + { + view.OrientationAnimationStartedSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + + return connected; + */ +} + +View::View(bool fullscreen) +: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ), + mOrientation( -1 ), + mFullScreen(fullscreen), + mContentLayers(), + mNextLayerIndex( 0 ), + mOrientationFunction(), + mAutoRotateEnabled( true ) +{ + mOrientationFunction[View::PORTRAIT] = 0.f; + mOrientationFunction[View::LANDSCAPE] = 90.f; + mOrientationFunction[View::PORTRAIT_INVERSE] = 180.f; + mOrientationFunction[View::LANDSCAPE_INVERSE] = 270.f; +} + +View::~View() +{ +} + +void View::OnInitialize() +{ + Self().SetAnchorPoint( AnchorPoint::CENTER ); + Self().SetParentOrigin( ParentOrigin::CENTER ); + + if( mFullScreen ) + { + Self().SetSize( Stage::GetCurrent().GetSize() ); + } +} + +View::Orientation View::DegreeToViewOrientation( Degree degree ) +{ + View::Orientation orientation = PORTRAIT; + + if( fabsf( mOrientationFunction[PORTRAIT] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT], degree.degree ) ) + { + orientation = PORTRAIT; + } + else if( fabsf( mOrientationFunction[LANDSCAPE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE], degree.degree ) ) + { + orientation = LANDSCAPE; + } + else if( fabsf( mOrientationFunction[PORTRAIT_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT_INVERSE], degree.degree ) ) + { + orientation = PORTRAIT_INVERSE; + } + else if( fabsf( mOrientationFunction[LANDSCAPE_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE_INVERSE], degree.degree ) ) + { + orientation = LANDSCAPE_INVERSE; + } + + return orientation; +} + +View::LayerIt View::FindLayer( Layer layer ) +{ + for( LayerIt it = mContentLayers.begin(); it != mContentLayers.end(); ++it ) + { + if(layer == it->second) + { + return it; + } + } + + return mContentLayers.end(); +} + +} // namespace Internal + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/internal/controls/view/view-impl.h b/dali-toolkit/internal/controls/view/view-impl.h new file mode 100644 index 0000000..b956eae --- /dev/null +++ b/dali-toolkit/internal/controls/view/view-impl.h @@ -0,0 +1,208 @@ +#ifndef __DALI_TOOLKIT_INTERNAL_VIEW_H__ +#define __DALI_TOOLKIT_INTERNAL_VIEW_H__ + +/* + * Copyright (c) 2014 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. + * + */ + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +class View; + +namespace Internal +{ + +/** + * View is a control to add layers and a background. + * @see Dali::Toolkit::View for more details. + */ +class View : public Control +{ +private: + typedef std::map LayerContainer; + typedef std::map::iterator LayerIt; + typedef std::map::const_iterator LayerConstIt; + + /** + * Orientation declaration used internally to rotate the view. + * The angles associated with each enum value could be changed with the SetOrientationFunction method. + */ + enum Orientation + { + PORTRAIT, ///< portrait orientation. + LANDSCAPE, ///< landscape orientation. + PORTRAIT_INVERSE, ///< portrait inverse orientation. + LANDSCAPE_INVERSE ///< landscape inverse orientation. + }; + +public: + + /** + * Create an initialized View. + * @param fullscreen If true, the view's size is going to be set with the Dali::Stage size. Otherwise a size must be provided. + * @return A handle to a newly allocated Dali resource. + */ + static Toolkit::View New( bool fullscreen ); + + /** + * @copydoc Dali::Toolkit::View::GetContentLayer() + */ + Layer GetContentLayer( unsigned int index ) const; + + /** + * @copydoc Dali::Toolkit::View::AddContentLayer() + */ + unsigned int AddContentLayer( Layer layer ); + + /** + * @copydoc Dali::Toolkit::View::RemoveContentLayer() + */ + void RemoveContentLayer( Layer layer ); + + /** + * @copydoc Dali::Toolkit::View::GetBackgroundLayer() + */ + Layer GetBackgroundLayer() const; + + /** + * @copydoc Dali::Toolkit::View::SetBackground() + */ + void SetBackground( ImageActor image ); + + /** + * @copydoc Dali::Toolkit::View::SetOrientationFunction() + */ + void SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse ); + + /** + * @copydoc Dali::Toolkit::View::OrientationChanged() + * + */ + void OrientationChanged( Dali::Orientation orientation ); + + /** + * @copydoc Dali::Toolkit::View::SetAutoRotate() + * + */ + void SetAutoRotate( bool enabled ); + +public: + + /** + * @copydoc Dali::Toolkit::View::AnimationStartedSignalOrientation() + */ + Toolkit::View::OrientationAnimationStartedSignalType& OrientationAnimationStartedSignal(); + + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @return True if the signal was connected. + * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. + */ + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + +private: // From Control + + /** + * @copydoc Toolkit::Control::OnInitialize() + */ + virtual void OnInitialize(); + +private: + + + /** + * Constructor. + * It initializes View members. + * It initializes orientations as follows: portrait 0, landscape 90, portrait inverse 180, landscape inverse 270. + * @param fullscreen If true, the view's size is going to be set with the Dali::Stage size. Otherwise a size must be provided. + */ + View(bool fullscreen); + + /** + * A reference counted object may only be deleted by calling Unreference() + */ + virtual ~View(); + + /** + * Return an orientation for the given angle in degrees. + * @param degree angle in degrees. + * @return An internal orientation. + */ + View::Orientation DegreeToViewOrientation( Degree degree ); + + /** + * Find a layer in the layer container. Non const method + */ + LayerIt FindLayer( Layer layer ); + +private: + int mOrientation; ///< Stores the given orientation in degrees. + bool mFullScreen; ///< Stores if the view is fullscreen or not. + LayerContainer mContentLayers; ///< Layer container. + unsigned int mNextLayerIndex; ///< Next index to be used when a layer is added. + Layer mBackgroundLayer; ///< The background layer. + Animation mRotateAnimation; ///< The animation which rotates the view (and all layers added to it) + float mOrientationFunction[4]; ///< The orientation function used to transform from degrees to the internal orientation. + bool mAutoRotateEnabled; ///< Whether the view rotates if the OrientationChanged method is called. + + Toolkit::View::OrientationAnimationStartedSignalType mOrientationAnimationStartedSignal; +}; + +} // namespace Internal + + +// Helpers for public-api forwarding methods + +inline Toolkit::Internal::View& GetImpl( Toolkit::View& view ) +{ + DALI_ASSERT_ALWAYS( view ); + + Dali::RefObject& handle = view.GetImplementation(); + + return static_cast( handle ); +} + +inline const Toolkit::Internal::View& GetImpl( const Toolkit::View& view ) +{ + DALI_ASSERT_ALWAYS( view ); + + const Dali::RefObject& handle = view.GetImplementation(); + + return static_cast( handle ); +} + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_INTERNAL_VIEW_H__ diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index a6b0fb1..e864fd2 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -14,7 +14,6 @@ toolkit_src_files = \ $(toolkit_src_dir)/builder/replacement.cpp \ $(toolkit_src_dir)/controls/alignment/alignment-impl.cpp \ $(toolkit_src_dir)/controls/bloom-view/bloom-view-impl.cpp \ - $(toolkit_src_dir)/controls/bubble-effect/bubble-emitter-impl.cpp \ $(toolkit_src_dir)/controls/buttons/button-impl.cpp \ $(toolkit_src_dir)/controls/buttons/check-box-button-impl.cpp \ $(toolkit_src_dir)/controls/buttons/push-button-impl.cpp \ @@ -36,7 +35,6 @@ toolkit_src_files = \ $(toolkit_src_dir)/controls/scroll-bar/scroll-bar-impl.cpp \ $(toolkit_src_dir)/controls/scroll-component/scroll-bar-internal-impl.cpp \ $(toolkit_src_dir)/controls/scroll-component/scroll-bar-internal.cpp \ - $(toolkit_src_dir)/controls/scrollable/bouncing-effect-actor.cpp \ $(toolkit_src_dir)/controls/scrollable/item-view/item-view-impl.cpp \ $(toolkit_src_dir)/controls/scrollable/scrollable-impl.cpp \ $(toolkit_src_dir)/controls/scrollable/scroll-connector-impl.cpp \ @@ -94,7 +92,6 @@ toolkit_src_files = \ $(toolkit_src_dir)/text/rendering/atlas/atlas-glyph-manager-impl.cpp \ $(toolkit_src_dir)/text/rendering/basic/text-basic-renderer.cpp \ $(toolkit_src_dir)/text/rendering/shaders/text-basic-shader.cpp \ - $(toolkit_src_dir)/text/rendering/shaders/text-basic-shadow-shader.cpp \ $(toolkit_src_dir)/text/rendering/shaders/text-bgra-shader.cpp \ $(toolkit_src_dir)/text/rendering/text-backend-impl.cpp \ $(toolkit_src_dir)/transition-effects/cube-transition-effect-impl.cpp \ diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index 871b3d6..34b3726 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -32,8 +31,6 @@ #include #include #include -#include -#include #include #include #include @@ -170,7 +167,7 @@ struct Decorator::Impl : public ConnectionTracker struct CursorImpl { CursorImpl() - : color( Dali::Color::WHITE ), + : color( Dali::Color::BLACK ), position(), cursorHeight( 0.0f ), lineHeight( 0.0f ) @@ -237,6 +234,7 @@ struct Decorator::Impl : public ConnectionTracker // TODO - Remove this if nothing is active CreateActiveLayer(); + /* // Show or hide the cursors CreateCursors(); if( mPrimaryCursor ) @@ -276,7 +274,7 @@ struct Decorator::Impl : public ConnectionTracker } mSecondaryCursor.SetVisible( mSecondaryCursorVisible ); } - + */ // Show or hide the grab handle HandleImpl& grabHandle = mHandle[GRAB_HANDLE]; if( grabHandle.active ) @@ -335,7 +333,7 @@ struct Decorator::Impl : public ConnectionTracker { UnparentAndReset( primary.actor ); UnparentAndReset( secondary.actor ); - UnparentAndReset( mHighlightMeshActor ); + //UnparentAndReset( mHighlightMeshActor ); } if ( mActiveCopyPastePopup ) @@ -398,6 +396,7 @@ struct Decorator::Impl : public ConnectionTracker // Add or Remove cursor(s) from parent void CreateCursors() { + /* if( mActiveCursor == ACTIVE_CURSOR_NONE ) { UnparentAndReset( mPrimaryCursor ); @@ -405,7 +404,7 @@ struct Decorator::Impl : public ConnectionTracker } else { - /* Create Primary and or Secondary Cursor(s) if active and add to parent */ + // Create Primary and or Secondary Cursor(s) if active and add to parent if ( mActiveCursor == ACTIVE_CURSOR_PRIMARY || mActiveCursor == ACTIVE_CURSOR_BOTH ) { @@ -435,10 +434,12 @@ struct Decorator::Impl : public ConnectionTracker UnparentAndReset( mSecondaryCursor ); } } + */ } bool OnCursorBlinkTimerTick() { + /* // Cursor blinking if ( mPrimaryCursor ) { @@ -450,7 +451,7 @@ struct Decorator::Impl : public ConnectionTracker } mCursorBlinkStatus = !mCursorBlinkStatus; - + */ return true; } @@ -606,6 +607,7 @@ struct Decorator::Impl : public ConnectionTracker void CreateHighlight() { + /* if ( !mHighlightMeshActor ) { mHighlightMaterial = Material::New( "HighlightMaterial" ); @@ -626,6 +628,7 @@ struct Decorator::Impl : public ConnectionTracker Actor parent = mTextControlParent.Self(); parent.Add( mHighlightMeshActor ); } + */ } void UpdateHighlight() @@ -655,6 +658,7 @@ struct Decorator::Impl : public ConnectionTracker // 9* *7 // + /* if ( mHighlightMesh && mHighlightMaterial && !mHighlightQuadList.empty() ) { MeshData::VertexContainer vertices; @@ -718,6 +722,7 @@ struct Decorator::Impl : public ConnectionTracker mHighlightMeshData.SetData( vertices, faceIndices, bones, mHighlightMaterial ); mHighlightMesh.UpdateMeshData( mHighlightMeshData ); } + */ } void OnTap( Actor actor, const TapGesture& tap ) @@ -822,12 +827,13 @@ struct Decorator::Impl : public ConnectionTracker { float alternativePosition=0.0f;; + /* if ( mPrimaryCursor ) // Secondary cursor not used for paste { Cursor cursor = PRIMARY_CURSOR; alternativePosition = mCursor[cursor].position.y; } - + */ const float popupHeight = 120.0f; // todo Set as a MaxSize Property in Control or retrieve from CopyPastePopup class. if( mHandle[GRAB_HANDLE].active ) @@ -986,16 +992,16 @@ struct Decorator::Impl : public ConnectionTracker Timer mScrollTimer; ///< Timer used to scroll the text when the grab handle is moved close to the edges. Layer mActiveLayer; ///< Layer for active handles and alike that ensures they are above all else. - ImageActor mPrimaryCursor; - ImageActor mSecondaryCursor; - MeshActor mHighlightMeshActor; ///< Mesh Actor to display highlight + //ImageActor mPrimaryCursor; + //ImageActor mSecondaryCursor; + //MeshActor mHighlightMeshActor; ///< Mesh Actor to display highlight TextSelectionPopup mCopyPastePopup; Image mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT]; Image mCursorImage; - Mesh mHighlightMesh; ///< Mesh for highlight - MeshData mHighlightMeshData; ///< Mesh Data for highlight - Material mHighlightMaterial; ///< Material used for highlight + //Mesh mHighlightMesh; ///< Mesh for highlight + //MeshData mHighlightMeshData; ///< Mesh Data for highlight + //Material mHighlightMaterial; ///< Material used for highlight CursorImpl mCursor[CURSOR_COUNT]; HandleImpl mHandle[HANDLE_TYPE_COUNT]; diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp index 734b82a..7bd8f18 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp @@ -81,13 +81,13 @@ void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph, void AtlasGlyphManager::GenerateMeshData( uint32_t imageId, const Vector2& position, - MeshData& meshData ) + Toolkit::AtlasManager::Mesh2D& mesh ) { - mAtlasManager.GenerateMeshData( imageId, position, meshData ); + mAtlasManager.GenerateMeshData( imageId, position, mesh ); } -void AtlasGlyphManager::StitchMesh( MeshData& first, - const MeshData& second ) +void AtlasGlyphManager::StitchMesh( Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second ) { mAtlasManager.StitchMesh( first, second ); } @@ -144,6 +144,11 @@ Pixel::Format AtlasGlyphManager::GetPixelFormat( uint32_t atlasId ) return mAtlasManager.GetPixelFormat( atlasId ); } +Material AtlasGlyphManager::GetMaterial( uint32_t atlasId ) const +{ + return mAtlasManager.GetMaterial( atlasId ); +} + const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics() { mMetrics.mGlyphCount = mGlyphRecords.Size(); diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h index cbbe732..b6b31a1 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h @@ -77,13 +77,13 @@ public: */ void GenerateMeshData( uint32_t imageId, const Vector2& position, - MeshData& meshData ); + Toolkit::AtlasManager::Mesh2D& mesh ); /** * @copydoc Toolkit::AtlasGlyphManager::StitchMesh */ - void StitchMesh( MeshData& first, - const MeshData& second ); + void StitchMesh( Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second ); /** * @copydoc Toolkit::AtlasGlyphManager::Cached @@ -108,12 +108,17 @@ public: void Remove( uint32_t imageId ); /** - * @copydoc toolkit::AtlasGlyphManager::GetPixelFormat + * @copydoc Toolkit::AtlasGlyphManager::GetPixelFormat */ Pixel::Format GetPixelFormat( uint32_t atlasId ); /** - * @copydoc toolkit::AtlasGlyphManager::GetMetrics + * @copydoc Toolkit::AtlasGlyphManager::GetMaterial + */ + Material GetMaterial( uint32_t atlasId ) const; + + /** + * @copydoc Toolkit::AtlasGlyphManager::GetMetrics */ const Toolkit::AtlasGlyphManager::Metrics& GetMetrics(); diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp index ccb0efc..d7a6a1b 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp @@ -78,15 +78,15 @@ void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph, void AtlasGlyphManager::GenerateMeshData( uint32_t imageId, const Vector2& position, - MeshData& meshData ) + Toolkit::AtlasManager::Mesh2D& mesh ) { GetImplementation(*this).GenerateMeshData( imageId, position, - meshData ); + mesh ); } -void AtlasGlyphManager::StitchMesh( MeshData& first, - const MeshData& second ) +void AtlasGlyphManager::StitchMesh( Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second ) { GetImplementation(*this).StitchMesh( first, second ); } @@ -118,6 +118,11 @@ Pixel::Format AtlasGlyphManager::GetPixelFormat( uint32_t atlasId ) return GetImplementation(*this).GetPixelFormat( atlasId ); } +Material AtlasGlyphManager::GetMaterial( uint32_t atlasId ) const +{ + return GetImplementation(*this).GetMaterial( atlasId ); +} + const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics() { return GetImplementation(*this).GetMetrics(); diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h index ad2c5ea..cf663c3 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h @@ -88,7 +88,7 @@ public: */ void GenerateMeshData( uint32_t imageId, const Vector2& position, - MeshData& meshData ); + Toolkit::AtlasManager::Mesh2D& mesh ); /** * @brief Stitch Two Meshes together @@ -96,8 +96,8 @@ public: * @param[in] first first mesh * @param[in] second second mesh */ - void StitchMesh( MeshData& first, - const MeshData& second ); + void StitchMesh( Toolkit::AtlasManager::Mesh2D& first, + const Toolkit::AtlasManager::Mesh2D& second ); /** * @brief Check to see if a glyph is being cached @@ -146,6 +146,15 @@ public: Pixel::Format GetPixelFormat( uint32_t atlasId ); /** + * @brief Get the material used by an atlas + * + * @param[in] atlasId Id of an atlas + * + * @return The material used by the atlas + */ + Material GetMaterial( uint32_t atlasId ) const; + + /** * @brief Get Glyph Manager metrics * * @return const reference to glyph manager metrics diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp index 1825840..f966dec 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp @@ -21,14 +21,13 @@ // EXTERNAL INCLUDES #include #include +//#include #include // INTERNAL INCLUDES #include #include #include -#include -#include #if defined(DEBUG_ENABLED) Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_ATLAS_RENDERER"); #endif @@ -45,6 +44,62 @@ namespace const float TWO( 2.0f ); const uint32_t DEFAULT_ATLAS_WIDTH = 512u; const uint32_t DEFAULT_ATLAS_HEIGHT = 512u; + + #define MAKE_SHADER(A)#A + + const char* VERTEX_SHADER = MAKE_SHADER( + attribute mediump vec2 aPosition; + attribute mediump vec2 aTexCoord; + uniform mediump mat4 uMvpMatrix; + uniform mediump vec3 uSize; + varying mediump vec2 vTexCoord; + + void main() + { + mediump vec4 position = vec4( aPosition, 0.0, 1.0 ); + position.xyz *= uSize; + gl_Position = uMvpMatrix * position; + vTexCoord = aTexCoord; + } + ); + + const char* FRAGMENT_SHADER = MAKE_SHADER( + uniform sampler2D sTexture; + varying mediump vec2 vTexCoord; + + void main() + { + //gl_FragColor = vec4( 1.0 ); + gl_FragColor = texture2D( sTexture, vTexCoord ); + } + ); + + const char* VERTEX_SHADER_SHADOW = MAKE_SHADER( + attribute mediump vec2 aPosition; + attribute mediump vec2 aTexCoord; + uniform mediump vec3 uSize; + varying mediump vec2 vTexCoord; + + void main() + { + mediump vec4 position = vec4( aPosition, 0.0, 1.0 ); + position.xyz *= uSize; + gl_Position = position; + vTexCoord = aTexCoord; + } + ); + + const char* FRAGMENT_SHADER_SHADOW = MAKE_SHADER( + uniform sampler2D sTexture; + uniform lowp vec4 uColor; + varying mediump vec2 vTexCoord; + + void main() + { + mediump vec4 color = texture2D( sTexture, vTexCoord ); + gl_FragColor = vec4(uColor.rgb, uColor.a*color.r); + } + ); } struct AtlasRenderer::Impl : public ConnectionTracker @@ -60,7 +115,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker { Vector4 mColor; uint32_t mAtlasId; - MeshData mMeshData; + AtlasManager::Mesh2D mMesh; FrameBufferImage mBuffer; bool mIsUnderline; }; @@ -92,13 +147,13 @@ struct AtlasRenderer::Impl : public ConnectionTracker { mGlyphManager = AtlasGlyphManager::Get(); mFontClient = TextAbstraction::FontClient::Get(); - mBasicShader = BasicShader::New(); - mBgraShader = BgraShader::New(); - mBasicShadowShader = BasicShadowShader::New(); - mFace.reserve( 6u ); - mFace.push_back( 0 ); mFace.push_back( 2u ); mFace.push_back( 1u ); - mFace.push_back( 1u ); mFace.push_back( 2u ); mFace.push_back( 3u ); + mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2; + mQuadVertexFormat[ "aTexCoord" ] = Property::VECTOR2; + mQuadIndexFormat[ "indices" ] = Property::UNSIGNED_INTEGER; + + mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ); + mShadowShader = Shader::New( VERTEX_SHADER_SHADOW, FRAGMENT_SHADER_SHADOW ); } void AddGlyphs( const std::vector& positions, @@ -177,13 +232,13 @@ struct AtlasRenderer::Impl : public ConnectionTracker } Vector2 position = positions[ i ]; - MeshData newMeshData; + AtlasManager::Mesh2D newMesh; mGlyphManager.Cached( glyph.fontId, glyph.index, slot ); if ( slot.mImageId ) { // This glyph already exists so generate mesh data plugging in our supplied position - mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData ); + mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh ); mImageIds.PushBack( slot.mImageId ); } else @@ -207,50 +262,48 @@ struct AtlasRenderer::Impl : public ConnectionTracker // Create a new image for the glyph BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index ); - if ( bitmap ) + + // Ensure that the next image will fit into the current block size + bool setSize = false; + if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth ) { - // Ensure that the next image will fit into the current block size - bool setSize = false; - if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth ) - { - setSize = true; - mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth(); - } - if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight ) - { - setSize = true; - mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight(); - } + setSize = true; + mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth(); + } + if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight ) + { + setSize = true; + mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight(); + } - if ( setSize ) - { - mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH, - DEFAULT_ATLAS_HEIGHT, - mBlockSizes[ currentBlockSize ].mNeededBlockWidth, - mBlockSizes[ currentBlockSize ].mNeededBlockHeight ); - } + if ( setSize ) + { + mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH, + DEFAULT_ATLAS_HEIGHT, + mBlockSizes[ currentBlockSize ].mNeededBlockWidth, + mBlockSizes[ currentBlockSize ].mNeededBlockHeight ); + } - // Locate a new slot for our glyph - mGlyphManager.Add( glyph, bitmap, slot ); + // Locate a new slot for our glyph + mGlyphManager.Add( glyph, bitmap, slot ); - // Generate mesh data for this quad, plugging in our supplied position - if ( slot.mImageId ) - { - mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData ); - mImageIds.PushBack( slot.mImageId ); - } + // Generate mesh data for this quad, plugging in our supplied position + if ( slot.mImageId ) + { + mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh ); + mImageIds.PushBack( slot.mImageId ); } } // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas) StitchTextMesh( meshContainer, - newMeshData, + newMesh, extents, textColor, position.y + glyph.yBearing, currentUnderlinePosition, currentUnderlineThickness, slot ); - lastFontId = glyph.fontId; + lastFontId = glyph.fontId; } } @@ -265,33 +318,12 @@ struct AtlasRenderer::Impl : public ConnectionTracker { for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(); mIt != meshContainer.end(); ++mIt ) { - MeshActor actor = MeshActor::New( Mesh::New( mIt->mMeshData ) ); - actor.SetColor( mIt->mColor ); - - // Ensure that text rendering is unfiltered - actor.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST ); - if ( mIt->mIsUnderline ) - { - actor.SetColorMode( USE_OWN_COLOR ); - } - else - { - actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); - } + Actor actor = CreateMeshActor( *mIt ); - // Check to see what pixel format the shader should be - if ( mGlyphManager.GetPixelFormat( mIt->mAtlasId ) == Pixel::L8 ) - { - // Create an effect if necessary - if ( style == STYLE_DROP_SHADOW ) - { - actor.Add( GenerateShadow( *mIt, shadowOffset, shadowColor ) ); - } - actor.SetShaderEffect( mBasicShader ); - } - else + // Create an effect if necessary + if ( style == STYLE_DROP_SHADOW ) { - actor.SetShaderEffect( mBgraShader ); + actor.Add( GenerateShadow( *mIt, shadowOffset, shadowColor ) ); } if ( mActor ) @@ -326,8 +358,38 @@ struct AtlasRenderer::Impl : public ConnectionTracker #endif } + Actor CreateMeshActor( const MeshRecord& meshRecord ) + { + PropertyBuffer quadVertices = PropertyBuffer::New( PropertyBuffer::STATIC, mQuadVertexFormat, meshRecord.mMesh.mVertices.Size() ); + PropertyBuffer quadIndices = PropertyBuffer::New( PropertyBuffer::STATIC, mQuadIndexFormat, meshRecord.mMesh.mIndices.Size() >> 1 ); + quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ) ); + quadIndices.SetData( const_cast< unsigned short* >( &meshRecord.mMesh.mIndices[ 0 ] ) ); + + Geometry quadGeometry = Geometry::New(); + quadGeometry.AddVertexBuffer( quadVertices ); + quadGeometry.SetIndexBuffer( quadIndices ); + + Material material = mGlyphManager.GetMaterial( meshRecord.mAtlasId ); + Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material ); + renderer.SetDepthIndex( 0 ); + Actor actor = Actor::New(); + actor.AddRenderer( renderer ); + actor.SetSize( 1.0f, 1.0f ); + actor.SetColor( meshRecord.mColor ); + + if ( meshRecord.mIsUnderline ) + { + actor.SetColorMode( USE_OWN_COLOR ); + } + else + { + actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); + } + return actor; + } + void StitchTextMesh( std::vector< MeshRecord >& meshContainer, - MeshData& newMeshData, + AtlasManager::Mesh2D& newMesh, Vector< Extent >& extents, const Vector4& color, float baseLine, @@ -337,9 +399,8 @@ struct AtlasRenderer::Impl : public ConnectionTracker { if ( slot.mImageId ) { - MeshData::VertexContainer verts = newMeshData.GetVertices(); - float left = verts[ 0 ].x; - float right = verts[ 1 ].x; + float left = newMesh.mVertices[ 0 ].mPosition.x; + float right = newMesh.mVertices[ 1 ].mPosition.x; // Check to see if there's a mesh data object that references the same atlas ? uint32_t index = 0; @@ -348,7 +409,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker if ( slot.mAtlasId == mIt->mAtlasId && color == mIt->mColor ) { // Stitch the mesh to the existing mesh and adjust any extents - mGlyphManager.StitchMesh( mIt->mMeshData, newMeshData ); + mGlyphManager.StitchMesh( mIt->mMesh, newMesh ); AdjustExtents( extents, meshContainer, index, @@ -364,7 +425,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker // No mesh data object currently exists that references this atlas, so create a new one MeshRecord meshRecord; meshRecord.mAtlasId = slot.mAtlasId; - meshRecord.mMeshData = newMeshData; + meshRecord.mMesh = newMesh; meshRecord.mColor = color; meshRecord.mIsUnderline = false; meshContainer.push_back( meshRecord ); @@ -475,11 +536,11 @@ struct AtlasRenderer::Impl : public ConnectionTracker const Vector4& underlineColor, const Vector4& textColor ) { - MeshData newMeshData; + AtlasManager::Mesh2D newMesh; + unsigned short faceIndex = 0; for ( Vector< Extent >::ConstIterator eIt = extents.Begin(); eIt != extents.End(); ++eIt ) { - MeshData::VertexContainer newVerts; - newVerts.reserve( 4u ); + AtlasManager::Vertex2D vert; uint32_t index = eIt->mMeshRecordIndex; Vector2 uv = mGlyphManager.GetAtlasSize( meshRecords[ index ].mAtlasId ); @@ -491,37 +552,45 @@ struct AtlasRenderer::Impl : public ConnectionTracker float tlx = eIt->mLeft; float brx = eIt->mRight; - newVerts.push_back( MeshData::Vertex( Vector3( tlx, baseLine, ZERO ), - Vector2::ZERO, - Vector3::ZERO ) ); - - newVerts.push_back( MeshData::Vertex( Vector3( brx, baseLine, ZERO ), - Vector2( u, ZERO ), - Vector3::ZERO ) ); - - newVerts.push_back( MeshData::Vertex( Vector3( tlx, baseLine + thickness, ZERO ), - Vector2( ZERO, v ), - Vector3::ZERO ) ); - - newVerts.push_back( MeshData::Vertex( Vector3( brx, baseLine + thickness, ZERO ), - Vector2( u, v ), - Vector3::ZERO ) ); - - newMeshData.SetVertices( newVerts ); - newMeshData.SetFaceIndices( mFace ); + vert.mPosition.x = tlx; + vert.mPosition.y = baseLine; + vert.mTexCoords.x = ZERO; + vert.mTexCoords.y = ZERO; + newMesh.mVertices.PushBack( vert ); + + vert.mPosition.x = brx; + vert.mPosition.y = baseLine; + vert.mTexCoords.x = u; + newMesh.mVertices.PushBack( vert ); + + vert.mPosition.x = tlx; + vert.mPosition.y = baseLine + thickness; + vert.mTexCoords.x = ZERO; + vert.mTexCoords.y = v; + newMesh.mVertices.PushBack( vert ); + + vert.mPosition.x = brx; + vert.mPosition.y = baseLine + thickness; + vert.mTexCoords.x = u; + newMesh.mVertices.PushBack( vert ); + + // Six indices in counter clockwise winding + newMesh.mIndices.PushBack( faceIndex + 1u ); + newMesh.mIndices.PushBack( faceIndex ); + newMesh.mIndices.PushBack( faceIndex + 2u ); + newMesh.mIndices.PushBack( faceIndex + 2u ); + newMesh.mIndices.PushBack( faceIndex + 3u ); + newMesh.mIndices.PushBack( faceIndex + 1u ); + faceIndex += 4; if ( underlineColor == textColor ) { - mGlyphManager.StitchMesh( meshRecords[ index ].mMeshData, newMeshData ); + mGlyphManager.StitchMesh( meshRecords[ index ].mMesh, newMesh ); } else { MeshRecord record; - newMeshData.SetMaterial( meshRecords[ index ].mMeshData.GetMaterial() ); - newMeshData.SetHasNormals( true ); - newMeshData.SetHasColor( false ); - newMeshData.SetHasTextureCoords( true ); - record.mMeshData = newMeshData; + record.mMesh = newMesh; record.mAtlasId = meshRecords[ index ].mAtlasId; record.mColor = underlineColor; record.mIsUnderline = true; @@ -530,34 +599,34 @@ struct AtlasRenderer::Impl : public ConnectionTracker } } - MeshActor GenerateShadow( MeshRecord& meshRecord, - const Vector2& shadowOffset, - const Vector4& shadowColor ) + Actor GenerateShadow( MeshRecord& meshRecord, + const Vector2& shadowOffset, + const Vector4& shadowColor ) { // Scan vertex buffer to determine width and height of effect buffer needed - MeshData::VertexContainer verts = meshRecord.mMeshData.GetVertices(); - float tlx = verts[ 0 ].x; - float tly = verts[ 0 ].y; + const Vector< AtlasManager::Vertex2D >& verts = meshRecord.mMesh.mVertices; + float tlx = verts[ 0 ].mPosition.x; + float tly = verts[ 0 ].mPosition.y; float brx = ZERO; float bry = ZERO; - for ( uint32_t i = 0; i < verts.size(); ++i ) + for ( uint32_t i = 0; i < verts.Size(); ++i ) { - if ( verts[ i ].x < tlx ) + if ( verts[ i ].mPosition.x < tlx ) { - tlx = verts[ i ].x; + tlx = verts[ i ].mPosition.x; } - if ( verts[ i ].y < tly ) + if ( verts[ i ].mPosition.y < tly ) { - tly = verts[ i ].y; + tly = verts[ i ].mPosition.y; } - if ( verts[ i ].x > brx ) + if ( verts[ i ].mPosition.x > brx ) { - brx = verts[ i ].x; + brx = verts[ i ].mPosition.x; } - if ( verts[ i ].y > bry ) + if ( verts[ i ].mPosition.y > bry ) { - bry = verts[ i ].y; + bry = verts[ i ].mPosition.y; } } @@ -569,83 +638,79 @@ struct AtlasRenderer::Impl : public ConnectionTracker // Create a buffer to render to meshRecord.mBuffer = FrameBufferImage::New( width, height ); - // Create a mesh actor to contain the post-effect render - MeshData::VertexContainer vertices; - MeshData::FaceIndices face; - - vertices.push_back( MeshData::Vertex( Vector3( tlx + shadowOffset.x, tly + shadowOffset.y, ZERO ), - Vector2::ZERO, - Vector3::ZERO ) ); - - vertices.push_back( MeshData::Vertex( Vector3( brx + shadowOffset.x, tly + shadowOffset.y, ZERO ), - Vector2( ONE, ZERO ), - Vector3::ZERO ) ); - - vertices.push_back( MeshData::Vertex( Vector3( tlx + shadowOffset.x, bry + shadowOffset.y, ZERO ), - Vector2( ZERO, ONE ), - Vector3::ZERO ) ); - - vertices.push_back( MeshData::Vertex( Vector3( brx + shadowOffset.x, bry + shadowOffset.y, ZERO ), - Vector2::ONE, - Vector3::ZERO ) ); - - MeshData meshData; - Material newMaterial = Material::New("effect buffer"); - newMaterial.SetDiffuseTexture( meshRecord.mBuffer ); - meshData.SetMaterial( newMaterial ); - meshData.SetVertices( vertices ); - meshData.SetFaceIndices( mFace ); - meshData.SetHasNormals( true ); - meshData.SetHasColor( false ); - meshData.SetHasTextureCoords( true ); - MeshActor actor = MeshActor::New( Mesh::New( meshData ) ); - actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); - actor.SetShaderEffect( mBgraShader ); - actor.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR ); - actor.SetSortModifier( 0.1f ); // force behind main text - - // Create a sub actor to render once with normalized vertex positions - MeshData newMeshData; - MeshData::VertexContainer newVerts; - MeshData::FaceIndices newFaces; - MeshData::FaceIndices faces = meshRecord.mMeshData.GetFaces(); - for ( uint32_t i = 0; i < verts.size(); ++i ) + // We will render a quad into this buffer + unsigned short indices[ 6 ] = { 1, 0, 2, 2, 3, 1 }; + PropertyBuffer quadVertices = PropertyBuffer::New( PropertyBuffer::STATIC, mQuadVertexFormat, 4u ); + PropertyBuffer quadIndices = PropertyBuffer::New( PropertyBuffer::STATIC, mQuadIndexFormat, 3u ); + + AtlasManager::Vertex2D vertices[ 4 ] = { + { Vector2( tlx + shadowOffset.x, tly + shadowOffset.y ), Vector2( ZERO, ZERO ) }, + { Vector2( brx + shadowOffset.x, tly + shadowOffset.y ), Vector2( ONE, ZERO ) }, + { Vector2( tlx + shadowOffset.x, bry + shadowOffset.y ), Vector2( ZERO, ONE ) }, + { Vector2( brx + shadowOffset.x, bry + shadowOffset.y ), Vector2( ONE, ONE ) } }; + + quadVertices.SetData( vertices ); + quadIndices.SetData( indices ); + + Geometry quadGeometry = Geometry::New(); + quadGeometry.AddVertexBuffer( quadVertices ); + quadGeometry.SetIndexBuffer( quadIndices ); + + Sampler sampler = Sampler::New( meshRecord.mBuffer, "sTexture" ); + Material material = Material::New( mShader ); + material.AddSampler( sampler ); + + Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material ); + renderer.SetDepthIndex( 0.1f ); + Actor actor = Actor::New(); + actor.AddRenderer( renderer ); + actor.SetSize( 1.0f, 1.0f ); + + // Create a sub actor to render the source with normalized vertex positions + Vector< AtlasManager::Vertex2D > normVertexList; + Vector< unsigned short > normIndexList; + for ( uint32_t i = 0; i < verts.Size(); ++i ) { - MeshData::Vertex vertex = verts[ i ]; - vertex.x = ( ( vertex.x - tlx ) * divWidth ) - ONE; - vertex.y = ( ( vertex.y - tly ) * divHeight ) - ONE; - newVerts.push_back( vertex ); + AtlasManager::Vertex2D vertex = verts[ i ]; + vertex.mPosition.x = ( ( vertex.mPosition.x - tlx ) * divWidth ) - ONE; + vertex.mPosition.y = ( ( vertex.mPosition.y - tly ) * divHeight ) - ONE; + normVertexList.PushBack( vertex ); } - // Reverse triangle winding order - uint32_t faceCount = faces.size() / 3; - for ( uint32_t i = 0; i < faceCount; ++i ) + // Reverse winding + for ( uint32_t i = 0; i < meshRecord.mMesh.mIndices.Size() / 3; ++i ) { uint32_t index = i * 3; - newFaces.push_back( faces[ index + 2 ] ); - newFaces.push_back( faces[ index + 1 ] ); - newFaces.push_back( faces[ index ] ); + normIndexList.PushBack( meshRecord.mMesh.mIndices[ index + 2 ] ); + normIndexList.PushBack( meshRecord.mMesh.mIndices[ index + 1 ] ); + normIndexList.PushBack( meshRecord.mMesh.mIndices[ index ] ); } - newMeshData.SetMaterial( meshRecord.mMeshData.GetMaterial() ); - newMeshData.SetVertices( newVerts ); - newMeshData.SetFaceIndices( newFaces ); - newMeshData.SetHasNormals( true ); - newMeshData.SetHasColor( false ); - newMeshData.SetHasTextureCoords( true ); - - MeshActor subActor = MeshActor::New( Mesh::New( newMeshData ) ); + PropertyBuffer normVertices = PropertyBuffer::New( PropertyBuffer::STATIC, mQuadVertexFormat, normVertexList.Size() ); + PropertyBuffer normIndices = PropertyBuffer::New( PropertyBuffer::STATIC, mQuadIndexFormat, normIndexList.Size() >> 1 ); + normVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &normVertexList[ 0 ] ) ); + normIndices.SetData( const_cast< unsigned short* >( &normIndexList[ 0 ] ) ); + + Geometry normGeometry = Geometry::New(); + normGeometry.AddVertexBuffer( normVertices ); + normGeometry.SetIndexBuffer( normIndices ); + + Material normMaterial = mGlyphManager.GetMaterial( meshRecord.mAtlasId ); + normMaterial.SetShader( mShadowShader ); + Dali::Renderer normRenderer = Dali::Renderer::New( normGeometry, normMaterial ); + Actor subActor = Actor::New(); + subActor.AddRenderer( normRenderer ); + subActor.SetSize( 1.0f, 1.0f ); subActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); subActor.SetColor( shadowColor ); - subActor.SetShaderEffect( mBasicShadowShader ); - subActor.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST ); // Create a render task to render the effect RenderTask task = Stage::GetCurrent().GetRenderTaskList().CreateTask(); task.SetTargetFrameBuffer( meshRecord.mBuffer ); task.SetSourceActor( subActor ); task.SetClearEnabled( true ); - task.SetClearColor( Vector4::ZERO ); + task.SetClearColor( Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ); + //task.SetClearColor( Color::BLUE ); task.SetExclusive( true ); task.SetRefreshRate( RenderTask::REFRESH_ONCE ); task.FinishedSignal().Connect( this, &AtlasRenderer::Impl::RenderComplete ); @@ -671,15 +736,16 @@ struct AtlasRenderer::Impl : public ConnectionTracker } } - RenderableActor mActor; ///< The actor parent which renders the text + Actor mActor; ///< The actor parent which renders the text AtlasGlyphManager mGlyphManager; ///< Glyph Manager to handle upload and caching Vector< uint32_t > mImageIds; ///< A list of imageIDs used by the renderer TextAbstraction::FontClient mFontClient; ///> The font client used to supply glyph information - ShaderEffect mBasicShader; ///> Shader used to render L8 glyphs - ShaderEffect mBgraShader; ///> Shader used to render BGRA glyphs - ShaderEffect mBasicShadowShader; ///> Shader used to render drop shadow into buffer + Shader mShader; ///> Shader used to render drop shadow buffer textures + Shader mShadowShader; ///> Shader used to render drop shadow into buffer std::vector< MaxBlockSize > mBlockSizes; ///> Maximum size needed to contain a glyph in a block within a new atlas - std::vector< MeshData::FaceIndex > mFace; ///> Face indices for a quad + std::vector< uint32_t > mFace; ///> Face indices for a quad + Property::Map mQuadVertexFormat; + Property::Map mQuadIndexFormat; }; Text::RendererPtr AtlasRenderer::New() @@ -687,7 +753,7 @@ Text::RendererPtr AtlasRenderer::New() return Text::RendererPtr( new AtlasRenderer() ); } -RenderableActor AtlasRenderer::Render( Text::ViewInterface& view ) +Actor AtlasRenderer::Render( Text::ViewInterface& view ) { UnparentAndReset( mImpl->mActor ); diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h index e259621..7bc6177 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h @@ -50,7 +50,7 @@ public: * @param[in] view The interface to a view. * @return The Renderable actor used to position the text. */ - virtual RenderableActor Render( ViewInterface& view ); + virtual Actor Render( ViewInterface& view ); protected: diff --git a/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp b/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp index dc6ec3e..d64a03b 100644 --- a/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp @@ -21,9 +21,7 @@ // INTERNAL INCLUDES #include #include -#include #include -#include #include #include @@ -266,6 +264,7 @@ struct BasicRenderer::Impl * @param[in] positions The 2D positions of the glyphs. * @param[in] image The material uses this as a diffuse texture. */ + /* Mesh CreateMesh( const Vector& glyphs, const std::vector& positions, Pixel::Format format, Image image ) { MeshData::VertexContainer vertices( 4 * glyphs.Count() ); // 1 quad per glyph @@ -311,8 +310,8 @@ struct BasicRenderer::Impl Dali::Mesh mesh = Mesh::New( meshData ); return mesh; } - - RenderableActor mActor; ///< The actor which renders the text + */ + Actor mActor; ///< The actor which renders the text Atlas mAtlasL8; unsigned int mWidthL8; @@ -333,7 +332,7 @@ Text::RendererPtr BasicRenderer::New() return Text::RendererPtr( new BasicRenderer() ); } -RenderableActor BasicRenderer::Render( Text::ViewInterface& view ) +Actor BasicRenderer::Render( Text::ViewInterface& view ) { // Remove the previous text UnparentAndReset( mImpl->mActor ); @@ -353,24 +352,24 @@ RenderableActor BasicRenderer::Render( Text::ViewInterface& view ) mImpl->CreateAtlases( glyphs ); - MeshActor actorL8; + Actor actorL8; if( mImpl->mAtlasL8 ) { - actorL8 = MeshActor::New( mImpl->CreateMesh( glyphs, positions, Pixel::L8, mImpl->mAtlasL8 ) ); + //actorL8 = MeshActor::New( mImpl->CreateMesh( glyphs, positions, Pixel::L8, mImpl->mAtlasL8 ) ); actorL8.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); ShaderEffect shader = BasicShader::New(); - actorL8.SetShaderEffect( shader ); + //actorL8.SetShaderEffect( shader ); } - MeshActor actorBGRA8888; + Actor actorBGRA8888; if( mImpl->mAtlasBGRA8888 ) { - actorBGRA8888 = MeshActor::New( mImpl->CreateMesh( glyphs, positions, Pixel::BGRA8888, mImpl->mAtlasBGRA8888 ) ); + //actorBGRA8888 = MeshActor::New( mImpl->CreateMesh( glyphs, positions, Pixel::BGRA8888, mImpl->mAtlasBGRA8888 ) ); actorBGRA8888.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); ShaderEffect shader = BgraShader::New(); - actorBGRA8888.SetShaderEffect( shader ); + //actorBGRA8888.SetShaderEffect( shader ); } // If we have both monochrome & color glyphs, two mesh actors are returned in a container diff --git a/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h b/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h index 1cf8469..6a7e1a0 100644 --- a/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h +++ b/dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h @@ -53,7 +53,7 @@ public: * @param[in] view The interface to a view. * @return The Renderable actor used to position the text. */ - virtual RenderableActor Render( ViewInterface& view ); + virtual Actor Render( ViewInterface& view ); protected: diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp index 0afddbb..3ea7154 100644 --- a/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp +++ b/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp @@ -17,6 +17,7 @@ // CLASS HEADER #include +#include namespace Dali { diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp deleted file mode 100644 index f7789f1..0000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2015 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. - * - */ - -// CLASS HEADER -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Text -{ - -namespace BasicShadowShader -{ - -Dali::ShaderEffect New() -{ - std::string vertexShader = DALI_COMPOSE_SHADER( - void main()\n - {\n - gl_Position = vec4( aPosition.xy, 0.0, 1.0 );\n - vTexCoord = aTexCoord.xy;\n - }\n - ); - - std::string fragmentShader = DALI_COMPOSE_SHADER( - void main()\n - {\n - mediump vec4 color = texture2D( sTexture, vTexCoord ); - gl_FragColor = vec4(uColor.rgb, uColor.a*color.r); - }\n - ); - - Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader, - Dali::GeometryType( Dali::GEOMETRY_TYPE_TEXTURED_MESH ), - Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) ); - return shaderEffect; -} - -} // namespace BasicShadowShader - -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h b/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h deleted file mode 100644 index 93bd0a3..0000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef __DALI_TOOLKIT_TEXT_BASIC_SHADOW_SHADER_H__ -#define __DALI_TOOLKIT_TEXT_BASIC_SHADOW_SHADER_H__ - -/* - * Copyright (c) 2015 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. - * - */ - -// EXTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Text -{ - -/** - * @brief A basic shader for rendering glyphs in Pixel::L8 format. - */ -namespace BasicShadowShader -{ - -/** - * Create a basic text shadow shader. - * @return A handle to a newly allocated ShaderEffect - */ -Dali::ShaderEffect New(); - -} // namespace BasicShadowShader - -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_TEXT_BASIC_SHADOW_SHADER_H__ diff --git a/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp index 7f2f2a5..ac4c0d6 100644 --- a/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp +++ b/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp @@ -17,6 +17,7 @@ // INTERNAL HEADERS #include +#include namespace Dali { diff --git a/dali-toolkit/internal/text/rendering/text-renderer.h b/dali-toolkit/internal/text/rendering/text-renderer.h index 3485f16..1262c90 100644 --- a/dali-toolkit/internal/text/rendering/text-renderer.h +++ b/dali-toolkit/internal/text/rendering/text-renderer.h @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include #include #include @@ -54,7 +54,7 @@ public: * @param[in] view The interface to a view. * @return The Renderable actor used to position the text. */ - virtual RenderableActor Render( ViewInterface& view ) = 0; + virtual Actor Render( ViewInterface& view ) = 0; protected: diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index f7f1739..f39effe 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -21,6 +21,17 @@ // EXTERNAL INCLUDES #include +// INTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace { @@ -96,13 +107,19 @@ void GetGlyphsMetrics( GlyphIndex glyphIndex, EventData::EventData( DecoratorPtr decorator ) : mDecorator( decorator ), - mPlaceholderText(), + mPlaceholderTextActive(), + mPlaceholderTextInactive(), + mPlaceholderTextColor( 0.8f, 0.8f, 0.8f, 0.8f ), mEventQueue(), mScrollPosition(), mState( INACTIVE ), mPrimaryCursorPosition( 0u ), mLeftSelectionPosition( 0u ), mRightSelectionPosition( 0u ), + mPreEditStartPosition( 0u ), + mPreEditLength( 0u ), + mIsShowingPlaceholderText( false ), + mPreEditFlag( false ), mDecoratorUpdated( false ), mCursorBlinkEnabled( true ), mGrabHandleEnabled( true ), @@ -221,6 +238,243 @@ bool Controller::Impl::ProcessInputEvents() return mEventData->mDecoratorUpdated; } +void Controller::Impl::ReplaceTextWithPlaceholder() +{ + DALI_ASSERT_DEBUG( mEventData && "No placeholder text available" ); + if( !mEventData ) + { + return; + } + + // Disable handles when showing place-holder text + mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false ); + mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false ); + mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false ); + + const char* text( NULL ); + size_t size( 0 ); + + if( EventData::INACTIVE != mEventData->mState && + 0u != mEventData->mPlaceholderTextActive.c_str() ) + { + text = mEventData->mPlaceholderTextActive.c_str(); + size = mEventData->mPlaceholderTextActive.size(); + } + + else + { + text = mEventData->mPlaceholderTextInactive.c_str(); + size = mEventData->mPlaceholderTextInactive.size(); + } + + // Reset buffers. + mLogicalModel->mText.Clear(); + mLogicalModel->mScriptRuns.Clear(); + mLogicalModel->mFontRuns.Clear(); + mLogicalModel->mLineBreakInfo.Clear(); + mLogicalModel->mWordBreakInfo.Clear(); + mLogicalModel->mBidirectionalParagraphInfo.Clear(); + mLogicalModel->mCharacterDirections.Clear(); + mLogicalModel->mBidirectionalLineInfo.Clear(); + mLogicalModel->mLogicalToVisualMap.Clear(); + mLogicalModel->mVisualToLogicalMap.Clear(); + mVisualModel->mGlyphs.Clear(); + mVisualModel->mGlyphsToCharacters.Clear(); + mVisualModel->mCharactersToGlyph.Clear(); + mVisualModel->mCharactersPerGlyph.Clear(); + mVisualModel->mGlyphsPerCharacter.Clear(); + mVisualModel->mGlyphPositions.Clear(); + mVisualModel->mLines.Clear(); + mVisualModel->ClearCaches(); + mVisualModel->SetTextColor( mEventData->mPlaceholderTextColor ); + + // Convert text into UTF-32 + Vector& utf32Characters = mLogicalModel->mText; + utf32Characters.Resize( size ); + + // This is a bit horrible but std::string returns a (signed) char* + const uint8_t* utf8 = reinterpret_cast( text ); + + // Transform a text array encoded in utf8 into an array encoded in utf32. + // It returns the actual number of characters. + Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() ); + utf32Characters.Resize( characterCount ); + + // Reset the cursor position + mEventData->mPrimaryCursorPosition = 0; + + // The natural size needs to be re-calculated. + mRecalculateNaturalSize = true; + + // Apply modifications to the model + mOperationsPending = ALL_OPERATIONS; + UpdateModel( ALL_OPERATIONS ); + mOperationsPending = static_cast( LAYOUT | + ALIGN | + UPDATE_ACTUAL_SIZE | + REORDER ); +} + +void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) +{ + // Calculate the operations to be done. + const OperationsMask operations = static_cast( mOperationsPending & operationsRequired ); + + Vector& utf32Characters = mLogicalModel->mText; + + const Length numberOfCharacters = mLogicalModel->GetNumberOfCharacters(); + + Vector& lineBreakInfo = mLogicalModel->mLineBreakInfo; + if( GET_LINE_BREAKS & operations ) + { + // Retrieves the line break info. The line break info is used to split the text in 'paragraphs' to + // calculate the bidirectional info for each 'paragraph'. + // It's also used to layout the text (where it should be a new line) or to shape the text (text in different lines + // is not shaped together). + lineBreakInfo.Resize( numberOfCharacters, TextAbstraction::LINE_NO_BREAK ); + + SetLineBreakInfo( utf32Characters, + lineBreakInfo ); + } + + Vector& wordBreakInfo = mLogicalModel->mWordBreakInfo; + if( GET_WORD_BREAKS & operations ) + { + // Retrieves the word break info. The word break info is used to layout the text (where to wrap the text in lines). + wordBreakInfo.Resize( numberOfCharacters, TextAbstraction::WORD_NO_BREAK ); + + SetWordBreakInfo( utf32Characters, + wordBreakInfo ); + } + + const bool getScripts = GET_SCRIPTS & operations; + const bool validateFonts = VALIDATE_FONTS & operations; + + Vector& scripts = mLogicalModel->mScriptRuns; + Vector& validFonts = mLogicalModel->mFontRuns; + + if( getScripts || validateFonts ) + { + // Validates the fonts assigned by the application or assigns default ones. + // It makes sure all the characters are going to be rendered by the correct font. + MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get(); + + if( getScripts ) + { + // Retrieves the scripts used in the text. + multilanguageSupport.SetScripts( utf32Characters, + lineBreakInfo, + scripts ); + } + + if( validateFonts ) + { + if( 0u == validFonts.Count() ) + { + // Copy the requested font defaults received via the property system. + // These may not be valid i.e. may not contain glyphs for the necessary scripts. + GetDefaultFonts( validFonts, numberOfCharacters ); + } + + // Validates the fonts. If there is a character with no assigned font it sets a default one. + // After this call, fonts are validated. + multilanguageSupport.ValidateFonts( utf32Characters, + scripts, + validFonts ); + } + } + + Vector mirroredUtf32Characters; + bool textMirrored = false; + if( BIDI_INFO & operations ) + { + // Count the number of LINE_NO_BREAK to reserve some space for the vector of paragraph's + // bidirectional info. + + Length numberOfParagraphs = 0u; + + const TextAbstraction::LineBreakInfo* lineBreakInfoBuffer = lineBreakInfo.Begin(); + for( Length index = 0u; index < numberOfCharacters; ++index ) + { + if( TextAbstraction::LINE_NO_BREAK == *( lineBreakInfoBuffer + index ) ) + { + ++numberOfParagraphs; + } + } + + Vector& bidirectionalInfo = mLogicalModel->mBidirectionalParagraphInfo; + bidirectionalInfo.Reserve( numberOfParagraphs ); + + // Calculates the bidirectional info for the whole paragraph if it contains right to left scripts. + SetBidirectionalInfo( utf32Characters, + scripts, + lineBreakInfo, + bidirectionalInfo ); + + if( 0u != bidirectionalInfo.Count() ) + { + // This paragraph has right to left text. Some characters may need to be mirrored. + // TODO: consider if the mirrored string can be stored as well. + + textMirrored = GetMirroredText( utf32Characters, mirroredUtf32Characters ); + + // Only set the character directions if there is right to left characters. + Vector& directions = mLogicalModel->mCharacterDirections; + directions.Resize( numberOfCharacters ); + + GetCharactersDirection( bidirectionalInfo, + directions ); + } + else + { + // There is no right to left characters. Clear the directions vector. + mLogicalModel->mCharacterDirections.Clear(); + } + + } + + Vector& glyphs = mVisualModel->mGlyphs; + Vector& glyphsToCharactersMap = mVisualModel->mGlyphsToCharacters; + Vector& charactersPerGlyph = mVisualModel->mCharactersPerGlyph; + if( SHAPE_TEXT & operations ) + { + const Vector& textToShape = textMirrored ? mirroredUtf32Characters : utf32Characters; + // Shapes the text. + ShapeText( textToShape, + lineBreakInfo, + scripts, + validFonts, + glyphs, + glyphsToCharactersMap, + charactersPerGlyph ); + + // Create the 'number of glyphs' per character and the glyph to character conversion tables. + mVisualModel->CreateGlyphsPerCharacterTable( numberOfCharacters ); + mVisualModel->CreateCharacterToGlyphTable( numberOfCharacters ); + } + + const Length numberOfGlyphs = glyphs.Count(); + + if( GET_GLYPH_METRICS & operations ) + { + mFontClient.GetGlyphMetrics( glyphs.Begin(), numberOfGlyphs ); + } +} + +void Controller::Impl::GetDefaultFonts( Vector& fonts, Length numberOfCharacters ) +{ + if( mFontDefaults ) + { + FontRun fontRun; + fontRun.characterRun.characterIndex = 0; + fontRun.characterRun.numberOfCharacters = numberOfCharacters; + fontRun.fontId = mFontDefaults->GetFontId( mFontClient ); + fontRun.isDefault = true; + + fonts.PushBack( fontRun ); + } +} + void Controller::Impl::OnKeyboardFocus( bool hasFocus ) { if( NULL == mEventData ) @@ -276,16 +530,6 @@ void Controller::Impl::OnCursorKeyEvent( const Event& event ) mEventData->mScrollAfterUpdateCursorPosition = true; } -void Controller::Impl::HandleCursorKey( int keyCode ) -{ - // TODO - if( NULL == mEventData ) - { - // Nothing to do if there is no text input. - return; - } -} - void Controller::Impl::OnTapEvent( const Event& event ) { if( NULL == mEventData ) @@ -298,6 +542,17 @@ void Controller::Impl::OnTapEvent( const Event& event ) if( 1u == tapCount ) { + // Grab handle is not shown until a tap is received whilst EDITING + if( EventData::EDITING == mEventData->mState && + !IsShowingPlaceholderText() ) + { + if( mEventData->mGrabHandleEnabled ) + { + mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true ); + } + mEventData->mDecorator->SetPopupActive( false ); + } + ChangeState( EventData::EDITING ); const float xPosition = event.p2.mFloat - mEventData->mScrollPosition.x - mAlignmentOffset.x; @@ -485,8 +740,23 @@ void Controller::Impl::ChangeState( EventData::State newState ) if( mEventData->mState != newState ) { + // Show different placeholder when switching between active & inactive + bool updatePlaceholder( false ); + if( IsShowingPlaceholderText() && + ( EventData::INACTIVE == newState || + EventData::INACTIVE == mEventData->mState ) ) + { + updatePlaceholder = true; + } + mEventData->mState = newState; + if( updatePlaceholder ) + { + ReplaceTextWithPlaceholder(); + mEventData->mDecoratorUpdated = true; + } + if( EventData::INACTIVE == mEventData->mState ) { mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE ); @@ -513,14 +783,8 @@ void Controller::Impl::ChangeState( EventData::State newState ) { mEventData->mDecorator->StartCursorBlink(); } - if( mEventData->mGrabHandleEnabled ) - { - mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true ); - } - if( mEventData->mGrabHandlePopupEnabled ) - { - mEventData->mDecorator->SetPopupActive( false ); - } + // Grab handle is not shown until a tap is received whilst EDITING + mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false ); mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false ); mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false ); mEventData->mDecoratorUpdated = true; @@ -532,7 +796,8 @@ void Controller::Impl::ChangeState( EventData::State newState ) { mEventData->mDecorator->StartCursorBlink(); } - if( mEventData->mGrabHandleEnabled ) + mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false ); + if( mEventData->mSelectionEnabled ) { mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true ); mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true ); @@ -541,8 +806,6 @@ void Controller::Impl::ChangeState( EventData::State newState ) { mEventData->mDecorator->SetPopupActive( true ); } - mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false ); - mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false ); mEventData->mDecoratorUpdated = true; } } diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 51927a6..9295d5f 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -109,7 +110,9 @@ struct EventData ~EventData(); DecoratorPtr mDecorator; ///< Pointer to the decorator - std::string mPlaceholderText; ///< The plaxe holder text + std::string mPlaceholderTextActive; ///< The text to display when the TextField is empty with key-input focus + std::string mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive + Vector4 mPlaceholderTextColor; ///< The in/active placeholder text color /** * This is used to delay handling events until after the model has been updated. @@ -129,30 +132,35 @@ struct EventData CharacterIndex mLeftSelectionPosition; ///< Index into logical model for left selection handle. CharacterIndex mRightSelectionPosition; ///< Index into logical model for right selection handle. - bool mDecoratorUpdated : 1; ///< True if the decorator was updated during event processing. - bool mCursorBlinkEnabled : 1; ///< True if cursor should blink when active. - bool mGrabHandleEnabled : 1; ///< True if grab handle is enabled. - bool mGrabHandlePopupEnabled : 1; ///< True if the grab handle popu-up should be shown. - bool mSelectionEnabled : 1; ///< True if selection handles, highlight etc. are enabled. - bool mHorizontalScrollingEnabled : 1; ///< True if horizontal scrolling is enabled. - bool mVerticalScrollingEnabled : 1; ///< True if vertical scrolling is enabled. - bool mUpdateCursorPosition : 1; ///< True if the visual position of the cursor must be recalculated. - bool mUpdateLeftSelectionPosition : 1; ///< True if the visual position of the left selection handle must be recalculated. - bool mUpdateRightSelectionPosition : 1; ///< True if the visual position of the right selection handle must be recalculated. - bool mScrollAfterUpdateCursorPosition : 1; ///< Whether to scroll after the cursor position is updated. + CharacterIndex mPreEditStartPosition; ///< Used to remove the pre-edit text if necessary. + Length mPreEditLength; ///< Used to remove the pre-edit text if necessary. + + bool mIsShowingPlaceholderText : 1; ///< True if the place-holder text is being displayed. + bool mPreEditFlag : 1; ///< True if the model contains text in pre-edit state. + bool mDecoratorUpdated : 1; ///< True if the decorator was updated during event processing. + bool mCursorBlinkEnabled : 1; ///< True if cursor should blink when active. + bool mGrabHandleEnabled : 1; ///< True if grab handle is enabled. + bool mGrabHandlePopupEnabled : 1; ///< True if the grab handle popu-up should be shown. + bool mSelectionEnabled : 1; ///< True if selection handles, highlight etc. are enabled. + bool mHorizontalScrollingEnabled : 1; ///< True if horizontal scrolling is enabled. + bool mVerticalScrollingEnabled : 1; ///< True if vertical scrolling is enabled. + bool mUpdateCursorPosition : 1; ///< True if the visual position of the cursor must be recalculated. + bool mUpdateLeftSelectionPosition : 1; ///< True if the visual position of the left selection handle must be recalculated. + bool mUpdateRightSelectionPosition : 1; ///< True if the visual position of the right selection handle must be recalculated. + bool mScrollAfterUpdateCursorPosition : 1; ///< Whether to scroll after the cursor position is updated. }; struct ModifyEvent { enum Type { - REPLACE_TEXT, ///< Replace the entire text - INSERT_TEXT, ///< Insert characters at the current cursor position - DELETE_TEXT ///< Delete a character at the current cursor position + PLACEHOLDER_TEXT, ///< Show the placeholder text if necessary + TEXT_REPLACED, ///< The entire text was replaced + TEXT_INSERTED, ///< Insert characters at the current cursor position + TEXT_DELETED ///< Characters were deleted }; Type type; - std::string text; }; struct FontDefaults @@ -193,6 +201,7 @@ struct Controller::Impl mLayoutEngine(), mModifyEvents(), mControlSize(), + mTextColor( Color::BLACK ), mAlignmentOffset(), mOperationsPending( NO_OPERATION ), mMaximumNumberOfCharacters( 50 ), @@ -206,9 +215,6 @@ struct Controller::Impl mView.SetVisualModel( mVisualModel ); // Set the text properties to default - mVisualModel->SetTextColor( Color::WHITE ); - mVisualModel->SetShadowOffset( Vector2::ZERO ); - mVisualModel->SetShadowColor( Color::BLACK ); mVisualModel->SetUnderlineEnabled( false ); mVisualModel->SetUnderlineHeight( 0.0f ); } @@ -224,16 +230,93 @@ struct Controller::Impl void RequestRelayout(); /** + * @brief Request a relayout using the ControlInterface. + */ + void QueueModifyEvent( ModifyEvent::Type type ) + { + ModifyEvent event; + event.type = type; + mModifyEvents.push_back( event ); + + // The event will be processed during relayout + RequestRelayout(); + } + + /** * @brief Helper to move the cursor, grab handle etc. */ bool ProcessInputEvents(); + /** + * @brief Helper to check whether any place-holder text is available. + */ + bool IsPlaceholderAvailable() const + { + return ( mEventData && + ( !mEventData->mPlaceholderTextInactive.empty() || + !mEventData->mPlaceholderTextActive.empty() ) + ); + } + + bool IsShowingPlaceholderText() const + { + return ( mEventData && mEventData->mIsShowingPlaceholderText ); + } + + void ShowPlaceholderText() + { + if( IsPlaceholderAvailable() ) + { + mEventData->mIsShowingPlaceholderText = true; + + // Placeholder-text is dependent on focus state i.e. replace after event processing + QueueModifyEvent( ModifyEvent::PLACEHOLDER_TEXT ); + } + } + + /** + * @brief Called when placeholder-text is hidden + */ + void PlaceholderCleared() + { + if( mEventData ) + { + mEventData->mIsShowingPlaceholderText = false; + + // Remove mPlaceholderTextColor + mVisualModel->SetTextColor( mTextColor ); + } + } + + void PreEditReset() + { + // Reset incase we are in a pre-edit state. + ImfManager imfManager = ImfManager::Get(); + if ( imfManager ) + { + imfManager.Reset(); // Will trigger a commit message + } + } + + /** + * @brief Called when placeholder-text is shown + */ + void ReplaceTextWithPlaceholder(); + + void UpdateModel( OperationsMask operationsRequired ); + + /** + * @brief Retrieve the default fonts. + * + * @param[out] fonts The default font family, style and point sizes. + * @param[in] numberOfCharacters The number of characters in the logical model. + */ + void GetDefaultFonts( Dali::Vector& fonts, Length numberOfCharacters ); + void OnKeyboardFocus( bool hasFocus ); void OnCursorKeyEvent( const Event& event ); - void HandleCursorKey( int keyCode ); - void OnTapEvent( const Event& event ); void OnPanEvent( const Event& event ); @@ -328,6 +411,7 @@ struct Controller::Impl LayoutEngine mLayoutEngine; ///< The layout engine. std::vector mModifyEvents; ///< Temporary stores the text set until the next relayout. Size mControlSize; ///< The size of the control. + Vector4 mTextColor; ///< The regular text color Vector2 mAlignmentOffset; ///< Vertical and horizontal offset of the whole text inside the control due to alignment. OperationsMask mOperationsPending; ///< Operations pending to be done to layout the text. Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted. diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index d599bdd..95102d9 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include #include // INTERNAL INCLUDES @@ -62,47 +63,104 @@ void Controller::SetText( const std::string& text ) // Cancel previously queued inserts etc. mImpl->mModifyEvents.clear(); - // Keep until size negotiation - ModifyEvent event; - event.type = ModifyEvent::REPLACE_TEXT; - event.text = text; - mImpl->mModifyEvents.push_back( event ); + // Remove the previously set text + ResetText(); + + if( ! text.empty() ) + { + // Convert text into UTF-32 + Vector& utf32Characters = mImpl->mLogicalModel->mText; + utf32Characters.Resize( text.size() ); + + // This is a bit horrible but std::string returns a (signed) char* + const uint8_t* utf8 = reinterpret_cast( text.c_str() ); + + // Transform a text array encoded in utf8 into an array encoded in utf32. + // It returns the actual number of characters. + Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() ); + utf32Characters.Resize( characterCount ); + + // Reset the cursor position + if( mImpl->mEventData ) + { + mImpl->mEventData->mPrimaryCursorPosition = characterCount; + } + + // Update the rest of the model during size negotiation + mImpl->QueueModifyEvent( ModifyEvent::TEXT_REPLACED ); + } + else + { + mImpl->ShowPlaceholderText(); + } if( mImpl->mEventData ) { // Cancel previously queued events mImpl->mEventData->mEventQueue.clear(); - - // TODO - Hide selection decorations } + + // Reset keyboard as text changed + mImpl->PreEditReset(); } void Controller::GetText( std::string& text ) const { - if( !mImpl->mModifyEvents.empty() && - ModifyEvent::REPLACE_TEXT == mImpl->mModifyEvents[0].type ) + if( ! mImpl->IsShowingPlaceholderText() ) { - text = mImpl->mModifyEvents[0].text; + Vector& utf32Characters = mImpl->mLogicalModel->mText; + + if( 0u != utf32Characters.Count() ) + { + uint32_t numberOfBytes = GetNumberOfUtf8Bytes( &utf32Characters[0], utf32Characters.Count() ); + + text.resize( numberOfBytes ); + + // This is a bit horrible but std::string returns a (signed) char* + Utf32ToUtf8( &utf32Characters[0], utf32Characters.Count(), reinterpret_cast(&text[0]) ); + } } - else +} + +unsigned int Controller::GetLogicalCursorPosition() const +{ + if( mImpl->mEventData ) { - // TODO - Convert from UTF-32 + return mImpl->mEventData->mPrimaryCursorPosition; } + + return 0u; } -void Controller::SetPlaceholderText( const std::string& text ) +void Controller::SetPlaceholderText( PlaceholderType type, const std::string& text ) { - if( !mImpl->mEventData ) + if( mImpl->mEventData ) { - mImpl->mEventData->mPlaceholderText = text; + if( PLACEHOLDER_TYPE_INACTIVE == type ) + { + mImpl->mEventData->mPlaceholderTextInactive = text; + } + else + { + mImpl->mEventData->mPlaceholderTextActive = text; + } + + mImpl->ShowPlaceholderText(); } } -void Controller::GetPlaceholderText( std::string& text ) const +void Controller::GetPlaceholderText( PlaceholderType type, std::string& text ) const { - if( !mImpl->mEventData ) + if( mImpl->mEventData ) { - text = mImpl->mEventData->mPlaceholderText; + if( PLACEHOLDER_TYPE_INACTIVE == type ) + { + text = mImpl->mEventData->mPlaceholderTextInactive; + } + else + { + text = mImpl->mEventData->mPlaceholderTextActive; + } } } @@ -227,28 +285,83 @@ float Controller::GetDefaultPointSize() const return 0.0f; } -void Controller::GetDefaultFonts( Vector& fonts, Length numberOfCharacters ) const +void Controller::SetTextColor( const Vector4& textColor ) { - if( mImpl->mFontDefaults ) + mImpl->mTextColor = textColor; + + if( ! mImpl->IsShowingPlaceholderText() ) { - FontRun fontRun; - fontRun.characterRun.characterIndex = 0; - fontRun.characterRun.numberOfCharacters = numberOfCharacters; - fontRun.fontId = mImpl->mFontDefaults->GetFontId( mImpl->mFontClient ); - fontRun.isDefault = true; + mImpl->mVisualModel->SetTextColor( textColor ); + } +} + +const Vector4& Controller::GetTextColor() const +{ + return mImpl->mTextColor; +} + +bool Controller::RemoveText( int cursorOffset, int numberOfChars ) +{ + bool removed( false ); + + if( ! mImpl->IsShowingPlaceholderText() ) + { + // Delete at current cursor position + Vector& currentText = mImpl->mLogicalModel->mText; + CharacterIndex& oldCursorIndex = mImpl->mEventData->mPrimaryCursorPosition; + + CharacterIndex cursorIndex = oldCursorIndex; + + // Validate the cursor position & number of characters + if( static_cast< CharacterIndex >( std::abs( cursorOffset ) ) <= cursorIndex ) + { + cursorIndex = oldCursorIndex + cursorOffset; + } + + if( (cursorIndex + numberOfChars) > currentText.Count() ) + { + numberOfChars = currentText.Count() - cursorIndex; + } + + if( cursorIndex >= 0 && + (cursorIndex + numberOfChars) <= currentText.Count() ) + { + Vector::Iterator first = currentText.Begin() + cursorIndex; + Vector::Iterator last = first + numberOfChars; - fonts.PushBack( fontRun ); + currentText.Erase( first, last ); + + // Cursor position retreat + oldCursorIndex = cursorIndex; + + removed = true; + } } + + return removed; } -void Controller::SetTextColor( const Vector4& textColor ) +void Controller::SetPlaceholderTextColor( const Vector4& textColor ) { - mImpl->mVisualModel->SetTextColor( textColor ); + if( mImpl->mEventData ) + { + mImpl->mEventData->mPlaceholderTextColor = textColor; + } + + if( mImpl->IsShowingPlaceholderText() ) + { + mImpl->mVisualModel->SetTextColor( textColor ); + } } -const Vector4& Controller::GetTextColor() const +const Vector4& Controller::GetPlaceholderTextColor() const { - return mImpl->mVisualModel->GetTextColor(); + if( mImpl->mEventData ) + { + return mImpl->mEventData->mPlaceholderTextColor; + } + + return Color::BLACK; } void Controller::SetShadowOffset( const Vector2& shadowOffset ) @@ -369,7 +482,7 @@ Vector3 Controller::GetNaturalSize() SHAPE_TEXT | GET_GLYPH_METRICS ); // Make sure the model is up-to-date before layouting - UpdateModel( onlyOnceOperations ); + mImpl->UpdateModel( onlyOnceOperations ); // Operations that need to be done if the size changes. const OperationsMask sizeOperations = static_cast( LAYOUT | @@ -419,7 +532,7 @@ float Controller::GetHeightForWidth( float width ) SHAPE_TEXT | GET_GLYPH_METRICS ); // Make sure the model is up-to-date before layouting - UpdateModel( onlyOnceOperations ); + mImpl->UpdateModel( onlyOnceOperations ); // Operations that need to be done if the size changes. const OperationsMask sizeOperations = static_cast( LAYOUT | @@ -473,7 +586,7 @@ bool Controller::Relayout( const Size& size ) // Make sure the model is up-to-date before layouting ProcessModifyEvents(); - UpdateModel( mImpl->mOperationsPending ); + mImpl->UpdateModel( mImpl->mOperationsPending ); Size layoutSize; bool updated = DoRelayout( mImpl->mControlSize, @@ -501,20 +614,33 @@ void Controller::ProcessModifyEvents() for( unsigned int i=0; imLogicalModel->mText.Count() && + mImpl->IsShowingPlaceholderText() ) + { + mImpl->ReplaceTextWithPlaceholder(); + } + } + else if( ModifyEvent::TEXT_REPLACED == events[0].type ) { // A (single) replace event should come first, otherwise we wasted time processing NOOP events - DALI_ASSERT_DEBUG( 0 == i && "Unexpected REPLACE event" ); + DALI_ASSERT_DEBUG( 0 == i && "Unexpected TEXT_REPLACED event" ); - ReplaceTextEvent( events[0].text ); + TextReplacedEvent(); } - else if( ModifyEvent::INSERT_TEXT == events[0].type ) + else if( ModifyEvent::TEXT_INSERTED == events[0].type ) { - InsertTextEvent( events[0].text ); + TextInsertedEvent(); } - else if( ModifyEvent::DELETE_TEXT == events[0].type ) + else if( ModifyEvent::TEXT_DELETED == events[0].type ) { - DeleteTextEvent(); + // Placeholder-text cannot be deleted + if( !mImpl->IsShowingPlaceholderText() ) + { + TextDeletedEvent(); + } } } @@ -522,7 +648,7 @@ void Controller::ProcessModifyEvents() events.clear(); } -void Controller::ReplaceTextEvent( const std::string& text ) +void Controller::ResetText() { // Reset buffers. mImpl->mLogicalModel->mText.Clear(); @@ -544,40 +670,58 @@ void Controller::ReplaceTextEvent( const std::string& text ) mImpl->mVisualModel->mLines.Clear(); mImpl->mVisualModel->ClearCaches(); - // Convert text into UTF-32 - Vector& utf32Characters = mImpl->mLogicalModel->mText; - utf32Characters.Resize( text.size() ); - - // This is a bit horrible but std::string returns a (signed) char* - const uint8_t* utf8 = reinterpret_cast( text.c_str() ); - - // Transform a text array encoded in utf8 into an array encoded in utf32. - // It returns the actual number of characters. - Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() ); - utf32Characters.Resize( characterCount ); - // Reset the cursor position if( mImpl->mEventData ) { - mImpl->mEventData->mPrimaryCursorPosition = characterCount; - // TODO - handle secondary cursor + mImpl->mEventData->mPrimaryCursorPosition = 0; } + // We have cleared everything including the placeholder-text + mImpl->PlaceholderCleared(); + + // The natural size needs to be re-calculated. + mImpl->mRecalculateNaturalSize = true; + + // Apply modifications to the model + mImpl->mOperationsPending = ALL_OPERATIONS; +} + +void Controller::TextReplacedEvent() +{ + // Reset buffers. + mImpl->mLogicalModel->mScriptRuns.Clear(); + mImpl->mLogicalModel->mFontRuns.Clear(); + mImpl->mLogicalModel->mLineBreakInfo.Clear(); + mImpl->mLogicalModel->mWordBreakInfo.Clear(); + mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear(); + mImpl->mLogicalModel->mCharacterDirections.Clear(); + mImpl->mLogicalModel->mBidirectionalLineInfo.Clear(); + mImpl->mLogicalModel->mLogicalToVisualMap.Clear(); + mImpl->mLogicalModel->mVisualToLogicalMap.Clear(); + mImpl->mVisualModel->mGlyphs.Clear(); + mImpl->mVisualModel->mGlyphsToCharacters.Clear(); + mImpl->mVisualModel->mCharactersToGlyph.Clear(); + mImpl->mVisualModel->mCharactersPerGlyph.Clear(); + mImpl->mVisualModel->mGlyphsPerCharacter.Clear(); + mImpl->mVisualModel->mGlyphPositions.Clear(); + mImpl->mVisualModel->mLines.Clear(); + mImpl->mVisualModel->ClearCaches(); + // The natural size needs to be re-calculated. mImpl->mRecalculateNaturalSize = true; // Apply modifications to the model mImpl->mOperationsPending = ALL_OPERATIONS; - UpdateModel( ALL_OPERATIONS ); + mImpl->UpdateModel( ALL_OPERATIONS ); mImpl->mOperationsPending = static_cast( LAYOUT | ALIGN | UPDATE_ACTUAL_SIZE | REORDER ); } -void Controller::InsertTextEvent( const std::string& text ) +void Controller::TextInsertedEvent() { - DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected InsertTextEvent" ); + DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected TextInsertedEvent" ); // TODO - Optimize this mImpl->mLogicalModel->mScriptRuns.Clear(); @@ -598,45 +742,12 @@ void Controller::InsertTextEvent( const std::string& text ) mImpl->mVisualModel->mLines.Clear(); mImpl->mVisualModel->ClearCaches(); - // Convert text into UTF-32 - Vector utf32Characters; - utf32Characters.Resize( text.size() ); - - // This is a bit horrible but std::string returns a (signed) char* - const uint8_t* utf8 = reinterpret_cast( text.c_str() ); - - // Transform a text array encoded in utf8 into an array encoded in utf32. - // It returns the actual number of characters. - Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() ); - utf32Characters.Resize( characterCount ); - - const Length numberOfCharactersInModel = mImpl->mLogicalModel->GetNumberOfCharacters(); - - // Restrict new text to fit within Maximum characters setting - Length maxSizeOfNewText = std::min ( ( mImpl->mMaximumNumberOfCharacters - numberOfCharactersInModel ), characterCount ); - - // Insert at current cursor position - CharacterIndex& cursorIndex = mImpl->mEventData->mPrimaryCursorPosition; - - Vector& modifyText = mImpl->mLogicalModel->mText; - - if( cursorIndex < numberOfCharactersInModel ) - { - modifyText.Insert( modifyText.Begin() + cursorIndex, utf32Characters.Begin(), utf32Characters.Begin()+ maxSizeOfNewText ); - } - else - { - modifyText.Insert( modifyText.End(), utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText ); - } - - cursorIndex += maxSizeOfNewText; - // The natural size needs to be re-calculated. mImpl->mRecalculateNaturalSize = true; // Apply modifications to the model; TODO - Optimize this mImpl->mOperationsPending = ALL_OPERATIONS; - UpdateModel( ALL_OPERATIONS ); + mImpl->UpdateModel( ALL_OPERATIONS ); mImpl->mOperationsPending = static_cast( LAYOUT | ALIGN | UPDATE_ACTUAL_SIZE | @@ -645,16 +756,11 @@ void Controller::InsertTextEvent( const std::string& text ) // Queue a cursor reposition event; this must wait until after DoRelayout() mImpl->mEventData->mUpdateCursorPosition = true; mImpl->mEventData->mScrollAfterUpdateCursorPosition = true; - - if ( characterCount > maxSizeOfNewText ) - { - mImpl->mControlInterface.MaxLengthReached(); - } } -void Controller::DeleteTextEvent() +void Controller::TextDeletedEvent() { - DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected InsertTextEvent" ); + DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected TextDeletedEvent" ); // TODO - Optimize this mImpl->mLogicalModel->mScriptRuns.Clear(); @@ -675,25 +781,12 @@ void Controller::DeleteTextEvent() mImpl->mVisualModel->mLines.Clear(); mImpl->mVisualModel->ClearCaches(); - // Delte at current cursor position - Vector& modifyText = mImpl->mLogicalModel->mText; - CharacterIndex& cursorIndex = mImpl->mEventData->mPrimaryCursorPosition; - - if( cursorIndex > 0 && - cursorIndex-1 < modifyText.Count() ) - { - modifyText.Remove( modifyText.Begin() + cursorIndex - 1 ); - - // Cursor position retreat - --cursorIndex; - } - // The natural size needs to be re-calculated. mImpl->mRecalculateNaturalSize = true; // Apply modifications to the model; TODO - Optimize this mImpl->mOperationsPending = ALL_OPERATIONS; - UpdateModel( ALL_OPERATIONS ); + mImpl->UpdateModel( ALL_OPERATIONS ); mImpl->mOperationsPending = static_cast( LAYOUT | ALIGN | UPDATE_ACTUAL_SIZE | @@ -704,152 +797,6 @@ void Controller::DeleteTextEvent() mImpl->mEventData->mScrollAfterUpdateCursorPosition = true; } -void Controller::UpdateModel( OperationsMask operationsRequired ) -{ - // Calculate the operations to be done. - const OperationsMask operations = static_cast( mImpl->mOperationsPending & operationsRequired ); - - Vector& utf32Characters = mImpl->mLogicalModel->mText; - - const Length numberOfCharacters = mImpl->mLogicalModel->GetNumberOfCharacters(); - - Vector& lineBreakInfo = mImpl->mLogicalModel->mLineBreakInfo; - if( GET_LINE_BREAKS & operations ) - { - // Retrieves the line break info. The line break info is used to split the text in 'paragraphs' to - // calculate the bidirectional info for each 'paragraph'. - // It's also used to layout the text (where it should be a new line) or to shape the text (text in different lines - // is not shaped together). - lineBreakInfo.Resize( numberOfCharacters, TextAbstraction::LINE_NO_BREAK ); - - SetLineBreakInfo( utf32Characters, - lineBreakInfo ); - } - - Vector& wordBreakInfo = mImpl->mLogicalModel->mWordBreakInfo; - if( GET_WORD_BREAKS & operations ) - { - // Retrieves the word break info. The word break info is used to layout the text (where to wrap the text in lines). - wordBreakInfo.Resize( numberOfCharacters, TextAbstraction::WORD_NO_BREAK ); - - SetWordBreakInfo( utf32Characters, - wordBreakInfo ); - } - - const bool getScripts = GET_SCRIPTS & operations; - const bool validateFonts = VALIDATE_FONTS & operations; - - Vector& scripts = mImpl->mLogicalModel->mScriptRuns; - Vector& validFonts = mImpl->mLogicalModel->mFontRuns; - - if( getScripts || validateFonts ) - { - // Validates the fonts assigned by the application or assigns default ones. - // It makes sure all the characters are going to be rendered by the correct font. - MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get(); - - if( getScripts ) - { - // Retrieves the scripts used in the text. - multilanguageSupport.SetScripts( utf32Characters, - lineBreakInfo, - scripts ); - } - - if( validateFonts ) - { - if( 0u == validFonts.Count() ) - { - // Copy the requested font defaults received via the property system. - // These may not be valid i.e. may not contain glyphs for the necessary scripts. - GetDefaultFonts( validFonts, numberOfCharacters ); - } - - // Validates the fonts. If there is a character with no assigned font it sets a default one. - // After this call, fonts are validated. - multilanguageSupport.ValidateFonts( utf32Characters, - scripts, - validFonts ); - } - } - - Vector mirroredUtf32Characters; - bool textMirrored = false; - if( BIDI_INFO & operations ) - { - // Count the number of LINE_NO_BREAK to reserve some space for the vector of paragraph's - // bidirectional info. - - Length numberOfParagraphs = 0u; - - const TextAbstraction::LineBreakInfo* lineBreakInfoBuffer = lineBreakInfo.Begin(); - for( Length index = 0u; index < numberOfCharacters; ++index ) - { - if( TextAbstraction::LINE_NO_BREAK == *( lineBreakInfoBuffer + index ) ) - { - ++numberOfParagraphs; - } - } - - Vector& bidirectionalInfo = mImpl->mLogicalModel->mBidirectionalParagraphInfo; - bidirectionalInfo.Reserve( numberOfParagraphs ); - - // Calculates the bidirectional info for the whole paragraph if it contains right to left scripts. - SetBidirectionalInfo( utf32Characters, - scripts, - lineBreakInfo, - bidirectionalInfo ); - - if( 0u != bidirectionalInfo.Count() ) - { - // This paragraph has right to left text. Some characters may need to be mirrored. - // TODO: consider if the mirrored string can be stored as well. - - textMirrored = GetMirroredText( utf32Characters, mirroredUtf32Characters ); - - // Only set the character directions if there is right to left characters. - Vector& directions = mImpl->mLogicalModel->mCharacterDirections; - directions.Resize( numberOfCharacters ); - - GetCharactersDirection( bidirectionalInfo, - directions ); - } - else - { - // There is no right to left characters. Clear the directions vector. - mImpl->mLogicalModel->mCharacterDirections.Clear(); - } - - } - - Vector& glyphs = mImpl->mVisualModel->mGlyphs; - Vector& glyphsToCharactersMap = mImpl->mVisualModel->mGlyphsToCharacters; - Vector& charactersPerGlyph = mImpl->mVisualModel->mCharactersPerGlyph; - if( SHAPE_TEXT & operations ) - { - const Vector& textToShape = textMirrored ? mirroredUtf32Characters : utf32Characters; - // Shapes the text. - ShapeText( textToShape, - lineBreakInfo, - scripts, - validFonts, - glyphs, - glyphsToCharactersMap, - charactersPerGlyph ); - - // Create the 'number of glyphs' per character and the glyph to character conversion tables. - mImpl->mVisualModel->CreateGlyphsPerCharacterTable( numberOfCharacters ); - mImpl->mVisualModel->CreateCharacterToGlyphTable( numberOfCharacters ); - } - - const Length numberOfGlyphs = glyphs.Count(); - - if( GET_GLYPH_METRICS & operations ) - { - mImpl->mFontClient.GetGlyphMetrics( glyphs.Begin(), numberOfGlyphs ); - } -} - bool Controller::DoRelayout( const Size& size, OperationsMask operationsRequired, Size& layoutSize ) @@ -1115,18 +1062,24 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) } else if( Dali::DALI_KEY_BACKSPACE == keyCode ) { - // Queue a delete event - ModifyEvent event; - event.type = ModifyEvent::DELETE_TEXT; - mImpl->mModifyEvents.push_back( event ); + // Remove the character before the current cursor position + bool removed = RemoveText( -1, 1 ); + + if( removed ) + { + if( 0u == mImpl->mLogicalModel->mText.Count() ) + { + mImpl->ShowPlaceholderText(); + } + else + { + mImpl->QueueModifyEvent( ModifyEvent::TEXT_DELETED ); + } + } } - else if( !keyString.empty() ) + else { - // Queue an insert event - ModifyEvent event; - event.type = ModifyEvent::INSERT_TEXT; - event.text = keyString; - mImpl->mModifyEvents.push_back( event ); + InsertText( keyString, COMMIT ); } mImpl->ChangeState( EventData::EDITING ); // todo Confirm this is the best place to change the state of @@ -1137,6 +1090,96 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) return false; } +void Controller::InsertText( const std::string& text, Controller::InsertType type ) +{ + bool removedPreEdit( false ); + bool maxLengthReached( false ); + + if( ! text.empty() ) + { + if( mImpl->IsShowingPlaceholderText() ) + { + ResetText(); + } + } + + if( mImpl->mEventData ) + { + if( COMMIT == type ) + { + mImpl->mEventData->mPreEditFlag = false; + } + else // PRE_EDIT + { + if( mImpl->mEventData->mPreEditFlag && + 0 != mImpl->mEventData->mPreEditLength ) + { + // Remove previous pre-edit text + mImpl->mEventData->mPrimaryCursorPosition = mImpl->mEventData->mPreEditStartPosition; + removedPreEdit = RemoveText( -1, mImpl->mEventData->mPreEditLength ); + } + else + { + // Record the start of the pre-edit text + mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition; + mImpl->mEventData->mPreEditLength = text.size(); + } + + mImpl->mEventData->mPreEditFlag = true; + } + } + + if( ! text.empty() ) + { + // Convert text into UTF-32 + Vector utf32Characters; + utf32Characters.Resize( text.size() ); + + // This is a bit horrible but std::string returns a (signed) char* + const uint8_t* utf8 = reinterpret_cast( text.c_str() ); + + // Transform a text array encoded in utf8 into an array encoded in utf32. + // It returns the actual number of characters. + Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() ); + utf32Characters.Resize( characterCount ); + + const Length numberOfCharactersInModel = mImpl->mLogicalModel->GetNumberOfCharacters(); + + // Restrict new text to fit within Maximum characters setting + Length maxSizeOfNewText = std::min ( ( mImpl->mMaximumNumberOfCharacters - numberOfCharactersInModel ), characterCount ); + maxLengthReached = ( characterCount > maxSizeOfNewText ); + + // Insert at current cursor position + CharacterIndex& cursorIndex = mImpl->mEventData->mPrimaryCursorPosition; + + Vector& modifyText = mImpl->mLogicalModel->mText; + + if( cursorIndex < numberOfCharactersInModel ) + { + modifyText.Insert( modifyText.Begin() + cursorIndex, utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText ); + } + else + { + modifyText.Insert( modifyText.End(), utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText ); + } + + cursorIndex += maxSizeOfNewText; + } + + if( removedPreEdit || !text.empty() ) + { + // Queue an inserted event + mImpl->QueueModifyEvent( ModifyEvent::TEXT_INSERTED ); + } + + if( maxLengthReached ) + { + mImpl->mControlInterface.MaxLengthReached(); + + mImpl->PreEditReset(); + } +} + void Controller::TapEvent( unsigned int tapCount, float x, float y ) { DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected TapEvent" ); @@ -1151,6 +1194,9 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y ) mImpl->RequestRelayout(); } + + // Reset keyboard as tap event has occurred. + mImpl->PreEditReset(); } void Controller::PanEvent( Gesture::State state, const Vector2& displacement ) diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index 5ef498d..4edd281 100644 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -50,6 +50,15 @@ typedef IntrusivePtr ControllerPtr; typedef Dali::Toolkit::Text::ControlInterface ControlInterface; /** + * @brief Different placeholder-text can be shown when the control is active/inactive. + */ +enum PlaceholderType +{ + PLACEHOLDER_TYPE_ACTIVE, + PLACEHOLDER_TYPE_INACTIVE, +}; + +/** * @brief A Text Controller is used by UI Controls which display text. * * It manipulates the Logical & Visual text models on behalf of the UI Controls. @@ -60,7 +69,7 @@ typedef Dali::Toolkit::Text::ControlInterface ControlInterface; */ class Controller : public RefObject, public Decorator::Observer { -private: +public: /** * @brief Text related operations to be done in the relayout process. @@ -83,7 +92,14 @@ private: ALL_OPERATIONS = 0xFFFF }; -public: + /** + * @brief Used to distinguish between regular key events and IMF events + */ + enum InsertType + { + COMMIT, + PRE_EDIT + }; /** * @brief Create a new instance of a Controller. @@ -111,16 +127,34 @@ public: /** * @brief Replaces any placeholder text previously set. * + * @param[in] cursorOffset Start position from the current cursor position to start deleting characters. + * @param[in] numberOfChars The number of characters to delete from the cursorOffset. + * @return True if the remove was successful. + */ + bool RemoveText( int cursorOffset, int numberOfChars ); + + /** + * @brief Retrieve the current cursor position. + * + * @return The cursor position. + */ + unsigned int GetLogicalCursorPosition() const; + + /** + * @brief Replaces any placeholder text previously set. + * + * @param[in] type Different placeholder-text can be shown when the control is active/inactive. * @param[in] text A string of UTF-8 characters. */ - void SetPlaceholderText( const std::string& text ); + void SetPlaceholderText( PlaceholderType type, const std::string& text ); /** * @brief Retrieve any placeholder text previously set. * - * @return A string of UTF-8 characters. + * @param[in] type Different placeholder-text can be shown when the control is active/inactive. + * @param[out] A string of UTF-8 characters. */ - void GetPlaceholderText( std::string& text ) const; + void GetPlaceholderText( PlaceholderType type, std::string& text ) const; /** * @brief Sets the maximum number of characters that can be inserted into the TextModel @@ -179,26 +213,32 @@ public: float GetDefaultPointSize() const; /** - * @brief Retrieve the default fonts. + * @brief Set the text color + * + * @param textColor The text color + */ + void SetTextColor( const Vector4& textColor ); + + /** + * @brief Retrieve the text color * - * @param[out] fonts The default font family, style and point sizes. - * @param[in] numberOfCharacters The number of characters in the logical model. + * @return The text color */ - void GetDefaultFonts( Dali::Vector& fonts, Length numberOfCharacters ) const; + const Vector4& GetTextColor() const; /** * @brief Set the text color * * @param textColor The text color */ - void SetTextColor( const Vector4& textColor ); + void SetPlaceholderTextColor( const Vector4& textColor ); /** * @brief Retrieve the text color * * @return The text color */ - const Vector4& GetTextColor() const; + const Vector4& GetPlaceholderTextColor() const; /** * @brief Set the shadow offset. @@ -332,30 +372,24 @@ public: void ProcessModifyEvents(); /** - * @brief Used to process an event queued from SetText() - * - * @param[in] newText The new text to store in the logical model. + * @brief Used to remove placeholder text. */ - void ReplaceTextEvent( const std::string& newText ); + void ResetText(); /** - * @brief Used to process an event queued from key events etc. - * - * @param[in] text The text to insert into the logical model. + * @brief Used to process an event queued from SetText() */ - void InsertTextEvent( const std::string& text ); + void TextReplacedEvent(); /** - * @brief Used to process an event queued from backspace key etc. + * @brief Used to process an event queued from key events etc. */ - void DeleteTextEvent(); + void TextInsertedEvent(); /** - * @brief Update the model following text replace/insert etc. - * - * @param[in] operationsRequired The layout operations which need to be done. + * @brief Used to process an event queued from backspace key etc. */ - void UpdateModel( OperationsMask operationsRequired ); + void TextDeletedEvent(); /** * @brief Lays-out the text. @@ -407,10 +441,19 @@ public: * @brief Caller by editable UI controls when key events are received. * * @param[in] event The key event. + * @param[in] type Used to distinguish between regular key events and IMF events. */ bool KeyEvent( const Dali::KeyEvent& event ); /** + * @brief Caller by editable UI controls when key events are received. + * + * @param[in] text The text to insert. + * @param[in] type Used to distinguish between regular key events and IMF events. + */ + void InsertText( const std::string& text, InsertType type ); + + /** * @brief Caller by editable UI controls when a tap gesture occurs. * @param[in] tapCount The number of taps. * @param[in] x The x position relative to the top-left of the parent control. diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index 922f309..5f36226 100644 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -493,10 +493,10 @@ VisualModel::VisualModel() mGlyphsPerCharacter(), mGlyphPositions(), mLines(), - mTextColor(), - mShadowColor(), - mUnderlineColor(), - mShadowOffset(), + mTextColor( Color::BLACK ), + mShadowColor( Color::BLACK ), + mUnderlineColor( Color::BLACK ), + mShadowOffset( Vector2::ZERO ), mUnderlineHeight( 0.0f ), mNaturalSize(), mActualSize(), diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index e825767..8355fc6 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -23,10 +23,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -49,9 +47,9 @@ namespace Toolkit namespace { -#if defined(DEBUG_ENABLED) -Integration::Log::Filter* gLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_CONTROL"); -#endif +//#if defined(DEBUG_ENABLED) +//Integration::Log::Filter* gLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_CONTROL"); +//#endif const float MAX_FLOAT_VALUE( std::numeric_limits::max() ); const Vector3 MAX_SIZE( MAX_FLOAT_VALUE, MAX_FLOAT_VALUE, MAX_FLOAT_VALUE ); @@ -100,10 +98,10 @@ struct Background /** * Creates a white coloured Mesh. */ -Mesh CreateMesh() +Vector3 CreateMesh() { Vector3 white( Color::WHITE ); - + /* MeshData meshData; // Create vertices with a white color (actual color is set by actor color) @@ -124,8 +122,9 @@ Mesh CreateMesh() meshData.SetVertices( vertices ); meshData.SetFaceIndices( faces ); meshData.SetHasColor( true ); - - return Mesh::New( meshData ); + */ + return white; + //return Mesh::New( meshData ); } /** @@ -553,6 +552,7 @@ void Control::SetBackgroundColor( const Vector4& color ) // Just set the actor color background.actor.SetColor( color ); } + /* else { // Create Mesh Actor @@ -564,6 +564,7 @@ void Control::SetBackgroundColor( const Vector4& color ) background.actor = meshActor; Self().Add( meshActor ); } + */ background.color = color; } @@ -588,12 +589,14 @@ void Control::SetBackgroundImage( Image image ) background.actor.Reset(); } + /* ImageActor imageActor = ImageActor::New( image ); - SetupBackgroundActor( imageActor, background.color ); + SetupBackgroundActor( imageActor, Actor::Property::SIZE, background.color ); // Set the background actor before adding so that we do not inform derived classes background.actor = imageActor; Self().Add( imageActor ); + */ } void Control::ClearBackground() diff --git a/dali-toolkit/public-api/controls/text-controls/text-field.h b/dali-toolkit/public-api/controls/text-controls/text-field.h index 0af8dc0..96de982 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-field.h +++ b/dali-toolkit/public-api/controls/text-controls/text-field.h @@ -62,8 +62,9 @@ public: enum { RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT - PLACEHOLDER_TEXT, ///< name "placeholder-text", The text to display when the TextField is empty, type STRING TEXT, ///< name "text", The text to display in UTF-8 format, type STRING + PLACEHOLDER_TEXT, ///< name "placeholder-text", The text to display when the TextField is empty and inactive, type STRING + PLACEHOLDER_TEXT_FOCUSED, ///< name "placeholder-text-focused", The text to display when the TextField is empty with key-input focus, type STRING FONT_FAMILY, ///< name "font-family", The requested font family, type STRING FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT @@ -72,6 +73,7 @@ public: HORIZONTAL_ALIGNMENT, ///< name "horizontal-alignment", The line horizontal alignment, type STRING, values "BEGIN", "CENTER", "END" VERTICAL_ALIGNMENT, ///< name "vertical-alignment", The line vertical alignment, type STRING, values "TOP", "CENTER", "BOTTOM" TEXT_COLOR, ///< name "text-color", The text color, type VECTOR4 + PLACEHOLDER_TEXT_COLOR, ///< name "placeholder-text-color", The placeholder-text color, type VECTOR4 SHADOW_OFFSET, ///< name "shadow-offset", The drop shadow offset 0 indicates no shadow, type VECTOR2 SHADOW_COLOR, ///< name "shadow-color", The color of a drop shadow, type VECTOR4 PRIMARY_CURSOR_COLOR, ///< name "primary-cursor-color", The color to apply to the primary cursor, type VECTOR4 diff --git a/dali-toolkit/public-api/controls/view/view.h b/dali-toolkit/public-api/controls/view/view.h new file mode 100644 index 0000000..b42340c --- /dev/null +++ b/dali-toolkit/public-api/controls/view/view.h @@ -0,0 +1,218 @@ +#ifndef __DALI_TOOLKIT_VIEW_H__ +#define __DALI_TOOLKIT_VIEW_H__ + +/* + * Copyright (c) 2014 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. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal DALI_INTERNAL +{ +// Forward declarations +class View; +} + +/** + * View provides a container where different Dali::Layer instances and a background could be added. It + * also provides a View::OrientationChanged() method which could be connected to the Dali::Orientation::SignalChange() signal. + * This method rotates all layers accordingly with the given orientation, it emits an OrientationAnimationStartsSignal signal just before the rotation animation starts. + * + * By default view anchor point and parent origin are centered, the size is full screen and is got directly from the Dali::Stage. However, by passing \e false to the + * Toolkit::View::New() method a custom size could be specified, and after initialization, anchor point and parent origin could be updated. + * + * If a background is set, a background layer will be created and dropped to the bottom. + * + * Use example (application is a Dali::Application object): + * \code{.cpp} + * Stage stage = Stage::GetCurrent(); + * + * // Create default View. By default it gets the stage size. + * Toolkit::View view = Toolkit::View::New(); + * + * // Add the view to the stage before setting the background. + * stage.Add( view ); + * + * // Set background image. BACKGROUND_IMAGE is a string with the background image file path. + * Image backgroundImage = Image::New( BACKGROUND_IMAGE ); + * ImageActor backgroundImageActor = ImageActor::New( backgroundImage ); + * mView.SetBackground( backgroundImageActor ); + * + * // Connects the orientation signal with the View::OrientationChanged method. + * application.GetWindow().GetOrientation().ChangedSignal().Connect( &view, &Toolkit::View::OrientationChanged ); + * + * // Create a content layer. + * Layer contentLayer = Layer::New(); + * contentLayer.SetAnchorPoint( AnchorPoint::CENTER ); + * contentLayer.SetParentOrigin( ParentOrigin::CENTER ); + * view.AddContentLayer( contentLayer ); + * \endcode + * + * Signals + * | %Signal Name | Method | + * |-----------------------------|------------------------------------------| + * | orientation-animation-start | @ref OrientationAnimationStartedSignal() | + + */ +class DALI_IMPORT_API View : public Control +{ + +public: + + /** + * Create a View handle; this can be initialised with View::New() + * Calling member functions with an uninitialised handle is not allowed. + */ + View(); + + /** + * Copy constructor. Creates another handle that points to the same real object + * @param handle to copy from + */ + View( const View& handle ); + + /** + * Assignment operator. Changes this handle to point to another real object + */ + View& operator=( const View& handle ); + + /** + * @brief Destructor + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + */ + ~View(); + + /** + * Create an initialized View. + * @param fullscreen If true, the view's size is going to be set with the Dali::Stage size. Otherwise a size must be provided. By default fullscreen is set to true. + * @return A handle to a newly allocated Dali resource. + */ + static View New( bool fullscreen = true ); + + /** + * Downcast an Object handle to View. If handle points to a View the + * downcast produces valid handle. If not the returned handle is left uninitialized. + * @param[in] handle Handle to an object + * @return handle to a View or an uninitialized handle + */ + static View DownCast( BaseHandle handle ); + + /** + * Returns a content layer. + * @param index to the layer container. + * @return A Layer handle if it exists, otherwise it returns an uninitialized handle. + */ + Layer GetContentLayer( unsigned int index ) const; + + /** + * Adds a new layer in the view. + * @pre layer must be initialized. + * @param layer A Layer handle. + * @return the an index that can be used to access the layer stores in the view. + */ + unsigned int AddContentLayer( Layer layer ); + + /** + * Removes a layer from the view. + * @param layer The layer to be removed. + */ + void RemoveContentLayer( Layer layer ); + + /** + * Returns the background layer. + * @return the background layer or an empty handle if any background has been set before. + */ + Layer GetBackgroundLayer() const; + + /** + * Sets a background image. + * + * It creates a background layer the first time this method is called and it is dropped to the bottom. + * Any previous set background will be replaced by the new one. + * + * @pre View must be on stage before calling SetBackground. + * @param image An image actor. + */ + void SetBackground( ImageActor image ); + + /** + * Sets the angle values for portrait, landscape, portrait inverse and landscape inverse. + * + * These angles are used to rotate the views. + * By default, orientation angles are initialized as follows: portrait 0, landscape 90, portrait inverse 180, landscape inverse 270. + * + * @param portrait angle in degrees. + * @param landscale angle in degrees. + * @param portraitInverse angle in degrees. + * @param landscapeInverse angle in degrees. + */ + void SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse ); + + /** + * It rotates all layers to the new given orientation. + * + * @param orientation The new orientation. + */ + void OrientationChanged( Orientation orientation ); + + /** + * Enables or disables the view's rotation when device orientation changes. + * @param enabled Whether auto-rotate should be enabled or disabled. By default is enabled. + */ + void SetAutoRotate( bool enabled ); + +public: //Signals + + // Orientation change animation starts. + typedef Signal< void ( View, Animation&, const Orientation& ) > OrientationAnimationStartedSignalType; + + /** + * Signal emitted just before the rotate animation starts when the device orientation changes. + */ + OrientationAnimationStartedSignalType& OrientationAnimationStartedSignal(); + +public: // Not intended for application developers + + /** + * Creates a handle using the Toolkit::Internal implementation. + * @param[in] implementation The Control implementation. + */ + DALI_INTERNAL View( Internal::View& implementation ); + + /** + * Allows the creation of this Control from an Internal::CustomActor pointer. + * @param[in] internal A pointer to the internal CustomActor. + */ + explicit DALI_INTERNAL View( Dali::Internal::CustomActor* internal ); +}; + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_VIEW_H__ diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index 23cc8f0..3222c87 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit const unsigned int TOOLKIT_MAJOR_VERSION = 1; const unsigned int TOOLKIT_MINOR_VERSION = 0; -const unsigned int TOOLKIT_MICRO_VERSION = 39; +const unsigned int TOOLKIT_MICRO_VERSION = 40; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/dali-toolkit/public-api/file.list b/dali-toolkit/public-api/file.list index 3eea93c..0cf1e1f 100755 --- a/dali-toolkit/public-api/file.list +++ b/dali-toolkit/public-api/file.list @@ -7,7 +7,6 @@ public_api_src_files = \ $(public_api_src_dir)/controls/control-impl.cpp \ $(public_api_src_dir)/controls/control.cpp \ $(public_api_src_dir)/controls/alignment/alignment.cpp \ - $(public_api_src_dir)/controls/bubble-effect/bubble-emitter.cpp \ $(public_api_src_dir)/controls/buttons/button.cpp \ $(public_api_src_dir)/controls/buttons/check-box-button.cpp \ $(public_api_src_dir)/controls/buttons/push-button.cpp \ diff --git a/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp b/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp index 205327d..269e4ec 100644 --- a/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp @@ -80,7 +80,7 @@ MotionBlurEffect::~MotionBlurEffect() { } -MotionBlurEffect MotionBlurEffect::Apply( RenderableActor renderable ) +MotionBlurEffect MotionBlurEffect::Apply( ImageActor renderable ) { MotionBlurEffect newEffect = New( MOTION_BLUR_NUM_SAMPLES ); renderable.SetShaderEffect( newEffect ); diff --git a/dali-toolkit/public-api/shader-effects/motion-blur-effect.h b/dali-toolkit/public-api/shader-effects/motion-blur-effect.h index 5455fef..13a8e1d 100644 --- a/dali-toolkit/public-api/shader-effects/motion-blur-effect.h +++ b/dali-toolkit/public-api/shader-effects/motion-blur-effect.h @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include #include namespace Dali @@ -77,7 +77,7 @@ public: * @param renderable actor to apply the effect to * @return A handle to a newly allocated Dali resource. */ - static MotionBlurEffect Apply( RenderableActor renderable ); + static MotionBlurEffect Apply( ImageActor renderable ); /** * Create an initialized MotionBlurEffect diff --git a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp index 3a631bf..9cde815 100644 --- a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp @@ -94,7 +94,7 @@ MotionStretchEffect::~MotionStretchEffect() { } -MotionStretchEffect MotionStretchEffect::Apply( RenderableActor renderable ) +MotionStretchEffect MotionStretchEffect::Apply( ImageActor renderable ) { MotionStretchEffect newEffect = New(); renderable.SetShaderEffect( newEffect ); diff --git a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h index 5cc7bcf..48d2483 100644 --- a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h +++ b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.h @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include #include namespace Dali @@ -72,7 +72,7 @@ public: * @param renderable actor to apply the effect to * @return A handle to a newly allocated Dali resource. */ - static MotionStretchEffect Apply( RenderableActor renderable ); + static MotionStretchEffect Apply( ImageActor renderable ); /** * Set geometry stretch factor property. This scales the amount the geometry diff --git a/docs/content/main-page.h b/docs/content/main-page.h index 3802d3d..f74e830 100644 --- a/docs/content/main-page.h +++ b/docs/content/main-page.h @@ -28,7 +28,7 @@ * - \link animation-multi-threading-notes Multi-threading Notes \endlink * * \section Constraints - * - \link constraints-intro Introduction to Constraints \endlink + * - \link constraints Constraints \endlink * * \section SizeNegotiation Size Negotiation * - \link size-negotiation Size Negotiation \endlink @@ -51,9 +51,7 @@ * * \section Scripting * - \link script-overview Overview \endlink - * - \link script-howto How to Add a Custom Control \endlink * - \link script-hello Hello World in script \endlink - * * - \link handle-body-idiom Handle – body idiom \endlink * * \section Rendering diff --git a/docs/content/programming-guide/constraints-intro.h b/docs/content/programming-guide/constraints-intro.h deleted file mode 100644 index fb8752d..0000000 --- a/docs/content/programming-guide/constraints-intro.h +++ /dev/null @@ -1,32 +0,0 @@ -/*! \page constraints-intro Constraints - * - -

Introduction

- -Constraints can be used to modify the property of an actor, based on the properties of another actor. Custom a functions or functors can be supplied, to describe the relationship between these properties. A common example is alignment e.g. modifying an actor's position, when the size of the parent actor changes. Multiple constraints can be applied to the same actor at the same time. - -Constraints are applied in the dedicated render thread, after animations have been applied. This means that Constraints override the values set by Animations. Constraints may behave in a similar way to animations, since they can be applied or removed gradually. By default the apply-time is zero, meaning that the constraint will be applied immediately. - -

Local Constraints

- -A local constraint is based on the local properties (i.e. size, position, scale, rotation, color) of an actor. For example you could change the color of an actor, based its rotation. - -

Parent Constraints

- -A parent constraint is based on properties of the actor's parent. The following example shows how to constrain an actor to be 80% of its parent's size: - -@code -Actor actor = Actor::New(); -Vector3 scale(0.8f, 0.8f, 0.8f); // Set width/height/depth at 80% of parent -Constraint constraint = ParentConstraint::Size::New(Dali::ParentSize(scale)); -actor.ApplyConstraint(constraint); -@endcode - -The actor's constraints can later be removed: - -@code - actor.RemoveConstraints(); -@endcode - -* -*/ diff --git a/docs/content/programming-guide/constraints.h b/docs/content/programming-guide/constraints.h new file mode 100644 index 0000000..9394b3c --- /dev/null +++ b/docs/content/programming-guide/constraints.h @@ -0,0 +1,232 @@ +/*! \page constraints Constraints + * + +

Introduction

+ +Constraints are used to modify the property of an actor, based on other properties of the same actor; properties of the actor's parent; or properties of another actor altogether, when the modification needs to be at run-time. +Custom functions or functors can be supplied, where the desired value of the property can be calculated. +These functions (or functors) are called in every frame so should be fast and not too complex otherwise it will hit performance. + +Multiple constraints can be applied to the same actor at the same time. +The order in which constraints are applied is important as this is the order in which they are processed in the update thread. + +Constraints are applied after animations have been applied. +This means that Constraints override the values set by Animations. + +Not all properties can be used as a constraint input, please see Dali::Handle::IsPropertyAConstraintInput() for more details. + +

When to use a Constraint

+ +Constraints are designed as a way of modifying properties that cannot be modified by any existing built in functionality; Like Animations, Size negotiation or Parent anchor, origin settings. +As they provide the ability for the application developer to execute their own code within the update thread, DALi can no-longer guarantee the timeliness of this code, or how optimised it may be. + +Generally, you should not use constraints with the SIZE property as constraining the size and size negotiation are mutually exclusive. +Consider the following use cases as an example of when and when not to use a constraint: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Requirement:Desired Solution:
Need a child to be 50% the size of it's parent.Use Size negotiation.
Need to zoom an actor in to the screen via it's scale property.Use an Animation.
Need an actor to appear centered around the bottom-right corner of it's parent.Use ParentOrigin & AnchorPoint.
Need to lay out a series of controls with various alignment requirements.Use either Anchor & origin settings, or a TableView.
Need to automatically modify the position property of one actor based on the position property of another actor, that is neither a parent OR a child.Use a Constraint.
Need to position an actor relative to it's parent actor in a NON-UNIFORM way, IE. a non-linear calculation needs to be performed that requires a functor.Use a Constraint.
Need to modify an actor's property in real time based on some calculations that require additional data to be stored in-between frames.Use a Constraint. The constraint functor can hold any variables within it that need to be preserved frame-to-frame.
+ +For most general cases, the position and size requirements of a child or parent actor (from it's child or parent) can be calculated with Size Negotiation. + +

Constraint Sources

+ +These are properties of this (or another actor) that are used as inputs into the constraint. +The constraint will take these values, optionally perform a calculation on them (if using a custom functor) and write the result to the specified property of the target actor. +The source actor is specified as either the same actor, it's parent or another actor. + +

Local Source

+ +A local source is based on the local properties (i.e. size, position, scale, orientation, color) of an actor. +For example, the actor's orientation could be used as a constraint input source. + +@code +Dali::ConstraintSource source( Dali::LocalSource( Dali::Actor::Property::ORIENTATION ) ); +@endcode + +

Parent Source

+ +A parent source is based on properties of the actor's parent. +For example, a parent's position can be used as a constraint input source. + +@code +Dali::ConstraintSource source( Dali::ParentSource( Dali::Actor::Property::POSITION ) ); +@endcode + +

Source

+ +Finally, you can base your source on the properties of another handle altogether. +For example, a sibling actor's color could be used as a constraint input source. + +@code +Dali::ConstraintSource source( Dali::Source( anotherHandle, Dali::Actor::Property::COLOR ) ); +@endcode + +

The Constraint Function

+ +The signature of the constraint function is: + +@code +void Function( PropertyType& current, const Dali::PropertyInputContainer& inputs ); +@endcode + +Here 'current' is a reference to the target property type, e.g. float, Vector2, Vector3 etc. +This is an in/out parameter. +It represents the current value of the property and the expectation is that it will be modified by the function to the desired value. + +The 'inputs' parameter holds all the constraint input sources. +Each element is a pointer to the property-input and can be accessed using the indexing operator[]. +The order in which the sources are added is the order in which the property-inputs are sorted in the container. For example: + +@code +constraint.AddSource( Dali::LocalSource( Dali::Actor::Property::POSITION ) ); +constraint.AddSource( Dali::LocalSource( Dali::Actor::Property::SIZE ) ); +constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::POSITION ) ); +constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) ); +@endcode + +In the constraint function this equates to: +@code +const Dali::Vector3& position( inputs[0]->GetVector3() ); +const Dali::Vector3& size( inputs[1]->GetVector3() ); +const Dali::Vector3& parentPosition( inputs[2]->GetVector3() ); +const Dali::Vector3& parentSize( inputs[3]->GetVector3() ); +@endcode + +

Creating a Constraint

+ +

Using C Functions

+ +If you do not have any data that is changed at runtime, then C functions should be used. +For example, the color of an actor could be changed based on its position along the x-axis till a preset distance of 100, beyond which it is transparent. + +@code +Dali::Actor actor = Actor::New(); + +Dali::Constraint constraint = Dali::Constraint::New< Vector4 >( actor, Dali::Actor::Property::COLOR, MyConstraintFunction ); // Creates a constraint that targets actor +constraint.AddSource( Dali::LocalSource( Dali::Actor::Property::POSITION ) ); // Adds the POSITION property as a constraint input +constraint.Apply(); // The constraint is applied +@endcode + +And the actual C Function: + +@code +void MyConstraintFunction( Dali::Vector4& current, const Dali::PropertyInputContainer& inputs ) +{ + const Dali::Vector3& position( inputs[0]->GetVector3() ); + + float distance = fabs( position.x ); + + // More than 100.0f away, opacity is 0.0f + if ( distance > 100.0f ) + { + current.a = 0.0f; + } + else + { + // Otherwise it will blend between fully opaque and transparent + current.a = ( 100.0f - distance ) / 100.0f; + } +} +@endcode + +Please have a look at Dali::Constraint::New() for more details. + +

Using Functors

+ +If you need to store some data in a struct/class, then a functor can be used. +Reusing the last example, the color of an actor is changed based on its position along the x-axis, but the distance when it is transparent is different for each applied constraint. + +@code +Dali::Actor actor = Actor::New(); + +Dali::Constraint constraint = Dali::Constraint::New< Vector4 >( actor, Dali::Actor::Property::COLOR, MyFunctor( 200 ) ); // Creates a constraint that targets actor, and uses MyFunctor with a distance of 200 +constraint.AddSource( Dali::LocalSource( Dali::Actor::Property::POSITION ) ); // Adds the POSITION property as a constraint input +constraint.Apply(); // The constraint is applied +@endcode + +And the struct: + +@code +struct MyFunctor +{ + /// Constructor which takes the distance at which the actor will be fully transparent + MyFunctor( float distance ) + : mDistance( distance ) + { + } + + /// Functor + void operator()( Dali::Vector4& current, const Dali::PropertyInputContainer& inputs ) + { + const Dali::Vector3& position( inputs[0]->GetVector3() ); + + float distance = fabs( position.x ); + + // More than mDistance away, opacity is 0.0f + if ( distance > mDistance ) + { + current.a = 0.0f; + } + else + { + // Otherwise it will blend between fully opaque and transparent + current.a = ( 100.0f - mDistance ) / 100.0f; + } + } + + // Data + const float mDistance; +}; +@endcode + +MyFunctor could then be used with another constraint with a different distance. + +Please have a look at Dali::Constraint::New(Handle, Property::Index, const T&) for more details. + +Instead of using the default functor, another method can be declared in the class or struct and used as the constraint function. +Please have a look at appropriate Dali::Constraint::New() method for more details. + +

Removing Constraints

+ +The actor's constraints can later be removed in several ways: + +@code +mConstraint.Remove(); // mConstraint is a base-handle to a constraint +actor.RemoveConstraints(); // Removes ALL constraints applied to an actor +actor.RemoveConstraint( tag ); // All constraints with the tag are removed from the actor (tag can be set using SetTag) +@endcode + +* +*/ diff --git a/docs/content/programming-guide/script-howto.h b/docs/content/programming-guide/script-howto.h deleted file mode 100644 index b9d3da0..0000000 --- a/docs/content/programming-guide/script-howto.h +++ /dev/null @@ -1,101 +0,0 @@ -/*! \page script-howto Scripting HowTo - * - *

Scripting A Custom Control

- * - * These steps must be taken to provide scripting access for your control. - * - *
    - *
  • Register your class Type. - *
  • Register Signals and Actions (optional). - *
  • Register properties (optional). - *
- * -* - *

Registering your Type, Signals and Actions

- * - * As part of your my-actor.cpp a static "Dali::TypeRegistration" object is created to register MyActor for scripting. - * - * Functions for Creation, Signal Connection and Action are registered with this object. - * - * @code - * namespace // type registration - * { - * - * // Register MyActor with base actor CustomActor and creation function CreateCustom - * Dali::TypeRegistration mCustomType( typeid(MyActor), typeid(Dali::CustomActor), MyActor::Create ); - * - * // Add a signal to the type registration - * Dali::TypeSignalConnector signal1( mCustomType, "page-changed", MyActor::DoConnectSignalCustom); - * - * // Add an action to the type registration - * Dali::TypeAction action1( mCustomType, "SelectPage", MyActor::DoActionCustom); - * - * } - * @endcode - * - * The registered handling functions are also static. For example. - * - * @code - * BaseHandle MyActor::Create(void) - * { - * return MyActor::New(); - * } - * - * Dali::Connection MyActor::DoConnectSignalCustom(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor) - * { - * Dali::Connection connection ; - * - * MyActor* actor = dynamic_cast(object); - * - * if(actor && "page-changed" == signalName) - * { - * connection = return actor->PageChangedSignal().Connect( tracker, functor ); - * } - * - * return connection ; - * } - * - * bool MyActor::DoActionCustom(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes) - * { - * bool actioned = false ; - * - * MyActor* actor = dynamic_cast(object) ; - * - * if(actor && "SelectPage" == actionName) - * { - * actor->DoSelectPage() ; - * actioned = true; - * } - * - * return actioned ; - * } - * @endcode - * - *

Providing Properties for scripting

- * - * Properties can be registered by name to allow script access. - * - * A RegisterProperty() call with property attributes allows the custom class to register non animatable properties. - * - * @code - * void MyActor::Initialize() - * { - * // Register a non animatable and writeable property. - * mPropertyAlphaIndex = Self().RegisterProperty("alpha", 0.0f, Dali::Property::WRITEABLE); - * } - * @endcode - * - * If a non animatable property is set then the class is notified via the OnPropertySet virtual function. - * - * @code - * void MyActor::OnPropertySet(Property::Index index, Property::Value propertyValue) - * { - * if(index == mPropertyAlphaIndex) - * { - * SetAlpha(propertyValue.Get()); - * } - * } - * - * @endcode - * - */ diff --git a/docs/content/programming-guide/script-overview.h b/docs/content/programming-guide/script-overview.h index f9eb951..6224f60 100644 --- a/docs/content/programming-guide/script-overview.h +++ b/docs/content/programming-guide/script-overview.h @@ -33,7 +33,7 @@ * * The property system has non animatable properties that can be used by the scripting runtime to set actor attributes. * - * Custom controls can register properties for scripting access. The custom control is notified of a non animatable property value change. + * Custom controls can register properties for scripting access. * * *

A Javascript example

@@ -51,7 +51,6 @@ * * // Property access * // This line finds a property called "alpha" and Sets with SetProperty(index, Property::Value(2.0)) - * // If the property is non animatable it calls OnPropertySet(Property::Value(2.0)) * custom.alpha = 2.0; * * // NB: non animatable properties can be strings diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index d53e83b..c682461 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: The OpenGLES Canvas Core Library Toolkit -Version: 1.0.39 +Version: 1.0.40 Release: 1 Group: System/Libraries License: Apache-2.0 -- 2.7.4