From 2c23a90e5de1cbc41e0ee974db53e97330a7ead3 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Thu, 25 Jun 2020 11:24:28 +0900 Subject: [PATCH 01/16] [Tizen] Change target share directory from dali to dali-legacy Change-Id: I854e6e6f307708af3f7ec5e64f3fde930fd2e34e Signed-off-by: Seungho, Baek --- CMakeLists.txt | 10 +++++----- build/tizen/CMakeLists.txt | 12 ++++++------ packaging/dali-toolkit.spec | 20 ++++++++++++++++++-- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbd38b4..eba4398 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,11 @@ PROJECT (dali-toolkit) ADD_DEFINITIONS( -DDALI_ENV="../../dali-env" --DDALI_DATA_READ_ONLY_DIR=DALI_ENV"/opt/share/dali" --DDALI_IMAGE_DIR=DALI_ENV"/opt/share/dali/toolkit/images/" --DDALI_STYLE_DIR=DALI_ENV"/opt/share/dali/toolkit/styles/" --DDALI_SOUND_DIR=DALI_ENV"/opt/share/dali/toolkit/sounds/" --DDALI_STYLE_IMAGE_DIR=DALI_ENV"/opt/share/dali/toolkit/styles/images/" +-DDALI_DATA_READ_ONLY_DIR=DALI_ENV"/opt/share/dali-legacy" +-DDALI_IMAGE_DIR=DALI_ENV"/opt/share/dali-legacy/toolkit/images/" +-DDALI_STYLE_DIR=DALI_ENV"/opt/share/dali-legacy/toolkit/styles/" +-DDALI_SOUND_DIR=DALI_ENV"/opt/share/dali-legacy/toolkit/sounds/" +-DDALI_STYLE_IMAGE_DIR=DALI_ENV"/opt/share/dali-legacy/toolkit/styles/images/" -DCURL_STATICLIB=0 /DBUILDING_DALI_TOOLKIT /vmg diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 25edb06..fde4eb2 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -79,13 +79,13 @@ SET( toolkit_style_images_dir ${STYLE_DIR}/images ) IF( DEFINED ENV{DALI_DATA_RW_DIR} ) SET( dataReadWriteDir $ENV{DALI_DATA_RW_DIR} ) ELSE() - SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali/ ) + SET( dataReadWriteDir ${CMAKE_INSTALL_PREFIX}/share/dali-legacy/ ) ENDIF() IF( DEFINED ENV{DALI_DATA_RO_DIR} ) SET( dataReadOnlyDir $ENV{DALI_DATA_RO_DIR} ) ELSE() - SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali/ ) + SET( dataReadOnlyDir ${CMAKE_INSTALL_PREFIX}/share/dali-legacy/ ) ENDIF() # Set up compiler definitions @@ -115,10 +115,10 @@ IF( WIN32 ) SET( INSTALL_SHARE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share" ) ENDIF() - ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/images/\" - -DDALI_SOUND_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/sounds/\" - -DDALI_STYLE_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/styles/\" - -DDALI_STYLE_IMAGE_DIR=\"${INSTALL_SHARE_DIR}/dali/toolkit/styles/images/\" + ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${INSTALL_SHARE_DIR}/dali-legacy/toolkit/images/\" + -DDALI_SOUND_DIR=\"${INSTALL_SHARE_DIR}/dali-legacy/toolkit/sounds/\" + -DDALI_STYLE_DIR=\"${INSTALL_SHARE_DIR}/dali-legacy/toolkit/styles/\" + -DDALI_STYLE_IMAGE_DIR=\"${INSTALL_SHARE_DIR}/dali-legacy/toolkit/styles/images/\" -DDALI_DATA_READ_ONLY_DIR=\"${INSTALL_SHARE_DIR}/\" ) ENDIF() ELSEIF( UNIX ) diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 6c2f417..71dced0 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -88,8 +88,8 @@ Application development package for Dali 3D engine toolkit - headers and package %prep %setup -q -%define dali_data_rw_dir %TZ_SYS_SHARE/dali/ -%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/ +%define dali_data_rw_dir %TZ_SYS_SHARE/dali-legacy/ +%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali-legacy/ %define dali_toolkit_image_files %{dali_data_ro_dir}/toolkit/images/ %define dali_toolkit_sound_files %{dali_data_ro_dir}/toolkit/sounds/ @@ -194,6 +194,7 @@ popd %pre resources_360x360 case "$1" in 2) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf ./* popd @@ -203,6 +204,7 @@ esac %pre resources_480x800 case "$1" in 2) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf ./* popd @@ -212,6 +214,7 @@ esac %pre resources_720x1280 case "$1" in 2) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf ./* popd @@ -221,6 +224,7 @@ esac %pre resources_1920x1080 case "$1" in 2) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf ./* popd @@ -235,21 +239,25 @@ esac exit 0 %post resources_360x360 +mkdir -p %{dali_toolkit_style_files}/360x360 pushd %{dali_toolkit_style_files}/360x360 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done popd %post resources_480x800 +mkdir -p %{dali_toolkit_style_files}/480x800 pushd %{dali_toolkit_style_files}/480x800 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done popd %post resources_720x1280 +mkdir -p %{dali_toolkit_style_files}/720x1280 pushd %{dali_toolkit_style_files}/720x1280 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done popd %post resources_1920x1080 +mkdir -p %{dali_toolkit_style_files}/1920x1080 pushd %{dali_toolkit_style_files}/1920x1080 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done popd @@ -262,6 +270,7 @@ popd case "$1" in 0) %preun resources_360x360 + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} mv images ./360x360 mv dali-toolkit-default-theme.json ./360x360 @@ -273,6 +282,7 @@ esac case "$1" in 0) %preun resources_480x800 + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} mv images ./480x800 mv dali-toolkit-default-theme.json ./480x800 @@ -284,6 +294,7 @@ esac case "$1" in 0) %preun resources_720x1280 + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} mv images ./720x1280 mv dali-toolkit-default-theme.json ./720x1280 @@ -295,6 +306,7 @@ esac case "$1" in 0) %preun resources_1920x1080 + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} mv images ./1920x1080 mv dali-toolkit-default-theme.json ./1920x1080 @@ -312,6 +324,7 @@ exit 0 %postun resources_360x360 case "$1" in 0) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf * popd @@ -321,6 +334,7 @@ esac %postun resources_480x800 case "$1" in 0) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf * popd @@ -330,6 +344,7 @@ esac %postun resources_720x1280 case "$1" in 0) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf * popd @@ -339,6 +354,7 @@ esac %postun resources_1920x1080 case "$1" in 0) + mkdir -p %{dali_toolkit_style_files} pushd %{dali_toolkit_style_files} rm -rf * popd -- 2.7.4 From e76b7c695d12f578a61afa1788cd8cd8d9700bfe Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Fri, 12 Jun 2020 21:43:23 +0900 Subject: [PATCH 02/16] Support WebP format - Modified animated-image-visual to support webp amimated image format - Added and removed some functions of image-cache to use rolling-animated-image-cache for the both of gif and webp - Checked whether mFrameDelayTimer is null or not for the case that Action::PLAY is entered but the system do not support animated webp Change-Id: I254c4c8e715772acb6c0725c58e64aba1a6dafc4 Signed-off-by: Seungho, Baek --- .../dali-toolkit/utc-Dali-AnimatedImageVisual.cpp | 2 +- dali-toolkit/internal/file.list | 2 +- .../animated-image/animated-image-visual.cpp | 35 +++++----- .../visuals/animated-image/animated-image-visual.h | 15 ++--- .../visuals/animated-image/fixed-image-cache.cpp | 26 +++----- .../visuals/animated-image/fixed-image-cache.h | 6 +- .../internal/visuals/animated-image/image-cache.h | 10 ++- ...-cache.cpp => rolling-animated-image-cache.cpp} | 78 +++++++++------------- ...mage-cache.h => rolling-animated-image-cache.h} | 42 ++++++------ .../visuals/animated-image/rolling-image-cache.cpp | 21 +----- .../visuals/animated-image/rolling-image-cache.h | 6 +- .../internal/visuals/visual-factory-impl.cpp | 2 + dali-toolkit/internal/visuals/visual-url.cpp | 12 +++- dali-toolkit/internal/visuals/visual-url.h | 3 +- 14 files changed, 112 insertions(+), 148 deletions(-) rename dali-toolkit/internal/visuals/animated-image/{rolling-gif-image-cache.cpp => rolling-animated-image-cache.cpp} (68%) rename dali-toolkit/internal/visuals/animated-image/{rolling-gif-image-cache.h => rolling-animated-image-cache.h} (72%) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp index bb591dd..bad5ea0 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp @@ -293,7 +293,7 @@ int UtcDaliAnimatedImageVisualStopBehavior(void) } -int UtcDaliAnimatedImageVisualGif01(void) +int UtcDaliAnimatedImageVisualAnimatedImage01(void) { ToolkitTestApplication application; TestGlAbstraction& gl = application.GetGlAbstraction(); diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index 8f3b2f2..246ba89 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -17,7 +17,7 @@ SET( toolkit_src_files ${toolkit_src_dir}/visuals/animated-image/image-cache.cpp ${toolkit_src_dir}/visuals/animated-image/fixed-image-cache.cpp ${toolkit_src_dir}/visuals/animated-image/rolling-image-cache.cpp - ${toolkit_src_dir}/visuals/animated-image/rolling-gif-image-cache.cpp + ${toolkit_src_dir}/visuals/animated-image/rolling-animated-image-cache.cpp ${toolkit_src_dir}/visuals/animated-vector-image/animated-vector-image-visual.cpp ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-task.cpp ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-thread.cpp diff --git a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp index 386013a..fdde260 100755 --- a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -111,7 +111,7 @@ Debug::Filter* gAnimImgLogFilter = Debug::Filter::New(Debug::NoLogging, false, " AnimatedImageVisualPtr AnimatedImageVisual::New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, const Property::Map& properties ) { AnimatedImageVisualPtr visual( new AnimatedImageVisual( factoryCache, shaderFactory ) ); - visual->InitializeGif( imageUrl ); + visual->InitializeAnimatedImage( imageUrl ); visual->SetProperties( properties ); if( visual->mFrameCount > 0 ) @@ -149,7 +149,7 @@ AnimatedImageVisualPtr AnimatedImageVisual::New( VisualFactoryCache& factoryCach AnimatedImageVisualPtr AnimatedImageVisual::New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl ) { AnimatedImageVisualPtr visual( new AnimatedImageVisual( factoryCache, shaderFactory ) ); - visual->InitializeGif( imageUrl ); + visual->InitializeAnimatedImage( imageUrl ); if( visual->mFrameCount > 0 ) { @@ -159,12 +159,11 @@ AnimatedImageVisualPtr AnimatedImageVisual::New( VisualFactoryCache& factoryCach return visual; } -void AnimatedImageVisual::InitializeGif( const VisualUrl& imageUrl ) +void AnimatedImageVisual::InitializeAnimatedImage( const VisualUrl& imageUrl ) { mImageUrl = imageUrl; - mGifLoading = GifLoading::New( imageUrl.GetUrl(), imageUrl.IsLocalResource() ); - mFrameCount = mGifLoading->GetImageCount(); - mGifLoading->LoadFrameDelays( mFrameDelayContainer ); + mAnimatedImageLoading = AnimatedImageLoading::New( imageUrl.GetUrl(), imageUrl.IsLocalResource() ); + mFrameCount = mAnimatedImageLoading.GetImageCount(); } AnimatedImageVisual::AnimatedImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory ) @@ -174,7 +173,7 @@ AnimatedImageVisual::AnimatedImageVisual( VisualFactoryCache& factoryCache, Imag mImageVisualShaderFactory( shaderFactory ), mPixelArea( FULL_TEXTURE_RECT ), mImageUrl(), - mGifLoading( nullptr ), + mAnimatedImageLoading(), mCurrentFrameIndex( 0 ), mImageUrls( NULL ), mImageCache( NULL ), @@ -206,7 +205,7 @@ void AnimatedImageVisual::GetNaturalSize( Vector2& naturalSize ) { if( mImageUrl.IsValid() ) { - mImageSize = mGifLoading->GetImageSize(); + mImageSize = mAnimatedImageLoading.GetImageSize(); } else if( mImageUrls && mImageUrls->size() > 0 ) { @@ -270,7 +269,7 @@ void AnimatedImageVisual::OnDoAction( const Dali::Property::Index actionId, cons } case DevelAnimatedImageVisual::Action::PLAY: { - if( IsOnStage() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY ) + if( mFrameDelayTimer && IsOnStage() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY ) { mFrameDelayTimer.Start(); } @@ -542,9 +541,9 @@ void AnimatedImageVisual::LoadFirstBatch() mUrlIndex = 0; TextureManager& textureManager = mFactoryCache.GetTextureManager(); - if( mGifLoading != nullptr ) + if( mAnimatedImageLoading ) { - mImageCache = new RollingGifImageCache( textureManager, *mGifLoading, mFrameCount, *this, cacheSize, batchSize ); + mImageCache = new RollingAnimatedImageCache( textureManager, mAnimatedImageLoading, mFrameCount, *this, cacheSize, batchSize ); } else if( mImageUrls ) { @@ -592,11 +591,10 @@ void AnimatedImageVisual::StartFirstFrame( TextureSet& textureSet ) if( mFrameCount > 1 ) { int frameDelay = mFrameDelay; // from URL array - if( mFrameDelayContainer.Count() > 0 ) // from GIF + if( mAnimatedImageLoading && mImageCache ) { - frameDelay = mFrameDelayContainer[0]; + frameDelay = mImageCache->GetFrameInterval( 0 ); } - mFrameDelayTimer = Timer::New( frameDelay ); mFrameDelayTimer.TickSignal().Connect( this, &AnimatedImageVisual::DisplayNextFrame ); mFrameDelayTimer.Start(); @@ -706,11 +704,10 @@ bool AnimatedImageVisual::DisplayNextFrame() return DisplayNextFrame(); } } - - if( mFrameDelayContainer.Count() > 0 ) + // TODO : newly added one. + if( mAnimatedImageLoading && mImageCache ) { - unsigned int delay = mFrameDelayContainer[mCurrentFrameIndex]; - + unsigned int delay = mImageCache->GetFrameInterval( mCurrentFrameIndex ); if( mFrameDelayTimer.GetInterval() != delay ) { mFrameDelayTimer.SetInterval( delay ); diff --git a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.h b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.h index 0d21f97..7c0764e 100755 --- a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.h +++ b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include // INTERNAL INCLUDES #include @@ -92,7 +92,7 @@ public: * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] shaderFactory The ImageVisualShaderFactory object - * @param[in] imageUrl The URL to gif resource to use + * @param[in] imageUrl The URL to animated image resource to use * @param[in] properties A Property::Map containing settings for this visual * @return A smart-pointer to the newly allocated visual. */ @@ -224,10 +224,10 @@ private: bool DisplayNextFrame(); /** - * Initialize the gif variables. - * @param[in] imageUrl The url of the animated gif + * Initialize the animated image variables. + * @param[in] imageUrl The url of the animated image */ - void InitializeGif( const VisualUrl& imageUrl ); + void InitializeAnimatedImage( const VisualUrl& imageUrl ); // Undefined AnimatedImageVisual( const AnimatedImageVisual& animatedImageVisual ); @@ -241,11 +241,10 @@ private: WeakHandle mPlacementActor; ImageVisualShaderFactory& mImageVisualShaderFactory; - // Variables for GIF player - Dali::Vector mFrameDelayContainer; + // Variables for Animated Image player Vector4 mPixelArea; VisualUrl mImageUrl; - std::unique_ptr mGifLoading; // Only needed for animated gifs + Dali::AnimatedImageLoading mAnimatedImageLoading; // Only needed for animated image uint32_t mCurrentFrameIndex; // Frame index into textureRects // Variables for Multi-Image player diff --git a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp index d71ee94..726cd39 100644 --- a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp @@ -58,8 +58,14 @@ TextureSet FixedImageCache::Frame( uint32_t frameIndex ) { while( frameIndex > mFront ) { - NextFrame(); + ++mFront; + if( mFront >= mImageUrls.size() ) + { + mFront = 0; + } + LoadBatch(); } + mFront = frameIndex; TextureSet textureSet; @@ -87,23 +93,9 @@ TextureSet FixedImageCache::FirstFrame() return textureSet; } -TextureSet FixedImageCache::NextFrame() +uint32_t FixedImageCache::GetFrameInterval( uint32_t frameIndex ) { - TextureSet textureSet; - ++mFront; - mFront %= mImageUrls.size(); - - if( IsFrontReady() == true ) - { - textureSet = GetFrontTextureSet(); - } - else - { - mWaitingForReadyFrame = true; - } - LoadBatch(); - - return textureSet; + return 0u; } bool FixedImageCache::IsFrontReady() const diff --git a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h index d884e28..5063232 100644 --- a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h +++ b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h @@ -61,11 +61,9 @@ public: TextureSet FirstFrame() override; /** - * Get the next frame. If it's not ready, this will trigger the - * sending of FrameReady() when the image becomes ready. - * This will trigger the loading of the next batch. + * Get the interval of Nth frame. */ - TextureSet NextFrame() override; + uint32_t GetFrameInterval( uint32_t frameIndex ) override; private: /** diff --git a/dali-toolkit/internal/visuals/animated-image/image-cache.h b/dali-toolkit/internal/visuals/animated-image/image-cache.h index 7354992..1d385c8 100644 --- a/dali-toolkit/internal/visuals/animated-image/image-cache.h +++ b/dali-toolkit/internal/visuals/animated-image/image-cache.h @@ -79,17 +79,15 @@ public: virtual TextureSet FirstFrame() = 0; /** - * Get the next frame. If it's not ready, this will trigger the + * Get the Nth frame. If it's not ready, this will trigger the * sending of FrameReady() when the image becomes ready. - * This will trigger the loading of the next batch. */ - virtual TextureSet NextFrame() = 0; + virtual TextureSet Frame( uint32_t frameIndex ) = 0; /** - * Get the Nth frame. If it's not ready, this will trigger the - * sending of FrameReady() when the image becomes ready. + * Get the interval of Nth frame. */ - virtual TextureSet Frame( uint32_t frameIndex ) = 0; + virtual uint32_t GetFrameInterval( uint32_t frameIndex ) = 0; private: diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp similarity index 68% rename from dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.cpp rename to dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp index 04f0f1d..c421678 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp @@ -15,7 +15,7 @@ */ // CLASS HEADER -#include "rolling-gif-image-cache.h" +#include "rolling-animated-image-cache.h" // EXTERNAL HEADERS @@ -58,11 +58,11 @@ namespace Toolkit namespace Internal { -RollingGifImageCache::RollingGifImageCache( - TextureManager& textureManager, GifLoading& gifLoading, uint32_t frameCount, ImageCache::FrameReadyObserver& observer, +RollingAnimatedImageCache::RollingAnimatedImageCache( + TextureManager& textureManager, AnimatedImageLoading& animatedImageLoading, uint32_t frameCount, ImageCache::FrameReadyObserver& observer, uint16_t cacheSize, uint16_t batchSize ) : ImageCache( textureManager, observer, batchSize ), - mGifLoading( gifLoading ), + mAnimatedImageLoading( animatedImageLoading ), mFrameCount( frameCount ), mFrameIndex( 0 ), mCacheSize( cacheSize ), @@ -72,11 +72,11 @@ RollingGifImageCache::RollingGifImageCache( LoadBatch(); } -RollingGifImageCache::~RollingGifImageCache() +RollingAnimatedImageCache::~RollingAnimatedImageCache() { if( mTextureManagerAlive ) { - while( !mQueue.IsEmpty() ) + while( IsFrontReady() ) { ImageFrame imageFrame = mQueue.PopFront(); Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl ); @@ -84,64 +84,51 @@ RollingGifImageCache::~RollingGifImageCache() } } -TextureSet RollingGifImageCache::Frame( uint32_t frameIndex ) +TextureSet RollingAnimatedImageCache::Frame( uint32_t frameIndex ) { - // If a frame of frameIndex is not loaded, clear the queue and remove all loaded textures. - if( mImageUrls[ frameIndex ].mTextureId == TextureManager::INVALID_TEXTURE_ID ) + bool popExist = false; + while( IsFrontReady() && mQueue.Front().mFrameNumber != frameIndex ) { - mFrameIndex = frameIndex; - while( !mQueue.IsEmpty() ) - { - ImageFrame imageFrame = mQueue.PopFront(); - Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl ); - mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID; - } - LoadBatch(); + ImageFrame imageFrame = mQueue.PopFront(); + Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl ); + mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID; + popExist = true; } - // If the frame is already loaded, remove previous frames of the frame in the queue - // and load new frames amount of removed frames. - else + if( popExist || mImageUrls[ frameIndex ].mTextureId == TextureManager::INVALID_TEXTURE_ID ) { - bool popExist = false; - while( !mQueue.IsEmpty() && mQueue.Front().mFrameNumber != frameIndex ) + // If the frame of frameIndex was already loaded, load batch from the last frame of queue + if( IsFrontReady() ) { - ImageFrame imageFrame = mQueue.PopFront(); - Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl ); - mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID; - popExist = true; + mFrameIndex = ( mQueue.Back().mFrameNumber + 1 ) % mFrameCount; } - if( popExist ) + // If the queue is empty, load batch from the frame of frameIndex + else { - mFrameIndex = ( mQueue.Back().mFrameNumber + 1 ) % mFrameCount; - LoadBatch(); + mFrameIndex = frameIndex; } + LoadBatch(); } return GetFrontTextureSet(); } -TextureSet RollingGifImageCache::FirstFrame() +TextureSet RollingAnimatedImageCache::FirstFrame() { return Frame( 0u ); } -TextureSet RollingGifImageCache::NextFrame() +uint32_t RollingAnimatedImageCache::GetFrameInterval( uint32_t frameIndex ) { - ImageFrame imageFrame = mQueue.PopFront(); - Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl ); - mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID; - - LoadBatch(); - - return GetFrontTextureSet(); + Frame( frameIndex ); + return mAnimatedImageLoading.GetFrameInterval( frameIndex ); } -bool RollingGifImageCache::IsFrontReady() const +bool RollingAnimatedImageCache::IsFrontReady() const { return ( !mQueue.IsEmpty() ); } -void RollingGifImageCache::LoadBatch() +void RollingAnimatedImageCache::LoadBatch() { // Try and load up to mBatchSize images, until the cache is filled. // Once the cache is filled, as frames progress, the old frame is @@ -151,9 +138,8 @@ void RollingGifImageCache::LoadBatch() // Get the smallest number of frames we need to load int batchSize = std::min( std::size_t(mBatchSize), mCacheSize - mQueue.Count() ); - DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingGifImageCache::LoadBatch() mFrameIndex:%d batchSize:%d\n", mFrameIndex, batchSize ); - - if( mGifLoading.LoadNextNFrames( mFrameIndex, batchSize, pixelDataList) ) + DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingAnimatedImageCache::LoadBatch() mFrameIndex:%d batchSize:%d\n", mFrameIndex, batchSize ); + if( mAnimatedImageLoading.LoadNextNFrames( mFrameIndex, batchSize, pixelDataList) ) { unsigned int pixelDataListCount = pixelDataList.size(); @@ -203,15 +189,15 @@ void RollingGifImageCache::LoadBatch() LOG_CACHE; } -TextureSet RollingGifImageCache::GetFrontTextureSet() const +TextureSet RollingAnimatedImageCache::GetFrontTextureSet() const { - DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingGifImageCache::GetFrontTextureSet() FrameNumber:%d\n", mQueue[ 0 ].mFrameNumber ); + DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingAnimatedImageCache::GetFrontTextureSet() FrameNumber:%d\n", mQueue[ 0 ].mFrameNumber ); TextureManager::TextureId textureId = GetCachedTextureId( 0 ); return mTextureManager.GetTextureSet( textureId ); } -TextureManager::TextureId RollingGifImageCache::GetCachedTextureId( int index ) const +TextureManager::TextureId RollingAnimatedImageCache::GetCachedTextureId( int index ) const { return mImageUrls[ mQueue[ index ].mFrameNumber ].mTextureId; } diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.h b/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.h similarity index 72% rename from dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.h rename to dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.h index 91a1210..503f65e 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.h +++ b/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.h @@ -1,5 +1,5 @@ -#ifndef DALI_TOOLKIT_INTERNAL_ROLLING_GIF_IMAGE_CACHE_H -#define DALI_TOOLKIT_INTERNAL_ROLLING_GIF_IMAGE_CACHE_H +#ifndef DALI_TOOLKIT_INTERNAL_ROLLING_ANIMATED_IMAGE_CACHE_H +#define DALI_TOOLKIT_INTERNAL_ROLLING_ANIMATED_IMAGE_CACHE_H /* * Copyright (c) 2020 Samsung Electronics Co., Ltd. @@ -18,7 +18,7 @@ */ // EXTERNAL INCLUDES -#include +#include #include #include #include @@ -31,20 +31,20 @@ namespace Internal { /** - * Class to manage a rolling cache of GIF images, where the cache size + * Class to manage a rolling cache of Animated images, where the cache size * is smaller than the total number of images. * * Frames are always ready, so the observer.FrameReady callback is never triggered; * the FirstFrame and NextFrame APIs will always return a texture. */ -class RollingGifImageCache : public ImageCache +class RollingAnimatedImageCache : public ImageCache { public: /** * Constructor. * @param[in] textureManager The texture manager - * @param[in] gifLoader The loaded gif image - * @param[in] frameCount The number of frames in the gif + * @param[in] animatedImageLoader The loaded animated image + * @param[in] frameCount The number of frames in the animated image * @param[in] observer FrameReady observer * @param[in] cacheSize The size of the cache * @param[in] batchSize The size of a batch to load @@ -52,8 +52,8 @@ public: * This will start loading textures immediately, according to the * batch and cache sizes. */ - RollingGifImageCache( TextureManager& textureManager, - GifLoading& gifLoader, + RollingAnimatedImageCache( TextureManager& textureManager, + AnimatedImageLoading& animatedImageLoader, uint32_t frameCount, ImageCache::FrameReadyObserver& observer, uint16_t cacheSize, @@ -62,7 +62,7 @@ public: /** * Destructor */ - virtual ~RollingGifImageCache(); + virtual ~RollingAnimatedImageCache(); /** * Get the Nth frame. If it's not ready, this will trigger the @@ -77,11 +77,9 @@ public: TextureSet FirstFrame() override; /** - * Get the next frame. If it's not ready, this will trigger the - * sending of FrameReady() when the image becomes ready. - * This will trigger the loading of the next batch. + * Get the interval of Nth frame. */ - TextureSet NextFrame() override; + uint32_t GetFrameInterval( uint32_t frameIndex ) override; private: /** @@ -114,16 +112,18 @@ private: unsigned int mFrameNumber = 0u; }; - GifLoading& mGifLoading; - uint32_t mFrameCount; - int mFrameIndex; - std::vector mImageUrls; - uint16_t mCacheSize; - CircularQueue mQueue; + Dali::AnimatedImageLoading& mAnimatedImageLoading; + uint32_t mFrameCount; + int mFrameIndex; + std::vector mImageUrls; + uint16_t mCacheSize; + CircularQueue mQueue; }; } // namespace Internal + } // namespace Toolkit + } // namespace Dali -#endif +#endif //DALI_TOOLKIT_INTERNAL_ROLLING_ANIMATED_IMAGE_CACHE_H diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp index 21f81b7..2284778 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp @@ -131,26 +131,9 @@ TextureSet RollingImageCache::FirstFrame() return Frame( 0u ); } -TextureSet RollingImageCache::NextFrame() +uint32_t RollingImageCache::GetFrameInterval( uint32_t frameIndex ) { - TextureSet textureSet; - - ImageFrame imageFrame = mQueue.PopFront(); - mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId, this ); - mImageUrls[ imageFrame.mUrlIndex ].mTextureId = TextureManager::INVALID_TEXTURE_ID; - - LoadBatch(); - - if( IsFrontReady() == true ) - { - textureSet = GetFrontTextureSet(); - } - else - { - mWaitingForReadyFrame = true; - } - - return textureSet; + return 0u; } bool RollingImageCache::IsFrontReady() const diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h index 47a5155..f57b5c2 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h +++ b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h @@ -72,11 +72,9 @@ public: TextureSet FirstFrame() override; /** - * Get the next frame. If it's not ready, this will trigger the - * sending of FrameReady() when the image becomes ready. - * This will trigger the loading of the next batch. + * Get the interval of Nth frame. */ - TextureSet NextFrame() override; + uint32_t GetFrameInterval( uint32_t frameIndex ) override; private: /** diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index dc35220..d753ddb 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -165,6 +165,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property break; } case VisualUrl::GIF: + case VisualUrl::WEBP: { visualPtr = AnimatedImageVisual::New( GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl, propertyMap ); break; @@ -361,6 +362,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const std::string& url, Image break; } case VisualUrl::GIF: + case VisualUrl::WEBP: { visualPtr = AnimatedImageVisual::New( GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl ); break; diff --git a/dali-toolkit/internal/visuals/visual-url.cpp b/dali-toolkit/internal/visuals/visual-url.cpp index 731ed20..451ac06 100644 --- a/dali-toolkit/internal/visuals/visual-url.cpp +++ b/dali-toolkit/internal/visuals/visual-url.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -99,9 +99,11 @@ VisualUrl::Type ResolveType( const std::string& url ) enum { SUFFIX, HASH, HASH_DOT } state = SUFFIX; char SVG[ 4 ] = { 'g', 'v', 's', '.' }; char GIF[ 4 ] = { 'f', 'i', 'g', '.' }; + char WEBP[ 5 ] = { 'p', 'b', 'e', 'w', '.' }; char JSON[ 5 ] = { 'n', 'o', 's', 'j', '.' }; unsigned int svgScore = 0; unsigned int gifScore = 0; + unsigned int webpScore = 0; unsigned int jsonScore = 0; int index = count; while( --index >= 0 ) @@ -124,6 +126,14 @@ VisualUrl::Type ResolveType( const std::string& url ) return VisualUrl::GIF; } } + if( ( offsetFromEnd < sizeof(WEBP) )&&( currentChar == WEBP[ offsetFromEnd ] ) ) + { + // early out if WEBP as can't be used in N patch for now + if( ++webpScore == sizeof(WEBP) ) + { + return VisualUrl::WEBP; + } + } if( ( offsetFromEnd < sizeof(JSON) )&&( currentChar == JSON[ offsetFromEnd ] ) ) { // early out if JSON as can't be used in N patch for now diff --git a/dali-toolkit/internal/visuals/visual-url.h b/dali-toolkit/internal/visuals/visual-url.h index f3af2e0..63ad5e4 100644 --- a/dali-toolkit/internal/visuals/visual-url.h +++ b/dali-toolkit/internal/visuals/visual-url.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_VISUAL_URL_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -41,6 +41,7 @@ public: N_PATCH, SVG, GIF, + WEBP, JSON }; -- 2.7.4 From 0b2c26595d9bddb2c7ec9f9f7931920c9185501e Mon Sep 17 00:00:00 2001 From: Sunghyun kim Date: Mon, 13 Jan 2020 16:05:19 +0900 Subject: [PATCH 03/16] Change not to use the mask if it is set to an empty path If an application sets an empty path to the alpha mask, unload the alpha mask. Change-Id: Id70bf53f5fc631c9d82a59472f4d05d5d276f6b9 --- .../utc-Dali-TextureManager.cpp | 68 ++++++++++++++++++++++ .../internal/visuals/texture-manager-impl.cpp | 4 +- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp index f2b032d..a6b7460 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp @@ -25,6 +25,7 @@ #include #include #include +#include using namespace Dali::Toolkit::Internal; @@ -204,3 +205,70 @@ int UtcTextureManagerCachingForDifferentLoadingType(void) END_TEST; } + +int UtcTextureManagerUseInvalidMask(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcTextureManagerUseInvalidMask" ); + + TextureManager textureManager; // Create new texture manager + + TestObserver observer; + std::string filename( TEST_IMAGE_FILE_NAME ); + std::string maskname(""); + TextureManager::MaskingDataPointer maskInfo = nullptr; + maskInfo.reset(new TextureManager::MaskingData()); + maskInfo->mAlphaMaskUrl = maskname; + maskInfo->mAlphaMaskId = TextureManager::INVALID_TEXTURE_ID; + maskInfo->mCropToMask = true; + maskInfo->mContentScaleFactor = 1.0f; + + auto textureId( TextureManager::INVALID_TEXTURE_ID ); + Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f ); + Dali::ImageDimensions atlasRectSize( 0,0 ); + bool synchronousLoading(false); + bool atlasingStatus(false); + bool loadingStatus(false); + auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; + ImageAtlasManagerPtr atlasManager = nullptr; + Toolkit::AtlasUploadObserver* atlasUploadObserver = nullptr; + + textureManager.LoadTexture( + filename, + ImageDimensions(), + FittingMode::SCALE_TO_FILL, + SamplingMode::BOX_THEN_LINEAR, + maskInfo, + synchronousLoading, + textureId, + atlasRect, + atlasRectSize, + atlasingStatus, + loadingStatus, + WrapMode::DEFAULT, + WrapMode::DEFAULT, + &observer, + atlasUploadObserver, + atlasManager, + true, + TextureManager::ReloadPolicy::CACHED, + preMultiply + ); + + DALI_TEST_EQUALS( observer.mLoaded, false, TEST_LOCATION ); + DALI_TEST_EQUALS( observer.mObserverCalled, false, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( observer.mLoaded, true, TEST_LOCATION ); + DALI_TEST_EQUALS( observer.mObserverCalled, true, TEST_LOCATION ); + DALI_TEST_EQUALS( observer.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION ); + + END_TEST; +} diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index 8912c17..f4fa5fb 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -208,7 +208,7 @@ TextureSet TextureManager::LoadTexture( { Devel::PixelBuffer pixelBuffer = LoadImageFromFile( url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection ); - if( maskInfo ) + if( maskInfo && maskInfo->mAlphaMaskUrl.IsValid() ) { Devel::PixelBuffer maskPixelBuffer = LoadImageFromFile( maskInfo->mAlphaMaskUrl.GetUrl(), ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, true ); @@ -270,7 +270,7 @@ TextureSet TextureManager::LoadTexture( if( !textureSet ) // big image, no atlasing or atlasing failed { atlasingStatus = false; - if( !maskInfo ) + if( !maskInfo || !maskInfo->mAlphaMaskUrl.IsValid() ) { textureId = RequestLoad( url, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, textureObserver, orientationCorrection, reloadPolicy, preMultiplyOnLoad ); -- 2.7.4 From 22145128af65439a70266fd55533efaf9db78579 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Mon, 6 Jul 2020 17:55:33 +0900 Subject: [PATCH 04/16] DALi Version 1.5.18 Change-Id: I20a7a54967ece305e8db8faa5c332bf4cccf5faa Signed-off-by: Seungho, Baek --- dali-toolkit/public-api/dali-toolkit-version.cpp | 2 +- packaging/dali-toolkit.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index 1553ce2..1fc75cb 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 = 5; -const unsigned int TOOLKIT_MICRO_VERSION = 17; +const unsigned int TOOLKIT_MICRO_VERSION = 18; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 71dced0..ee0f96b 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: Dali 3D engine Toolkit -Version: 1.5.17 +Version: 1.5.18 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT -- 2.7.4 From 946af1f4d8c0e6d04868ae73fef6299943ac960e Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Fri, 26 Jun 2020 15:44:13 +0100 Subject: [PATCH 05/16] Fixes for the CMake build on MS-Windows. Change-Id: I4812a6292521f777c3e020130c84da794b8f007e Signed-off-by: Victor Cebollada --- build/tizen/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index fde4eb2..0423307 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -283,6 +283,8 @@ IF( WIN32 ) FIND_PACKAGE( unofficial-angle REQUIRED ) FIND_PACKAGE( unofficial-cairo REQUIRED ) + FIND_PACKAGE( WebP REQUIRED ) + SET( DALIADAPTOR_LDFLAGS "${DALIADAPTOR_LDFLAGS}" dali-adaptor::dali-adaptor ) -- 2.7.4 From 651ecbbdae3201c84119a5efd4e6c54d382abe3f Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Tue, 30 Jun 2020 16:48:44 +0100 Subject: [PATCH 06/16] Fixed SVACE error in TextVisual Change-Id: Icf15764d48b0b879577451172bced309bfffada4 --- dali-toolkit/internal/visuals/text/text-visual.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) mode change 100755 => 100644 dali-toolkit/internal/visuals/text/text-visual.cpp diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp old mode 100755 new mode 100644 index a3057c3..04f3618 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -820,8 +820,11 @@ void TextVisual::AddRenderer( Actor& actor, const Vector2& size, bool hasMultipl // Get the current offset for recalculate the offset when tiling. Property::Map retMap; mImpl->mTransform.GetPropertyMap( retMap ); - Vector2 offSet = retMap.Find( Dali::Toolkit::Visual::Transform::Property::OFFSET )->Get< Vector2 >(); - info.offSet = offSet; + Property::Value* offsetValue = retMap.Find( Dali::Toolkit::Visual::Transform::Property::OFFSET ); + if( offsetValue ) + { + offsetValue->Get( info.offSet ); + } // Create a textureset in the default renderer. CreateTextureSet( info, mImpl->mRenderer, sampler, hasMultipleTextColors, containsColorGlyph, styleEnabled ); -- 2.7.4 From cad91bf56a353ee70a33952d3968597a012a19b6 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Thu, 9 Jul 2020 13:19:03 +0900 Subject: [PATCH 07/16] DALi Version 1.5.19 Change-Id: I9d341fff0e8e67a550e6d459df55021ba0411716 Signed-off-by: Seungho, Baek --- dali-toolkit/public-api/dali-toolkit-version.cpp | 2 +- packaging/dali-toolkit.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index 1fc75cb..57cd508 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 = 5; -const unsigned int TOOLKIT_MICRO_VERSION = 18; +const unsigned int TOOLKIT_MICRO_VERSION = 19; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index ee0f96b..ba76dd8 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: Dali 3D engine Toolkit -Version: 1.5.18 +Version: 1.5.19 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT -- 2.7.4 From 2c7f0246a7bbfeb207fcd84a68c41dbeff0a24f0 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Mon, 6 Jul 2020 15:41:28 +0900 Subject: [PATCH 08/16] (Vector) Ensure not to add duplicated task Change-Id: I3f023b6615ca36b40ddc3534fd8faab7985eb08e --- .../utc-Dali-AnimatedVectorImageVisual.cpp | 4 ++ .../vector-animation-task.cpp | 15 +----- .../animated-vector-image/vector-animation-task.h | 1 - .../vector-animation-thread.cpp | 60 +++++++++++++++++----- .../vector-animation-thread.h | 1 + 5 files changed, 53 insertions(+), 28 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp index 7816a11..8e19dcb 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp @@ -270,6 +270,8 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void) application.SendNotification(); application.Render(); + std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run + Property::Map resultMap; resultMap = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); @@ -679,6 +681,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void) application.SendNotification(); application.Render(); + std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run + map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); value = map.Find( DevelImageVisual::Property::PLAY_RANGE ); diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp index 55968e1..bae4fbc 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp @@ -70,7 +70,6 @@ VectorAnimationTask::VectorAnimationTask( VisualFactoryCache& factoryCache, cons mAnimationDataIndex( 0 ), mLoopCount( LOOP_FOREVER ), mCurrentLoop( 0 ), - mResourceReady( false ), mForward( true ), mUpdateFrameNumber( false ), mNeedAnimationFinishedTrigger( true ), @@ -138,8 +137,6 @@ void VectorAnimationTask::SetSize( uint32_t width, uint32_t height ) mWidth = width; mHeight = height; - mResourceReady = false; - DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetSize: width = %d, height = %d [%p]\n", width, height, this ); } } @@ -148,6 +145,7 @@ void VectorAnimationTask::PlayAnimation() { if( mPlayState != PlayState::PLAYING ) { + mNeedAnimationFinishedTrigger = true; mUpdateFrameNumber = false; mPlayState = PlayState::PLAYING; @@ -266,12 +264,10 @@ void VectorAnimationTask::SetPlayRange( const Property::Array& playRange ) if( mStartFrame > mCurrentFrame ) { mCurrentFrame = mStartFrame; - mResourceReady = false; } else if( mEndFrame < mCurrentFrame ) { mCurrentFrame = mEndFrame; - mResourceReady = false; } DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetPlayRange: [%d, %d] [%p]\n", mStartFrame, mEndFrame, this ); @@ -302,7 +298,6 @@ void VectorAnimationTask::SetCurrentFrameNumber( uint32_t frameNumber ) { mCurrentFrame = frameNumber; mUpdateFrameNumber = false; - mResourceReady = false; DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetCurrentFrameNumber: frame number = %d [%p]\n", mCurrentFrame, this ); } @@ -394,10 +389,7 @@ bool VectorAnimationTask::Rasterize() currentFrame = mCurrentFrame; - // Reset values - mResourceReady = true; mUpdateFrameNumber = true; - mNeedAnimationFinishedTrigger = true; if( mPlayState == PlayState::STOPPING ) { @@ -462,11 +454,6 @@ bool VectorAnimationTask::Rasterize() { DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Rendering failed. Try again later.[%d] [%p]\n", currentFrame, this ); mUpdateFrameNumber = false; - - if( !mResourceReady ) - { - mResourceReady = false; - } } } diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h index 79c3ee2..844d378 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h @@ -309,7 +309,6 @@ private: uint32_t mAnimationDataIndex; int32_t mLoopCount; int32_t mCurrentLoop; - bool mResourceReady; bool mForward; bool mUpdateFrameNumber; bool mNeedAnimationFinishedTrigger; diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp index 8403e6a..c80e00a 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp @@ -59,6 +59,7 @@ Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New( Debug::NoLogging, VectorAnimationThread::VectorAnimationThread() : mAnimationTasks(), mCompletedTasks(), + mWorkingTasks(), mRasterizers( GetNumberOfThreads( NUMBER_OF_RASTERIZE_THREADS_ENV, DEFAULT_NUMBER_OF_RASTERIZE_THREADS ), [&]() { return RasterizeHelper( *this ); } ), mSleepThread( MakeCallback( this, &VectorAnimationThread::OnAwakeFromSleep ) ), mConditionalWait(), @@ -75,6 +76,7 @@ VectorAnimationThread::~VectorAnimationThread() { ConditionalWait::ScopedLock lock( mConditionalWait ); mDestroyThread = true; + mNeedToSleep = false; mConditionalWait.Notify( lock ); } @@ -108,6 +110,7 @@ void VectorAnimationThread::AddTask( VectorAnimationTaskPtr task ) mAnimationTasks.push_back( task ); } + mNeedToSleep = false; // wake up the animation thread mConditionalWait.Notify( lock ); } @@ -115,14 +118,35 @@ void VectorAnimationThread::AddTask( VectorAnimationTaskPtr task ) void VectorAnimationThread::OnTaskCompleted( VectorAnimationTaskPtr task, bool keepAnimation ) { - if( keepAnimation && !mDestroyThread ) + if( !mDestroyThread ) { ConditionalWait::ScopedLock lock( mConditionalWait ); + bool needRasterize = false; + + auto workingTask = std::find( mWorkingTasks.begin(), mWorkingTasks.end(), task ); + if( workingTask != mWorkingTasks.end() ) + { + mWorkingTasks.erase( workingTask ); + } - if( mCompletedTasks.end() == std::find( mCompletedTasks.begin(), mCompletedTasks.end(), task ) ) + // Check pending task + if( mAnimationTasks.end() != std::find( mAnimationTasks.begin(), mAnimationTasks.end(), task ) ) { - mCompletedTasks.push_back( task ); + needRasterize = true; + } + + if( keepAnimation ) + { + if( mCompletedTasks.end() == std::find( mCompletedTasks.begin(), mCompletedTasks.end(), task ) ) + { + mCompletedTasks.push_back( task ); + needRasterize = true; + } + } + if( needRasterize ) + { + mNeedToSleep = false; // wake up the animation thread mConditionalWait.Notify( lock ); } @@ -156,12 +180,12 @@ void VectorAnimationThread::Rasterize() ConditionalWait::ScopedLock lock( mConditionalWait ); // conditional wait - if( (mAnimationTasks.empty() && mCompletedTasks.empty() ) || mNeedToSleep ) + if( mNeedToSleep ) { mConditionalWait.Wait( lock ); } - mNeedToSleep = false; + mNeedToSleep = true; // Process completed tasks for( auto&& task : mCompletedTasks ) @@ -192,10 +216,9 @@ void VectorAnimationThread::Rasterize() mCompletedTasks.clear(); // pop out the next task from the queue - while( !mAnimationTasks.empty() && !mNeedToSleep ) + for( auto it = mAnimationTasks.begin(); it != mAnimationTasks.end(); ) { - std::vector< VectorAnimationTaskPtr >::iterator next = mAnimationTasks.begin(); - VectorAnimationTaskPtr nextTask = *next; + VectorAnimationTaskPtr nextTask = *it; auto currentTime = std::chrono::system_clock::now(); auto nextFrameTime = nextTask->GetNextFrameTime(); @@ -208,17 +231,28 @@ void VectorAnimationThread::Rasterize() if( nextFrameTime <= currentTime ) { - mAnimationTasks.erase( next ); + // If the task is not in the working list + if( std::find( mWorkingTasks.begin(), mWorkingTasks.end(), nextTask ) == mWorkingTasks.end() ) + { + it = mAnimationTasks.erase( it ); + + // Add it to the working list + mWorkingTasks.push_back( nextTask ); - auto rasterizerHelperIt = mRasterizers.GetNext(); - DALI_ASSERT_ALWAYS( rasterizerHelperIt != mRasterizers.End() ); + auto rasterizerHelperIt = mRasterizers.GetNext(); + DALI_ASSERT_ALWAYS( rasterizerHelperIt != mRasterizers.End() ); - rasterizerHelperIt->Rasterize( nextTask ); + rasterizerHelperIt->Rasterize( nextTask ); + } + else + { + it++; + } } else { - mNeedToSleep = true; mSleepThread.SleepUntil( nextFrameTime ); + break; } } } diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h index 8d3dd64..964f662 100755 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h @@ -183,6 +183,7 @@ private: std::vector< VectorAnimationTaskPtr > mAnimationTasks; std::vector< VectorAnimationTaskPtr > mCompletedTasks; + std::vector< VectorAnimationTaskPtr > mWorkingTasks; RoundRobinContainerView< RasterizeHelper > mRasterizers; SleepThread mSleepThread; ConditionalWait mConditionalWait; -- 2.7.4 From 08566df88fd60a844011c19b5bf6cc26ad1fc655 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Thu, 9 Jul 2020 18:37:43 +0900 Subject: [PATCH 09/16] Divide Render() into small apis Change-Id: If20f7a5cef20386e2aeb00cf1d3e283b10da3e93 --- dali-toolkit/devel-api/text/text-utils-devel.cpp | 511 +++++++++++++++-------- 1 file changed, 333 insertions(+), 178 deletions(-) diff --git a/dali-toolkit/devel-api/text/text-utils-devel.cpp b/dali-toolkit/devel-api/text/text-utils-devel.cpp index fc8afb9..ccea7e0 100755 --- a/dali-toolkit/devel-api/text/text-utils-devel.cpp +++ b/dali-toolkit/devel-api/text/text-utils-devel.cpp @@ -104,6 +104,36 @@ DALI_ENUM_TO_STRING_WITH_SCOPE( DevelText::CircularAlignment, CENTER ) DALI_ENUM_TO_STRING_WITH_SCOPE( DevelText::CircularAlignment, END ) DALI_ENUM_TO_STRING_TABLE_END( CIRCULAR_ALIGNMENT_TYPE ) +struct InternalDataModel +{ + InternalDataModel( FontClient& fontClient, + MetricsPtr metrics, + Text::ModelPtr textModel ) + : fontClient( fontClient ), + metrics( metrics ), + textModel( textModel ), + numberOfCharacters{ 0u }, + isTextMirrored{ false }, + numberOfGlyphs{ 0u } + { + layoutEngine.SetMetrics( metrics ); + } + + FontClient& fontClient; + MetricsPtr metrics; + Text::Layout::Engine layoutEngine; ///< The layout engine. + Text::ModelPtr textModel; ///< Pointer to the text's model. + Vector blendingMode; ///< How embedded items and bitmap font glyphs are blended with color text. + Vector isEmoji; ///< Whether the glyph is an emoji. + + Vector mirroredUtf32Characters; // The utf32Characters Characters but mirrored if there are RTL text. + + Length numberOfCharacters; // The number of characters (not glyphs!). + bool isTextMirrored ; // Whether the text has been mirrored. + + Length numberOfGlyphs; +}; + bool GetLayoutEnumeration(const Property::Value& propertyValue, DevelText::Layout::Type& layout) { return Scripting::GetEnumerationProperty(propertyValue, LAYOUT_TYPE_TABLE, LAYOUT_TYPE_TABLE_COUNT, layout); @@ -114,80 +144,38 @@ bool GetCircularAlignmentEnumeration(const Property::Value& propertyValue, Devel return Scripting::GetEnumerationProperty(propertyValue, CIRCULAR_ALIGNMENT_TYPE_TABLE, CIRCULAR_ALIGNMENT_TYPE_TABLE_COUNT, circularAlignment); } -Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector& embeddedItemLayout ) -{ - if( textParameters.text.empty() ) - { - Dali::Devel::PixelBuffer pixelBuffer = Dali::Devel::PixelBuffer::New( textParameters.textWidth, - textParameters.textHeight, - Dali::Pixel::RGBA8888 ); - - const unsigned int bufferSize = textParameters.textWidth * textParameters.textHeight * Dali::Pixel::GetBytesPerPixel(Dali::Pixel::RGBA8888); - unsigned char* buffer = pixelBuffer.GetBuffer(); - memset(buffer, 0, bufferSize); - return pixelBuffer; - } +void ShapeTextPreprocess( const RendererParameters& textParameters, TextAbstraction::TextRenderer::Parameters& rendererParameters, InternalDataModel& internalDataModel ) +{ MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get(); - FontClient fontClient = FontClient::Get(); - MetricsPtr metrics; - Text::Layout::Engine layoutEngine; ///< The layout engine. - Text::ModelPtr textModel = Text::Model::New(); ///< Pointer to the text's model. - Vector blendingMode; ///< How embedded items and bitmap font glyphs are blended with color text. - Vector isEmoji; ///< Whether the glyph is an emoji. - - // Use this to access FontClient i.e. to get down-scaled Emoji metrics. - metrics = Metrics::New( fontClient ); - layoutEngine.SetMetrics( metrics ); - - TextAbstraction::TextRenderer::Parameters rendererParameters( textModel->mVisualModel->mGlyphs, - textModel->mVisualModel->mGlyphPositions, - textModel->mVisualModel->mColors, - textModel->mVisualModel->mColorIndices, - blendingMode, - isEmoji ); + const uint8_t* utf8 = NULL; // pointer to the first character of the text (encoded in utf8) + Length textSize = 0u; // The length of the utf8 string. - rendererParameters.width = textParameters.textWidth; - rendererParameters.height = textParameters.textHeight; - rendererParameters.pixelFormat = TextAbstraction::TextRenderer::Parameters::RGBA8888; // @note: At the moment all textures are generated RGBA8888 + Length& numberOfCharacters = internalDataModel.numberOfCharacters; + Vector& mirroredUtf32Characters = internalDataModel.mirroredUtf32Characters; + Text::ModelPtr& textModel = internalDataModel.textModel; Vector& utf32Characters = textModel->mLogicalModel->mText; // Characters encoded in utf32. - Vector mirroredUtf32Characters; // The utf32Characters Characters but mirrored if there are RTL text. Vector& lineBreakInfo = textModel->mLogicalModel->mLineBreakInfo; // The line break info. Vector& scripts = textModel->mLogicalModel->mScriptRuns; // Charactes's script. Vector& fontDescriptionRuns = textModel->mLogicalModel->mFontDescriptionRuns; // Desired font descriptions. Vector& validFonts = textModel->mLogicalModel->mFontRuns; // Validated fonts. Vector& bidirectionalInfo = textModel->mLogicalModel->mBidirectionalParagraphInfo; // The bidirectional info per paragraph. - //Vector& bidirectionalLineInfo = textModel->mLogicalModel->mBidirectionalLineInfo; // The bidirectional info per line. Vector& directions = textModel->mLogicalModel->mCharacterDirections; // Character's directions. Vector& colorRuns = textModel->mLogicalModel->mColorRuns; // colors of the text. - Vector& glyphsToCharacters = textModel->mVisualModel->mGlyphsToCharacters; // Glyphs to character map. - Vector& charactersToGlyph = textModel->mVisualModel->mCharactersToGlyph; // Characters to glyphs map. - Vector& charactersPerGlyph = textModel->mVisualModel->mCharactersPerGlyph; // Number of characters per glyph. - Vector& glyphsPerCharacter = textModel->mVisualModel->mGlyphsPerCharacter; // The number of glyphs that are shaped. - Vector& lines = textModel->mVisualModel->mLines; // The laid out lines. - - Vector newParagraphGlyphs; // Glyphs for the new paragraph characters. - // the default font's description. FontDescription defaultFontDescription; PointSize26Dot6 defaultPointSize = FontClient::DEFAULT_POINT_SIZE; - Length numberOfCharacters = 0u; // The number of characters (not glyphs!). - bool isTextMirrored = false; // Whether the text has been mirrored. - - const uint8_t* utf8 = NULL; // pointer to the first character of the text (encoded in utf8) - Length textSize = 0u; // The length of the utf8 string. - //////////////////////////////////////////////////////////////////////////////// // Process the markup string if the mark-up processor is enabled. //////////////////////////////////////////////////////////////////////////////// MarkupProcessData markupProcessData( colorRuns, - fontDescriptionRuns, - textModel->mLogicalModel->mEmbeddedItems ); + fontDescriptionRuns, + textModel->mLogicalModel->mEmbeddedItems ); if (textParameters.markupEnabled) { @@ -232,9 +220,9 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector& embeddedItemLayout, InternalDataModel& internalDataModel ) +{ + Vector newParagraphGlyphs; // Glyphs for the new paragraph characters. + const Length numberOfCharacters = internalDataModel.numberOfCharacters; + const bool isTextMirrored = internalDataModel.isTextMirrored; + Text::ModelPtr& textModel = internalDataModel.textModel; + const Vector& mirroredUtf32Characters = internalDataModel.mirroredUtf32Characters; + FontClient& fontClient = internalDataModel.fontClient; + const Vector& utf32Characters = textModel->mLogicalModel->mText; // Characters encoded in utf32. + const Vector& lineBreakInfo = textModel->mLogicalModel->mLineBreakInfo; // The line break info. + const Vector& scripts = textModel->mLogicalModel->mScriptRuns; // Charactes's script. + const Vector& validFonts = textModel->mLogicalModel->mFontRuns; // Validated fonts. + + Vector& glyphsToCharacters = textModel->mVisualModel->mGlyphsToCharacters; // Glyphs to character map. + Vector& charactersPerGlyph = textModel->mVisualModel->mCharactersPerGlyph; // Number of characters per glyph. //////////////////////////////////////////////////////////////////////////////// // Retrieve the glyphs. Text shaping @@ -363,7 +368,7 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, VectormVisualModel->CreateGlyphsPerCharacterTable( 0u, 0u, numberOfCharacters ); textModel->mVisualModel->CreateCharacterToGlyphTable( 0u, 0u, numberOfCharacters ); - const Length numberOfGlyphs = rendererParameters.glyphs.Count(); + internalDataModel.numberOfGlyphs = rendererParameters.glyphs.Count(); // Once the text has been shaped and the glyphs created it's possible to replace the font id of those glyphs // that represent an image or an item and create the embedded item layout info. @@ -402,12 +407,18 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector& blendingMode = internalDataModel.blendingMode; + + Vector& colorRuns = textModel->mLogicalModel->mColorRuns; // colors of the text. - metrics->GetGlyphMetrics( rendererParameters.glyphs.Begin(), numberOfGlyphs ); + Vector& charactersToGlyph = textModel->mVisualModel->mCharactersToGlyph; // Characters to glyphs map. + Vector& glyphsPerCharacter = textModel->mVisualModel->mGlyphsPerCharacter; // The number of glyphs that are shaped. //////////////////////////////////////////////////////////////////////////////// // Set the color runs in glyphs. @@ -418,7 +429,7 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, VectormVisualModel->mColors, textModel->mVisualModel->mColorIndices ); @@ -426,7 +437,7 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, VectormVisualModel->mColors.Insert( textModel->mVisualModel->mColors.Begin(),textParameters.textColor ); // Set how the embedded items are blended with text color. - blendingMode.Resize( numberOfGlyphs, textParameters.isTextColorSet ? ColorBlendingMode::MULTIPLY : ColorBlendingMode::NONE ); + blendingMode.Resize( internalDataModel.numberOfGlyphs, textParameters.isTextColorSet ? ColorBlendingMode::MULTIPLY : ColorBlendingMode::NONE ); if( !textParameters.isTextColorSet ) { @@ -450,7 +461,15 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, VectormVisualModel->mCharactersToGlyph[item.characterIndex]; blendingMode[glyphIndex] = item.colorBlendingMode; } +} +void SetEmojiVector( InternalDataModel& internalDataModel ) +{ + Vector& isEmoji = internalDataModel.isEmoji; + Text::ModelPtr& textModel = internalDataModel.textModel; + const Length numberOfGlyphs = internalDataModel.numberOfGlyphs; + + const Vector& scripts = textModel->mLogicalModel->mScriptRuns; // Charactes's script. //////////////////////////////////////////////////////////////////////////////// // Set the isEmoji Vector //////////////////////////////////////////////////////////////////////////////// @@ -471,120 +490,21 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector( maxAscenderDescender ); - - // Convert CircularAlignment to HorizontalAlignment. - if( isCircularTextLayout ) - { - switch( circularAlignment ) - { - case CircularAlignment::BEGIN: - { - horizontalCircularAlignment = Toolkit::HorizontalAlignment::BEGIN; - break; - } - case CircularAlignment::CENTER: - { - horizontalCircularAlignment = Toolkit::HorizontalAlignment::CENTER; - break; - } - case CircularAlignment::END: - { - horizontalCircularAlignment = Toolkit::HorizontalAlignment::END; - break; - } - } - } - - // Set the layout parameters. - Size textLayoutArea( static_cast( textParameters.textWidth ), - static_cast( textParameters.textHeight ) ); - - if( isCircularTextLayout ) - { - // In a circular layout, the length of the text area depends on the radius. - rendererParameters.radius = radius; - textLayoutArea.width = fabs( Radian( Degree( textParameters.incrementAngle ) ) * static_cast( rendererParameters.radius ) ); - } - - textModel->mHorizontalAlignment = isCircularTextLayout ? horizontalCircularAlignment : horizontalAlignment; - textModel->mLineWrapMode = LineWrap::WORD; - textModel->mIgnoreSpacesAfterText = false; - textModel->mMatchSystemLanguageDirection = false; - Text::Layout::Parameters layoutParameters( textLayoutArea, - textModel ); - - // Resize the vector of positions to have the same size than the vector of glyphs. - rendererParameters.positions.Resize( numberOfGlyphs ); - - // Whether the last character is a new paragraph character. - layoutParameters.isLastNewParagraph = TextAbstraction::IsNewParagraph( textToShape[numberOfCharacters - 1u] ); - // The initial glyph and the number of glyphs to layout. - layoutParameters.startGlyphIndex = 0u; - layoutParameters.numberOfGlyphs = numberOfGlyphs; - layoutParameters.startLineIndex = 0u; - layoutParameters.estimatedNumberOfLines = 1u; - layoutParameters.interGlyphExtraAdvance = 0.f; +void Align( const RendererParameters& textParameters, TextAbstraction::TextRenderer::Parameters& rendererParameters, + Vector& embeddedItemLayout, InternalDataModel& internalDataModel, + Size& textLayoutArea, const Size& newLayoutSize, + const bool isCircularTextLayout, const bool isClockwise, + HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment, CircularAlignment::Type circularAlignment, + const unsigned int radius ) +{ + Text::Layout::Engine& layoutEngine = internalDataModel.layoutEngine; + Text::ModelPtr& textModel = internalDataModel.textModel; + const Length numberOfCharacters = internalDataModel.numberOfCharacters; - // Update the visual model. - Size newLayoutSize; - bool isAutoScrollEnabled = false; - layoutEngine.LayoutText( layoutParameters, - newLayoutSize, - textParameters.ellipsisEnabled, - isAutoScrollEnabled ); + Vector& lines = textModel->mVisualModel->mLines; // The laid out lines. //////////////////////////////////////////////////////////////////////////////// // Align the text. @@ -730,7 +650,7 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector& embeddedItemLayout, Size& textLayoutArea, InternalDataModel& internalDataModel ) +{ + Text::ModelPtr& textModel = internalDataModel.textModel; + FontClient& fontClient = internalDataModel.fontClient; + + Vector& lines = textModel->mVisualModel->mLines; // The laid out lines. + Vector& isEmoji = internalDataModel.isEmoji; + //////////////////////////////////////////////////////////////////////////////// // Ellipsis the text. //////////////////////////////////////////////////////////////////////////////// @@ -995,7 +926,149 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector& embeddedItemLayout, InternalDataModel& internalDataModel ) +{ + //////////////////////////////////////////////////////////////////////////////// + // Layout the text. + //////////////////////////////////////////////////////////////////////////////// + Text::ModelPtr& textModel = internalDataModel.textModel; + Text::Layout::Engine& layoutEngine = internalDataModel.layoutEngine; + FontClient& fontClient = internalDataModel.fontClient; + const Length numberOfGlyphs = internalDataModel.numberOfGlyphs; + const bool isTextMirrored = internalDataModel.isTextMirrored; + const Vector& mirroredUtf32Characters = internalDataModel.mirroredUtf32Characters; + const Length numberOfCharacters = internalDataModel.numberOfCharacters; + + // Sets the alignment + HorizontalAlignment::Type horizontalAlignment = Toolkit::HorizontalAlignment::CENTER; + HorizontalAlignment::Type horizontalCircularAlignment = Toolkit::HorizontalAlignment::CENTER; + VerticalAlignment::Type verticalAlignment = VerticalAlignment::CENTER; + Layout::Type layout = Layout::SINGLELINE; + CircularAlignment::Type circularAlignment = CircularAlignment::BEGIN; + + Property::Value horizontalAlignmentStr( textParameters.horizontalAlignment ); + GetHorizontalAlignmentEnumeration( horizontalAlignmentStr, horizontalAlignment ); + horizontalCircularAlignment = horizontalAlignment; + + Property::Value verticalAlignmentStr( textParameters.verticalAlignment ); + GetVerticalAlignmentEnumeration( verticalAlignmentStr, verticalAlignment ); + + Property::Value layoutStr( textParameters.layout ); + GetLayoutEnumeration( layoutStr, layout ); + + Property::Value circularAlignmentStr( textParameters.circularAlignment ); + GetCircularAlignmentEnumeration( circularAlignmentStr, circularAlignment ); + + // Whether the layout is multi-line. + const Text::Layout::Engine::Type horizontalLayout = ( Layout::MULTILINE == layout ) ? Text::Layout::Engine::MULTI_LINE_BOX : Text::Layout::Engine::SINGLE_LINE_BOX; + layoutEngine.SetLayout( horizontalLayout ); // TODO: multi-line. + + + // Whether the layout is circular. + const bool isCircularTextLayout = (Layout::CIRCULAR == layout); + const bool isClockwise = isCircularTextLayout && ( 0.f < textParameters.incrementAngle ); + + // Calculates the max ascender or the max descender. + // Is used to calculate the radius of the base line of the text. + float maxAscenderDescender = 0.f; + if( isCircularTextLayout ) + { + FontId currentFontId = 0u; + for( const auto& glyph : rendererParameters.glyphs ) + { + if( currentFontId != glyph.fontId ) + { + currentFontId = glyph.fontId; + FontMetrics metrics; + fontClient.GetFontMetrics(currentFontId, metrics); + maxAscenderDescender = std::max( maxAscenderDescender, isClockwise ? metrics.ascender : metrics.descender ); + } + } + } + const unsigned int radius = textParameters.radius - static_cast( maxAscenderDescender ); + + // Convert CircularAlignment to HorizontalAlignment. + if( isCircularTextLayout ) + { + switch( circularAlignment ) + { + case CircularAlignment::BEGIN: + { + horizontalCircularAlignment = Toolkit::HorizontalAlignment::BEGIN; + break; + } + case CircularAlignment::CENTER: + { + horizontalCircularAlignment = Toolkit::HorizontalAlignment::CENTER; + break; + } + case CircularAlignment::END: + { + horizontalCircularAlignment = Toolkit::HorizontalAlignment::END; + break; + } + } + } + + // Set the layout parameters. + Size textLayoutArea( static_cast( textParameters.textWidth ), + static_cast( textParameters.textHeight ) ); + + if( isCircularTextLayout ) + { + // In a circular layout, the length of the text area depends on the radius. + rendererParameters.radius = radius; + textLayoutArea.width = fabs( Radian( Degree( textParameters.incrementAngle ) ) * static_cast( rendererParameters.radius ) ); + } + // Resize the vector of positions to have the same size than the vector of glyphs. + rendererParameters.positions.Resize( numberOfGlyphs ); + + + + textModel->mHorizontalAlignment = isCircularTextLayout ? horizontalCircularAlignment : horizontalAlignment; + textModel->mLineWrapMode = LineWrap::WORD; + textModel->mIgnoreSpacesAfterText = false; + textModel->mMatchSystemLanguageDirection = false; + Text::Layout::Parameters layoutParameters( textLayoutArea, + textModel ); + + + // Whether the last character is a new paragraph character. + const Vector& textToShape = isTextMirrored ? mirroredUtf32Characters : textModel->mLogicalModel->mText; + layoutParameters.isLastNewParagraph = TextAbstraction::IsNewParagraph( textToShape[numberOfCharacters - 1u] ); + + // The initial glyph and the number of glyphs to layout. + layoutParameters.startGlyphIndex = 0u; + layoutParameters.numberOfGlyphs = numberOfGlyphs; + layoutParameters.startLineIndex = 0u; + layoutParameters.estimatedNumberOfLines = 1u; + layoutParameters.interGlyphExtraAdvance = 0.f; + + // Update the visual model. + Size newLayoutSize; + bool isAutoScrollEnabled = false; + layoutEngine.LayoutText( layoutParameters, + newLayoutSize, + textParameters.ellipsisEnabled, + isAutoScrollEnabled ); + + //////////////////////////////////////////////////////////////////////////////// + // Align the text. + //////////////////////////////////////////////////////////////////////////////// + Align( textParameters, rendererParameters, embeddedItemLayout, internalDataModel, + textLayoutArea, newLayoutSize, isCircularTextLayout, isClockwise, + horizontalAlignment, verticalAlignment, circularAlignment, radius ); + + return textLayoutArea; + +} + + +Devel::PixelBuffer RenderText( const RendererParameters& textParameters, TextAbstraction::TextRenderer::Parameters& rendererParameters ) +{ //////////////////////////////////////////////////////////////////////////////// // Render the text. //////////////////////////////////////////////////////////////////////////////// @@ -1007,6 +1080,88 @@ Devel::PixelBuffer Render( const RendererParameters& textParameters, Vector& embeddedItemLayout ) +{ + if( textParameters.text.empty() ) + { + Dali::Devel::PixelBuffer pixelBuffer = Dali::Devel::PixelBuffer::New( textParameters.textWidth, + textParameters.textHeight, + Dali::Pixel::RGBA8888 ); + + const unsigned int bufferSize = textParameters.textWidth * textParameters.textHeight * Dali::Pixel::GetBytesPerPixel(Dali::Pixel::RGBA8888); + unsigned char* buffer = pixelBuffer.GetBuffer(); + memset(buffer, 0, bufferSize); + + return pixelBuffer; + } + + FontClient fontClient = FontClient::Get(); + MetricsPtr metrics; + // Use this to access FontClient i.e. to get down-scaled Emoji metrics. + metrics = Metrics::New( fontClient ); + + Text::ModelPtr textModel = Text::Model::New(); + InternalDataModel internalData( fontClient, metrics, textModel ); + + TextAbstraction::TextRenderer::Parameters rendererParameters( internalData.textModel->mVisualModel->mGlyphs, + internalData.textModel->mVisualModel->mGlyphPositions, + internalData.textModel->mVisualModel->mColors, + internalData.textModel->mVisualModel->mColorIndices, + internalData.blendingMode, + internalData.isEmoji ); + + + rendererParameters.width = textParameters.textWidth; + rendererParameters.height = textParameters.textHeight; + rendererParameters.pixelFormat = TextAbstraction::TextRenderer::Parameters::RGBA8888; // @note: At the moment all textures are generated RGBA8888 + + + //////////////////////////////////////////////////////////////////////////////// + // Process the markup string if the mark-up processor is enabled. + //////////////////////////////////////////////////////////////////////////////// + ShapeTextPreprocess( textParameters, rendererParameters, internalData ); + + //////////////////////////////////////////////////////////////////////////////// + // Retrieve the glyphs. Text shaping + //////////////////////////////////////////////////////////////////////////////// + ShapeText( rendererParameters, embeddedItemLayout, internalData ); + + + //////////////////////////////////////////////////////////////////////////////// + // Retrieve the glyph's metrics. + //////////////////////////////////////////////////////////////////////////////// + + metrics->GetGlyphMetrics( rendererParameters.glyphs.Begin(), internalData.numberOfGlyphs ); + + //////////////////////////////////////////////////////////////////////////////// + // Set the color runs in glyphs. + //////////////////////////////////////////////////////////////////////////////// + SetColorSegmentation( textParameters, internalData ); + + + //////////////////////////////////////////////////////////////////////////////// + // Set the isEmoji Vector + //////////////////////////////////////////////////////////////////////////////// + SetEmojiVector( internalData ); + + //////////////////////////////////////////////////////////////////////////////// + // Layout the text and Align the text + //////////////////////////////////////////////////////////////////////////////// + Size textLayoutArea = LayoutText( textParameters, rendererParameters, embeddedItemLayout, internalData ); + + //////////////////////////////////////////////////////////////////////////////// + // Ellipsis the text. + //////////////////////////////////////////////////////////////////////////////// + Ellipsis( textParameters, rendererParameters, embeddedItemLayout, textLayoutArea, internalData ); + + //////////////////////////////////////////////////////////////////////////////// + // Render the text. + //////////////////////////////////////////////////////////////////////////////// + return RenderText( textParameters, rendererParameters ); +} + + Devel::PixelBuffer CreateShadow( const ShadowParameters& shadowParameters ) { // The size of the pixel data. -- 2.7.4 From 3b724dc08e62968be03a00dedaf39bee6261b81d Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:54:20 +0900 Subject: [PATCH 10/16] Revert "[Tizen] Add AutofillContainer class and autofill implementation" This reverts commit 0fe7433266413b9e9656cb39391340ec91af386a. --- CMakeLists.txt | 2 - .../controls/text-controls/autofill-container.cpp | 137 --------- .../controls/text-controls/autofill-container.h | 219 -------------- dali-toolkit/devel-api/file.list | 2 - .../controls/control/control-data-impl.cpp | 36 +-- .../internal/controls/control/control-data-impl.h | 42 --- .../text-controls/autofill-container-impl.cpp | 332 --------------------- .../text-controls/autofill-container-impl.h | 249 ---------------- .../controls/text-controls/text-field-impl.cpp | 25 +- .../controls/text-controls/text-field-impl.h | 2 - dali-toolkit/internal/file.list | 1 - 11 files changed, 5 insertions(+), 1042 deletions(-) delete mode 100644 dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp delete mode 100644 dali-toolkit/devel-api/controls/text-controls/autofill-container.h delete mode 100755 dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp delete mode 100644 dali-toolkit/internal/controls/text-controls/autofill-container-impl.h diff --git a/CMakeLists.txt b/CMakeLists.txt index eba4398..a2fe956 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,6 @@ SET ( SOURCES ${SOURCES} ${devel_api_src_dir}/controls/popup/popup.cpp ${devel_api_src_dir}/controls/shadow-view/shadow-view.cpp ${devel_api_src_dir}/controls/super-blur-view/super-blur-view.cpp - ${devel_api_src_dir}/controls/text-controls/autofill-container.cpp ${devel_api_src_dir}/controls/text-controls/text-editor-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-field-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp @@ -162,7 +161,6 @@ SET( SOURCES ${SOURCES} ${internal_src_dir}/controls/slider/slider-impl.cpp ${internal_src_dir}/controls/super-blur-view/super-blur-view-impl.cpp ${internal_src_dir}/controls/table-view/table-view-impl.cpp - ${internal_src_dir}/controls/text-controls/autofill-container-impl.cpp ${internal_src_dir}/controls/text-controls/text-editor-impl.cpp ${internal_src_dir}/controls/text-controls/text-field-impl.cpp ${internal_src_dir}/controls/text-controls/text-label-impl.cpp diff --git a/dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp b/dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp deleted file mode 100644 index e75ca6f..0000000 --- a/dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2019 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 - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -AutofillContainer AutofillContainer::New( const std::string& name ) -{ - return Internal::AutofillContainer::New( name ); -} - -AutofillContainer::AutofillContainer() -{ -} - -AutofillContainer::AutofillContainer( const AutofillContainer& handle ) -: BaseHandle(handle) -{ -} - -AutofillContainer& AutofillContainer::operator=( const AutofillContainer& handle ) -{ - BaseHandle::operator=(handle); - return *this; -} - -AutofillContainer::~AutofillContainer() -{ -} - -AutofillContainer AutofillContainer::DownCast( BaseHandle handle ) -{ - return AutofillContainer( dynamic_cast( handle.GetObjectPtr() ) ); -} - - -void AutofillContainer::AddAutofillItem( Control control, Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) -{ - GetImpl(*this).AddAutofillItem( control, propertyIndex, id, label, hint, isSensitive ); -} - -void AutofillContainer::RemoveAutofillItem( Control control ) -{ - GetImpl(*this).RemoveAutofillItem( control ); -} - -void AutofillContainer::SetFocusedControl( Toolkit::Control focused ) -{ - GetImpl(*this).SetFocusedControl( focused ); -} - -Toolkit::Control AutofillContainer::GetFocusedControl() -{ - return GetImpl(*this).GetFocusedControl(); -} - -void AutofillContainer::SaveAutofillData() -{ - GetImpl(*this).SaveAutofillData(); -} - -void AutofillContainer::RequestFillData() -{ - GetImpl(*this).RequestFillData(); -} - -const std::string& AutofillContainer::GetAutofillServiceName() const -{ - return GetImpl(*this).GetAutofillServiceName(); -} - -const std::string& AutofillContainer::GetAutofillServiceMessage() const -{ - return GetImpl(*this).GetAutofillServiceMessage(); -} - -const std::string& AutofillContainer::GetAutofillServiceImagePath() const -{ - return GetImpl(*this).GetAutofillServiceImagePath(); -} - -unsigned int AutofillContainer::GetListCount() -{ - return GetImpl(*this).GetListCount(); -} - -const std::string& AutofillContainer::GetListItem( unsigned int index ) const -{ - return GetImpl(*this).GetListItem( index ); -} - -void AutofillContainer::SetSelectedItem( const std::string& selected ) -{ - GetImpl(*this).SetSelectedItem( selected ); -} - -AutofillContainer::AutofillContainer( Internal::AutofillContainer* implementation ) -: BaseHandle(implementation) -{ -} - -AutofillContainer::AuthenticationSignalType& AutofillContainer::AutofillServiceShownSignal() -{ - return GetImpl(*this).AutofillServiceShownSignal(); -} - -AutofillContainer::ListShownSignalType& AutofillContainer::AutofillListShownSignal() -{ - return GetImpl(*this).AutofillListShownSignal(); -} - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/devel-api/controls/text-controls/autofill-container.h b/dali-toolkit/devel-api/controls/text-controls/autofill-container.h deleted file mode 100644 index eecad1a..0000000 --- a/dali-toolkit/devel-api/controls/text-controls/autofill-container.h +++ /dev/null @@ -1,219 +0,0 @@ -#ifndef DALI_TOOLKIT_AUTO_FILL_CONTAINER_H -#define DALI_TOOLKIT_AUTO_FILL_CONTAINER_H - -/* - * Copyright (c) 2019 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 - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal DALI_INTERNAL -{ -class AutofillContainer; -} - -/** - * @brief AutofillContainer controls several text input boxes (Dali::Toolkit::TextField and Dali::Toolkit::TextEditor). - * - * It can make these editors a group of text boxes. - */ -class DALI_TOOLKIT_API AutofillContainer : public BaseHandle -{ -public: - - // TODO : Need to update parameter and return value according to each Signal - typedef Signal< void (AutofillContainer&) > AuthenticationSignalType; ///< Authentication Signal Type - typedef Signal< void (Control&) > ListShownSignalType; ///< List Shown Signal Type - -public: - - /** - * @brief Creates the AutofillContainer. - * - * @param[in] name The AutofillContainer name - * @return A handle to the AutofillContainer - */ - static AutofillContainer New( const std::string& name ); - - /** - * @brief Creates an empty handle. - */ - AutofillContainer(); - - /** - * @brief Copy constructor. - * - * @param[in] handle The handle to copy from - */ - AutofillContainer( const AutofillContainer& handle ); - - /** - * @brief Assignment operator. - * - * @param[in] handle The handle to copy from - * @return A reference to this - */ - AutofillContainer& operator=( const AutofillContainer& handle ); - - /** - * @brief Destructor. - * - * This is non-virtual since derived Handle types must not contain data or virtual methods. - */ - ~AutofillContainer(); - - /** - * @brief Downcasts a handle to AutofillContainer. - * - * If the BaseHandle points is a AutofillContainer, the downcast returns a valid handle. - * If not, the returned handle is left empty. - * - * @param[in] handle Handle to an object - * @return Handle to a AutofillContainer or an empty handle - */ - static AutofillContainer DownCast( BaseHandle handle ); - - /** - * @brief Adds Control and AutofillItem information to Autofill Container. - * - * @param[in] control The control to be added to Autofill Container - * @param[in] propertyIndex The Property to be filled automatically of each Control - * @param[in] id A unique ID that does not always change on each launching - * @param[in] label An auxiliary means to guess heuristically what data is - * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on - * @param[in] isSensitive Whether this information is a sensitive data or not - */ - void AddAutofillItem( Control control, Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); - - /** - * @brief Removes Control and its AutofillItem information to Autofill Container. - * - * @param[in] control The control to be removed - */ - void RemoveAutofillItem( Control control ); - - /** - * @brief Sets that a control is focused. - * - * @param focused The focused control - */ - void SetFocusedControl( Toolkit::Control focused ); - - /** - * @brief Gets the focused control. - * - * @return The focused control - */ - Toolkit::Control GetFocusedControl(); - - /** - * @brief Stores autofill data. - */ - void SaveAutofillData(); - - /** - * @brief Sends a request for filling the data. - */ - void RequestFillData(); - - /** - * @brief Gets the Autofill Service Name. - * - * @return Autofill Service Name - */ - const std::string& GetAutofillServiceName() const; - - /** - * @brief Gets the Autofill Service Message. - * - * @return Autofill Service Message - */ - const std::string& GetAutofillServiceMessage() const; - - /** - * @brief Gets the Autofill Service Image Path. - * - * @return Autofill Service Image Path - */ - const std::string& GetAutofillServiceImagePath() const; - - /** - * @brief Gets the number of list items. (The presentation text of Autofill) - * - * @return The number of list items - */ - unsigned int GetListCount(); - - /** - * @brief Gets the list item of the index. - * - * @param[in] index The index for the list - * @return The list item of the index - */ - const std::string& GetListItem( unsigned int index ) const; - - /** - * @brief Sets the selected item to fill out. - * - * @param[in] selected The selected item - */ - void SetSelectedItem( const std::string& selected ); - -public: - // Signals - - /** - * @brief AutofillServiceShownSignal - * - * @return The signal containing the received data - */ - AuthenticationSignalType& AutofillServiceShownSignal(); - - /** - * @brief AutofillListShownSignal - * - * @return The signal containing the received data - */ - ListShownSignalType& AutofillListShownSignal(); - - -public: // Not intended for application developers - - /** - * @brief Creates a handle using the Toolkit::Internal implementation. - * - * @param[in] implementation The Control implementation - */ - DALI_INTERNAL AutofillContainer( Internal::AutofillContainer* implementation ); - -}; - - -} // namespace Toolkit - -} // namespace Dali - -#endif // DALI_TOOLKIT_AUTO_FILL_CONTAINER_H diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index 721a456..36f0649 100755 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -26,7 +26,6 @@ SET( devel_api_src_files ${devel_api_src_dir}/controls/scene3d-view/scene3d-view.cpp ${devel_api_src_dir}/controls/shadow-view/shadow-view.cpp ${devel_api_src_dir}/controls/super-blur-view/super-blur-view.cpp - ${devel_api_src_dir}/controls/text-controls/autofill-container.cpp ${devel_api_src_dir}/controls/text-controls/text-editor-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-field-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp @@ -180,7 +179,6 @@ SET( devel_api_super_blur_view_header_files ) SET( devel_api_text_controls_header_files - ${devel_api_src_dir}/controls/text-controls/autofill-container.h ${devel_api_src_dir}/controls/text-controls/text-editor-devel.h ${devel_api_src_dir}/controls/text-controls/text-field-devel.h ${devel_api_src_dir}/controls/text-controls/text-label-devel.h diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp index b49a8c5..eb6285a 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -313,6 +313,7 @@ const PropertyRegistration Control::Impl::PROPERTY_13( typeRegistration, "upFocu const PropertyRegistration Control::Impl::PROPERTY_14( typeRegistration, "downFocusableActorId", Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty ); const PropertyRegistration Control::Impl::PROPERTY_15( typeRegistration, "shadow", Toolkit::DevelControl::Property::SHADOW, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty ); + Control::Impl::Impl( Control& controlImpl ) : mControlImpl( controlImpl ), mState( Toolkit::DevelControl::NORMAL ), @@ -337,12 +338,9 @@ Control::Impl::Impl( Control& controlImpl ) mLongPressGestureDetector(), mTooltip( NULL ), mInputMethodContext(), - mAutofillItem(), - mAutofillContainer(), mFlags( Control::ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ), mIsKeyboardNavigationSupported( false ), - mIsKeyboardFocusGroup( false ), - mIsAutofillEnabled( false ) + mIsKeyboardFocusGroup( false ) { } @@ -1452,36 +1450,6 @@ void Control::Impl::ClearShadow() mControlImpl.RelayoutRequest(); } -void Control::Impl::SetAutofillEnabled( bool autofillEnabled ) -{ - mIsAutofillEnabled = autofillEnabled; -} - -bool Control::Impl::IsAutofillEnabled() -{ - return mIsAutofillEnabled; -} - -void Control::Impl::SetAutofillItemHandle( Dali::AutofillItem item ) -{ - mAutofillItem = item; -} - -Dali::AutofillItem Control::Impl::GetAutofillItemHandle() -{ - return mAutofillItem; -} - -void Control::Impl::SetAutofillContainer( Toolkit::AutofillContainer container ) -{ - mAutofillContainer = container; -} - -Toolkit::AutofillContainer Control::Impl::GetAutofillContainer() -{ - return mAutofillContainer; -} - } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/controls/control/control-data-impl.h b/dali-toolkit/internal/controls/control/control-data-impl.h index 9648cd6..210f6e2 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.h +++ b/dali-toolkit/internal/controls/control/control-data-impl.h @@ -21,14 +21,11 @@ // EXTERNAL INCLUDES #include #include -#include -#include #include // INTERNAL INCLUDES #include #include -#include #include #include #include @@ -349,42 +346,6 @@ public: * @brief Clear the shadow. */ void ClearShadow(); - - /** - * @brief Sets whether the Autofill functionality is enabled. - * @param[in] autofillEnabled Set true when Autofill should be enabled. - */ - void SetAutofillEnabled( bool autofillEnabled ); - - /** - * @brief Check if the Autofill framework is enabled. - * @return True if Autofill is enabled - */ - bool IsAutofillEnabled(); - - /** - * @brief Sets AutofillItemHandle - * @param item AutofillItem handle - */ - void SetAutofillItemHandle( Dali::AutofillItem item ); - - /** - * @brief Gets AutofillItemHandle - * @return AutofillItem handle - */ - Dali::AutofillItem GetAutofillItemHandle(); - - /** - * @brief Sets AutofillContainer which this control belongs to. - * @param[in] container - */ - void SetAutofillContainer( Toolkit::AutofillContainer container ); - - /** - * @brief Gets AutofillContainer that the control belongs to. - * @return AutofillContainer handle - */ - Toolkit::AutofillContainer GetAutofillContainer(); private: @@ -458,13 +419,10 @@ public: TooltipPtr mTooltip; InputMethodContext mInputMethodContext; - AutofillItem mAutofillItem; - Toolkit::AutofillContainer mAutofillContainer; ControlBehaviour mFlags : CONTROL_BEHAVIOUR_FLAG_COUNT; ///< Flags passed in from constructor. bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control. bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group. - bool mIsAutofillEnabled : 1; ///< Stroes whether the Autofill functionality is enabled. RegisteredVisualContainer mRemoveVisuals; ///< List of visuals that are being replaced by another visual once ready diff --git a/dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp b/dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp deleted file mode 100755 index 6c9628b..0000000 --- a/dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2019 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 - -// EXTERNAL INCLUDES -#include // for strcmp -#include -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Internal -{ - -namespace -{ - -#if defined ( DEBUG_ENABLED ) - Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_AUTOFILL_CONTAINER"); -#endif - -// Type registration -BaseHandle Create() -{ - return Toolkit::AutofillContainer::New( "" ); -} - -// Setup properties, signals and actions using the type-registry. -DALI_TYPE_REGISTRATION_BEGIN( Toolkit::AutofillContainer, Dali::BaseHandle, Create ); - -DALI_SIGNAL_REGISTRATION( Toolkit, AutofillContainer, "serviceShown", SIGNAL_SERVICE_SHOWN ) -DALI_SIGNAL_REGISTRATION( Toolkit, AutofillContainer, "listShown", SIGNAL_LIST_SHOWN ) - -DALI_TYPE_REGISTRATION_END() - -} // namespace - -Toolkit::AutofillContainer AutofillContainer::New( const std::string& name ) -{ - // Create the implementation, temporarily owned by this handle on stack - Internal::AutofillContainer* impl = new AutofillContainer(); - - // Pass ownership to CustomActor handle - Toolkit::AutofillContainer handle( impl ); - impl->Initialize( name ); - - return handle; -} - -void AutofillContainer::Initialize( const std::string& name ) -{ - mAutofillManager = Dali::AutofillManager::Get(); - mAutofillGroup = mAutofillManager.CreateAutofillGroup( name ); - - // If the authentication is needed, AuthenticationReceivedSignal would be emitted. - mAutofillManager.AuthenticationReceivedSignal().Connect( mSlotDelegate, &AutofillContainer::OnAutofillAuthReceived ); - - // If the data to be filled is present, FillResponseReceivedSignal would be emitted. - mAutofillManager.FillResponseReceivedSignal().Connect( mSlotDelegate, &AutofillContainer::OnDataFillReceived ); - - // If the values to be filled are multiple, ListEventSignal would be emitted. - mAutofillManager.ListEventSignal().Connect( mSlotDelegate, &AutofillContainer::OnListReceived ); -} - -void AutofillContainer::AddAutofillItem( Dali::Toolkit::Control control, Dali::Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) -{ - if( control ) - { - Dali::AutofillItem item = mAutofillManager.CreateAutofillItem( id, label, static_cast(hint), isSensitive ); - - Internal::Control& controlImpl = GetImplementation( control ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - controlDataImpl.SetAutofillContainer( this ); - controlDataImpl.SetAutofillEnabled( true ); - controlDataImpl.SetAutofillItemHandle( item ); // TODO : This instance would be here as... std::map or pair - - mAutofillGroup.AddAutofillItem( item ); - - mPropertyIndex = propertyIndex; - - // TODO : Remove the mControlItemList below and replace it. - mControlList.push_back( std::pair< Dali::Toolkit::Control, Dali::AutofillItem >( control, item ) ); - - // Push back a Control to the list - mControlItemList.push_back( control ); - } -} - -void AutofillContainer::RemoveAutofillItem( Dali::Toolkit::Control control ) -{ - if( control ) - { - Internal::Control& controlImpl = GetImplementation( control ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - controlDataImpl.SetAutofillEnabled( false ); - // TODO : Put the control out the list - } -} - -Dali::AutofillGroup AutofillContainer::GetAutofillGroup() -{ - return mAutofillGroup; -} - -void AutofillContainer::SetFocusedControl( Toolkit::Control focused ) -{ - mCurrentFocused = focused; -} - -Toolkit::Control AutofillContainer::GetFocusedControl() -{ - return mCurrentFocused; -} - -void AutofillContainer::SaveAutofillData() -{ - for( std::vector::iterator iter = mControlItemList.begin(), endIter = mControlItemList.end(); iter != endIter; ++iter ) - { - std::string controlValue = (*iter).GetProperty( mPropertyIndex ); - Internal::Control& controlImpl = GetImplementation( *iter ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - controlDataImpl.GetAutofillItemHandle().SetSaveValue( controlValue ); - } - - // Sends request to save the current autofill data - mAutofillGroup.SaveAutofillData(); - mAutofillManager.SaveAutofillData( mAutofillGroup ); -} - -void AutofillContainer::RequestFillData() -{ - // Sends fill request to fill out the data. - mAutofillGroup.SendFillRequest(); -} - -void AutofillContainer::SetAutofillServiceName( const std::string& serviceName ) -{ - mAutofillServiceName = serviceName; -} - -const std::string& AutofillContainer::GetAutofillServiceName() const -{ - return mAutofillServiceName; -} - -void AutofillContainer::SetAutofillServiceMessage( const std::string& serviceMessage ) -{ - mAutofillServiceMessage = serviceMessage; -} - -const std::string& AutofillContainer::GetAutofillServiceMessage() const -{ - return mAutofillServiceMessage; -} - -void AutofillContainer::SetAutofillServiceImagePath( const std::string& serviceImagePath ) -{ - mAutofillServiceImagePath = serviceImagePath; -} - -const std::string& AutofillContainer::GetAutofillServiceImagePath() const -{ - return mAutofillServiceImagePath; -} - -unsigned int AutofillContainer::GetListCount() -{ - Toolkit::Control control = mCurrentFocused; - Internal::Control& controlImpl = GetImplementation( control ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - return controlDataImpl.GetAutofillItemHandle().GetFillValueCount(); -} - -const std::string& AutofillContainer::GetListItem( unsigned int index ) const -{ - Toolkit::Control control = mCurrentFocused; - Internal::Control& controlImpl = GetImplementation( control ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - return controlDataImpl.GetAutofillItemHandle().GetPresentationText( index ); -} - -void AutofillContainer::SetSelectedItem( const std::string& selected ) -{ - Toolkit::Control control = mCurrentFocused; - Internal::Control& controlImpl = GetImplementation( control ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - unsigned int count = controlDataImpl.GetAutofillItemHandle().GetFillValueCount(); - unsigned int index = 0; - for( index = 0; index < count; index++ ) - { - std::string presentationText = controlDataImpl.GetAutofillItemHandle().GetPresentationText( index ); - if( 0 == strcmp( presentationText.c_str(), selected.c_str() ) ) - { - break; - } - } - - for( std::vector::iterator iter = mControlItemList.begin(), endIter = mControlItemList.end(); iter != endIter; ++iter ) - { - Internal::Control& controlImpl = GetImplementation( *iter ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - std::string fillValue = controlDataImpl.GetAutofillItemHandle().GetFillValue( index ); - (*iter).SetProperty( Toolkit::TextField::Property::TEXT, fillValue ); - } -} - -// -void AutofillContainer::OnAutofillAuthReceived() -{ - SetAutofillServiceName( mAutofillManager.GetAuthenticationServiceName() ); - SetAutofillServiceMessage( mAutofillManager.GetAuthenticationServiceMessage() ); - SetAutofillServiceImagePath( mAutofillManager.GetAuthenticationServiceImagePath() ); - - Dali::Toolkit::AutofillContainer handle( this ); - mAuthenticationEventSignal.Emit( handle ); - - DALI_LOG_ERROR(" [ Emit DALi signal to receive the auth information ] \n"); - -} - -void AutofillContainer::OnDataFillReceived( Dali::AutofillItem item ) -{ - for( std::vector::iterator iter = mControlItemList.begin(), endIter = mControlItemList.end(); iter != endIter; ++iter ) - { - Internal::Control& controlImpl = GetImplementation( *iter ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - - if( 0 == strcmp( controlDataImpl.GetAutofillItemHandle().GetId().c_str(), item.GetId().c_str() ) ) - { - // TODO : Is the index for fill data always 0 in this case? - std::string itemText = controlDataImpl.GetAutofillItemHandle().GetFillValue( 0 ); - (*iter).SetProperty( Toolkit::TextField::Property::TEXT, itemText ); - } - } - -} - -void AutofillContainer::OnListReceived() -{ - mListEventSignal.Emit( mCurrentFocused ); - -} - - -AutofillContainer::AutofillContainer() -: mAutofillManager(), - mAutofillGroup(), - mControlItemList(), - mControlList(), - mSlotDelegate( this ), - mPropertyIndex( Property::INVALID_INDEX ), - mAutofillServiceName( "" ), - mAutofillServiceMessage( "" ), - mAutofillServiceImagePath( "" ), - mCurrentFocused() -{ -} - -AutofillContainer::~AutofillContainer() -{ - mAutofillManager.AuthenticationReceivedSignal().Disconnect( mSlotDelegate, &AutofillContainer::OnAutofillAuthReceived ); - mAutofillManager.FillResponseReceivedSignal().Disconnect( mSlotDelegate, &AutofillContainer::OnDataFillReceived ); - mAutofillManager.ListEventSignal().Disconnect( mSlotDelegate, &AutofillContainer::OnListReceived ); -} - -// Signals -Toolkit::AutofillContainer::AuthenticationSignalType& AutofillContainer::AutofillServiceShownSignal() -{ - return mAuthenticationEventSignal; -} - -Toolkit::AutofillContainer::ListShownSignalType& AutofillContainer::AutofillListShownSignal() -{ - return mListEventSignal; -} - -bool AutofillContainer::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) -{ - Dali::BaseHandle handle( object ); - - bool connected( true ); - Toolkit::AutofillContainer container = Toolkit::AutofillContainer::DownCast( handle ); - - if( container ) - { - if( 0 == signalName.compare( SIGNAL_SERVICE_SHOWN ) ) - { - container.AutofillServiceShownSignal().Connect( tracker, functor ); - } - else if( 0 == signalName.compare( SIGNAL_LIST_SHOWN ) ) - { - container.AutofillListShownSignal().Connect( tracker, functor ); - } - else - { - // signalName does not match any signal - connected = false; - } - } - - return connected; -} - -} // namespace Internal - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/controls/text-controls/autofill-container-impl.h b/dali-toolkit/internal/controls/text-controls/autofill-container-impl.h deleted file mode 100644 index 1ef8262..0000000 --- a/dali-toolkit/internal/controls/text-controls/autofill-container-impl.h +++ /dev/null @@ -1,249 +0,0 @@ -#ifndef DALI_TOOLKIT_INTERNAL_AUTOFILL_CONTAINER_H -#define DALI_TOOLKIT_INTERNAL_AUTOFILL_CONTAINER_H - -/* - * Copyright (c) 2019 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 -{ - -namespace Internal -{ - -/** - * @copydoc Toolkit::AutofillContainer - */ -class AutofillContainer : public Dali::BaseObject -{ -public: - - /** - * @copydoc Dali::Toollkit::AutofillContainer::New() - */ - static Toolkit::AutofillContainer New( const std::string& name ); - - /** - * @brief Initialize AutofillContainer - */ - void Initialize( const std::string& name ); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::AddAutofillItem() - */ - void AddAutofillItem( Dali::Toolkit::Control control, Dali::Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::RemoveAutofillItem() - */ - void RemoveAutofillItem( Dali::Toolkit::Control control ); - - /** - * @brief Gets AutofillGroup setting to AutofillContainer. - * - * @return The AutofillGroup instance - */ - Dali::AutofillGroup GetAutofillGroup(); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::SetFocusedControl() - */ - void SetFocusedControl( Toolkit::Control focused ); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::GetFocusedControl() - */ - Toolkit::Control GetFocusedControl(); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::SaveAutofillData() - */ - void SaveAutofillData(); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::RequestFillData() - */ - void RequestFillData(); - - /** - * @brief Sets the Autofill Service Name - * - * @param serviceName Autofill Service Name - */ - void SetAutofillServiceName( const std::string& serviceName ); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::GetAutofillServiceName() - */ - const std::string& GetAutofillServiceName() const; - - /** - * @brief Sets the Autofill Service Message - * - * @param serviceMessage Autofill Service Message - */ - void SetAutofillServiceMessage( const std::string& serviceMessage ); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::GetAutofillServiceMessage() - */ - const std::string& GetAutofillServiceMessage() const; - - /** - * @brief Sets the Autofill Service Image Path - * - * @param serviceImagePath Autofill Service Image Path - */ - void SetAutofillServiceImagePath( const std::string& serviceImagePath ); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::GetAutofillServiceImagePath() - */ - const std::string& GetAutofillServiceImagePath() const; - - /** - * @copydoc Dali::Toollkit::AutofillContainer::GetListCount() - */ - unsigned int GetListCount(); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::GetListItem() - */ - const std::string& GetListItem( unsigned int index ) const; - - /** - * @copydoc Dali::Toollkit::AutofillContainer::SetSelectedItem() - */ - void SetSelectedItem( const std::string& selected ); - - /** - * @brief Callback when Autofill Authentication information is recieved. - */ - void OnAutofillAuthReceived(); - - /** - * @brief Callback when Autofill Fill Response is recieved. - * @param[in] item The callback parameter - */ - void OnDataFillReceived( Dali::AutofillItem item ); - - /** - * @brief Callback when the values to be filled are multiple. - */ - void OnListReceived(); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::AutofillServiceShownSignal() - */ - Toolkit::AutofillContainer::AuthenticationSignalType& AutofillServiceShownSignal(); - - /** - * @copydoc Dali::Toollkit::AutofillContainer::AutofillListShownSignal() - */ - Toolkit::AutofillContainer::ListShownSignalType& AutofillListShownSignal(); - - /** - * 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: // Implementation - - /** - * Construct a new AutofillContainer. - */ - AutofillContainer(); - - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~AutofillContainer(); - -private: - - // Undefined copy constructor and assignment operators - AutofillContainer(const AutofillContainer&); - AutofillContainer& operator=(const AutofillContainer& rhs); - -private: // Data - - Dali::AutofillManager mAutofillManager; - Dali::AutofillGroup mAutofillGroup; - std::vector mControlItemList; ///< The List of Control adding to AutofillContainer - //std::map mControlList; - std::vector< std::pair< Dali::Toolkit::Control, Dali::AutofillItem > > mControlList; - - SlotDelegate< AutofillContainer > mSlotDelegate; - - Property::Index mPropertyIndex; ///< The index of property registered by each control - - Toolkit::AutofillContainer::AuthenticationSignalType mAuthenticationEventSignal; - Toolkit::AutofillContainer::ListShownSignalType mListEventSignal; - - std::string mAutofillServiceName; - std::string mAutofillServiceMessage; - std::string mAutofillServiceImagePath; - - Toolkit::Control mCurrentFocused; -}; - -} // namespace Internal - -// Helpers for public-api forwarding methods - -inline Toolkit::Internal::AutofillContainer& GetImpl( Toolkit::AutofillContainer& autofillContainer ) -{ - DALI_ASSERT_ALWAYS(autofillContainer); - - Dali::BaseObject& handle = autofillContainer.GetBaseObject(); - - return static_cast(handle); -} - -inline const Toolkit::Internal::AutofillContainer& GetImpl( const Toolkit::AutofillContainer& autofillContainer ) -{ - DALI_ASSERT_ALWAYS(autofillContainer); - - const Dali::BaseObject& handle = autofillContainer.GetBaseObject(); - - return static_cast(handle); -} - -} // namespace Toolkit - -} // namespace Dali - -#endif // DALI_TOOLKIT_INTERNAL_AUTOFILL_CONTAINER_H 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 33d9689..2b4fcc0 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -37,8 +37,6 @@ #include #include #include -#include -#include #include #include #include @@ -1587,7 +1585,7 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType ) void TextField::OnKeyInputFocusGained() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() ); - if( mInputMethodContext ) + if ( mInputMethodContext ) { mInputMethodContext.ApplyOptions( mInputMethodOptions ); @@ -1601,30 +1599,13 @@ void TextField::OnKeyInputFocusGained() // When window gain lost focus, the inputMethodContext is deactivated. Thus when window gain focus again, the inputMethodContext must be activated. mInputMethodContext.SetRestoreAfterFocusLost( true ); } - ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); - if( notifier ) + + if ( notifier ) { notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected ); } - Toolkit::Control control = Toolkit::Control::DownCast( Self() ); - Internal::Control& controlImpl = GetImplementation( control ); - Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); - bool enableAutofill = controlDataImpl.IsAutofillEnabled(); - if( enableAutofill ) - { - Toolkit::AutofillContainer container = controlDataImpl.GetAutofillContainer(); - container.SetFocusedControl( control ); - - Internal::AutofillContainer& containerImpl = GetImpl( container ); - Dali::AutofillGroup containerGroup = containerImpl.GetAutofillGroup(); - if( containerGroup != nullptr ) - { - containerGroup.RequestAuthentication(); - } - - } mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last. 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 59bedf8..2991931 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include // INTERNAL INCLUDES #include @@ -292,7 +291,6 @@ private: // Data Toolkit::Control mStencil; ///< For EXCEED_POLICY_CLIP std::vector mClippingDecorationActors; ///< Decoration actors which need clipping. Dali::InputMethodOptions mInputMethodOptions; - Dali::AutofillItem mAutofillItem; Actor mRenderableActor; Actor mActiveLayer; diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index b9fde11..246ba89 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -95,7 +95,6 @@ SET( toolkit_src_files ${toolkit_src_dir}/controls/slider/slider-impl.cpp ${toolkit_src_dir}/controls/super-blur-view/super-blur-view-impl.cpp ${toolkit_src_dir}/controls/table-view/table-view-impl.cpp - ${toolkit_src_dir}/controls/text-controls/autofill-container-impl.cpp ${toolkit_src_dir}/controls/text-controls/text-editor-impl.cpp ${toolkit_src_dir}/controls/text-controls/text-field-impl.cpp ${toolkit_src_dir}/controls/text-controls/text-label-impl.cpp -- 2.7.4 From e4d9ad343fb6daa616423ba59039aed85d5e406f Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:54:30 +0900 Subject: [PATCH 11/16] Revert "[Tizen] Restore behavior of Uploaded and LoadingFinished signal" This reverts commit a21d7401ca0cb826b788256117faa9f7423713e2. --- .../internal/controls/image-view/image-view-impl.cpp | 16 ---------------- .../internal/controls/image-view/image-view-impl.h | 5 ----- 2 files changed, 21 deletions(-) diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index c07355a..9843128 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -237,22 +237,6 @@ void ImageView::SetDepthIndex( int depthIndex ) } } -void ImageView::OnStageConnection( int depth ) -{ - if( mImage ) - { - mImage.UploadedSignal().Emit( mImage ); - } - - Dali::ResourceImage resourceImage = Dali::ResourceImage::DownCast( mImage ); - if( resourceImage ) - { - resourceImage.LoadingFinishedSignal().Emit( resourceImage ); - } - - Control::OnStageConnection( depth ); // Enabled visuals will be put on stage -} - Vector3 ImageView::GetNaturalSize() { if( mVisual ) diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.h b/dali-toolkit/internal/controls/image-view/image-view-impl.h index 0a8fbd8..382feb8 100644 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.h +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.h @@ -128,11 +128,6 @@ private: // From Control void OnInitialize(); /** - * @copydoc CustomActorImpl::OnStageConnection() - */ - virtual void OnStageConnection( int depth ); - - /** * @copydoc Toolkit::Control::GetNaturalSize */ virtual Vector3 GetNaturalSize(); -- 2.7.4 From 1ef98fc483196e4f9ba58044bd76b271d4692309 Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:54:35 +0900 Subject: [PATCH 12/16] [Tizen] Restore behavior of Uploaded and LoadingFinished signal This reverts commit e4d9ad343fb6daa616423ba59039aed85d5e406f. Change-Id: Ia1fd59d82916f3166afe92a7857c38dffd04ce12 --- .../internal/controls/image-view/image-view-impl.cpp | 16 ++++++++++++++++ .../internal/controls/image-view/image-view-impl.h | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index 9843128..c07355a 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -237,6 +237,22 @@ void ImageView::SetDepthIndex( int depthIndex ) } } +void ImageView::OnStageConnection( int depth ) +{ + if( mImage ) + { + mImage.UploadedSignal().Emit( mImage ); + } + + Dali::ResourceImage resourceImage = Dali::ResourceImage::DownCast( mImage ); + if( resourceImage ) + { + resourceImage.LoadingFinishedSignal().Emit( resourceImage ); + } + + Control::OnStageConnection( depth ); // Enabled visuals will be put on stage +} + Vector3 ImageView::GetNaturalSize() { if( mVisual ) diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.h b/dali-toolkit/internal/controls/image-view/image-view-impl.h index 382feb8..0a8fbd8 100644 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.h +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.h @@ -128,6 +128,11 @@ private: // From Control void OnInitialize(); /** + * @copydoc CustomActorImpl::OnStageConnection() + */ + virtual void OnStageConnection( int depth ); + + /** * @copydoc Toolkit::Control::GetNaturalSize */ virtual Vector3 GetNaturalSize(); -- 2.7.4 From dd29431ab7ffd67da49106037c63700d122c7e2b Mon Sep 17 00:00:00 2001 From: "Seungho, Baek" Date: Tue, 14 Jul 2020 18:54:45 +0900 Subject: [PATCH 13/16] [Tizen] Add AutofillContainer class and autofill implementation This reverts commit 3b724dc08e62968be03a00dedaf39bee6261b81d. Change-Id: Iefa264b00b68b456b6c5920baaf204540f71fc21 --- CMakeLists.txt | 2 + .../controls/text-controls/autofill-container.cpp | 137 +++++++++ .../controls/text-controls/autofill-container.h | 219 ++++++++++++++ dali-toolkit/devel-api/file.list | 2 + .../controls/control/control-data-impl.cpp | 36 ++- .../internal/controls/control/control-data-impl.h | 42 +++ .../text-controls/autofill-container-impl.cpp | 332 +++++++++++++++++++++ .../text-controls/autofill-container-impl.h | 249 ++++++++++++++++ .../controls/text-controls/text-field-impl.cpp | 25 +- .../controls/text-controls/text-field-impl.h | 2 + dali-toolkit/internal/file.list | 1 + 11 files changed, 1042 insertions(+), 5 deletions(-) create mode 100644 dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp create mode 100644 dali-toolkit/devel-api/controls/text-controls/autofill-container.h create mode 100755 dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp create mode 100644 dali-toolkit/internal/controls/text-controls/autofill-container-impl.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a2fe956..eba4398 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ SET ( SOURCES ${SOURCES} ${devel_api_src_dir}/controls/popup/popup.cpp ${devel_api_src_dir}/controls/shadow-view/shadow-view.cpp ${devel_api_src_dir}/controls/super-blur-view/super-blur-view.cpp + ${devel_api_src_dir}/controls/text-controls/autofill-container.cpp ${devel_api_src_dir}/controls/text-controls/text-editor-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-field-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp @@ -161,6 +162,7 @@ SET( SOURCES ${SOURCES} ${internal_src_dir}/controls/slider/slider-impl.cpp ${internal_src_dir}/controls/super-blur-view/super-blur-view-impl.cpp ${internal_src_dir}/controls/table-view/table-view-impl.cpp + ${internal_src_dir}/controls/text-controls/autofill-container-impl.cpp ${internal_src_dir}/controls/text-controls/text-editor-impl.cpp ${internal_src_dir}/controls/text-controls/text-field-impl.cpp ${internal_src_dir}/controls/text-controls/text-label-impl.cpp diff --git a/dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp b/dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp new file mode 100644 index 0000000..e75ca6f --- /dev/null +++ b/dali-toolkit/devel-api/controls/text-controls/autofill-container.cpp @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2019 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 + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +AutofillContainer AutofillContainer::New( const std::string& name ) +{ + return Internal::AutofillContainer::New( name ); +} + +AutofillContainer::AutofillContainer() +{ +} + +AutofillContainer::AutofillContainer( const AutofillContainer& handle ) +: BaseHandle(handle) +{ +} + +AutofillContainer& AutofillContainer::operator=( const AutofillContainer& handle ) +{ + BaseHandle::operator=(handle); + return *this; +} + +AutofillContainer::~AutofillContainer() +{ +} + +AutofillContainer AutofillContainer::DownCast( BaseHandle handle ) +{ + return AutofillContainer( dynamic_cast( handle.GetObjectPtr() ) ); +} + + +void AutofillContainer::AddAutofillItem( Control control, Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + GetImpl(*this).AddAutofillItem( control, propertyIndex, id, label, hint, isSensitive ); +} + +void AutofillContainer::RemoveAutofillItem( Control control ) +{ + GetImpl(*this).RemoveAutofillItem( control ); +} + +void AutofillContainer::SetFocusedControl( Toolkit::Control focused ) +{ + GetImpl(*this).SetFocusedControl( focused ); +} + +Toolkit::Control AutofillContainer::GetFocusedControl() +{ + return GetImpl(*this).GetFocusedControl(); +} + +void AutofillContainer::SaveAutofillData() +{ + GetImpl(*this).SaveAutofillData(); +} + +void AutofillContainer::RequestFillData() +{ + GetImpl(*this).RequestFillData(); +} + +const std::string& AutofillContainer::GetAutofillServiceName() const +{ + return GetImpl(*this).GetAutofillServiceName(); +} + +const std::string& AutofillContainer::GetAutofillServiceMessage() const +{ + return GetImpl(*this).GetAutofillServiceMessage(); +} + +const std::string& AutofillContainer::GetAutofillServiceImagePath() const +{ + return GetImpl(*this).GetAutofillServiceImagePath(); +} + +unsigned int AutofillContainer::GetListCount() +{ + return GetImpl(*this).GetListCount(); +} + +const std::string& AutofillContainer::GetListItem( unsigned int index ) const +{ + return GetImpl(*this).GetListItem( index ); +} + +void AutofillContainer::SetSelectedItem( const std::string& selected ) +{ + GetImpl(*this).SetSelectedItem( selected ); +} + +AutofillContainer::AutofillContainer( Internal::AutofillContainer* implementation ) +: BaseHandle(implementation) +{ +} + +AutofillContainer::AuthenticationSignalType& AutofillContainer::AutofillServiceShownSignal() +{ + return GetImpl(*this).AutofillServiceShownSignal(); +} + +AutofillContainer::ListShownSignalType& AutofillContainer::AutofillListShownSignal() +{ + return GetImpl(*this).AutofillListShownSignal(); +} + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/devel-api/controls/text-controls/autofill-container.h b/dali-toolkit/devel-api/controls/text-controls/autofill-container.h new file mode 100644 index 0000000..eecad1a --- /dev/null +++ b/dali-toolkit/devel-api/controls/text-controls/autofill-container.h @@ -0,0 +1,219 @@ +#ifndef DALI_TOOLKIT_AUTO_FILL_CONTAINER_H +#define DALI_TOOLKIT_AUTO_FILL_CONTAINER_H + +/* + * Copyright (c) 2019 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 + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal DALI_INTERNAL +{ +class AutofillContainer; +} + +/** + * @brief AutofillContainer controls several text input boxes (Dali::Toolkit::TextField and Dali::Toolkit::TextEditor). + * + * It can make these editors a group of text boxes. + */ +class DALI_TOOLKIT_API AutofillContainer : public BaseHandle +{ +public: + + // TODO : Need to update parameter and return value according to each Signal + typedef Signal< void (AutofillContainer&) > AuthenticationSignalType; ///< Authentication Signal Type + typedef Signal< void (Control&) > ListShownSignalType; ///< List Shown Signal Type + +public: + + /** + * @brief Creates the AutofillContainer. + * + * @param[in] name The AutofillContainer name + * @return A handle to the AutofillContainer + */ + static AutofillContainer New( const std::string& name ); + + /** + * @brief Creates an empty handle. + */ + AutofillContainer(); + + /** + * @brief Copy constructor. + * + * @param[in] handle The handle to copy from + */ + AutofillContainer( const AutofillContainer& handle ); + + /** + * @brief Assignment operator. + * + * @param[in] handle The handle to copy from + * @return A reference to this + */ + AutofillContainer& operator=( const AutofillContainer& handle ); + + /** + * @brief Destructor. + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + */ + ~AutofillContainer(); + + /** + * @brief Downcasts a handle to AutofillContainer. + * + * If the BaseHandle points is a AutofillContainer, the downcast returns a valid handle. + * If not, the returned handle is left empty. + * + * @param[in] handle Handle to an object + * @return Handle to a AutofillContainer or an empty handle + */ + static AutofillContainer DownCast( BaseHandle handle ); + + /** + * @brief Adds Control and AutofillItem information to Autofill Container. + * + * @param[in] control The control to be added to Autofill Container + * @param[in] propertyIndex The Property to be filled automatically of each Control + * @param[in] id A unique ID that does not always change on each launching + * @param[in] label An auxiliary means to guess heuristically what data is + * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on + * @param[in] isSensitive Whether this information is a sensitive data or not + */ + void AddAutofillItem( Control control, Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); + + /** + * @brief Removes Control and its AutofillItem information to Autofill Container. + * + * @param[in] control The control to be removed + */ + void RemoveAutofillItem( Control control ); + + /** + * @brief Sets that a control is focused. + * + * @param focused The focused control + */ + void SetFocusedControl( Toolkit::Control focused ); + + /** + * @brief Gets the focused control. + * + * @return The focused control + */ + Toolkit::Control GetFocusedControl(); + + /** + * @brief Stores autofill data. + */ + void SaveAutofillData(); + + /** + * @brief Sends a request for filling the data. + */ + void RequestFillData(); + + /** + * @brief Gets the Autofill Service Name. + * + * @return Autofill Service Name + */ + const std::string& GetAutofillServiceName() const; + + /** + * @brief Gets the Autofill Service Message. + * + * @return Autofill Service Message + */ + const std::string& GetAutofillServiceMessage() const; + + /** + * @brief Gets the Autofill Service Image Path. + * + * @return Autofill Service Image Path + */ + const std::string& GetAutofillServiceImagePath() const; + + /** + * @brief Gets the number of list items. (The presentation text of Autofill) + * + * @return The number of list items + */ + unsigned int GetListCount(); + + /** + * @brief Gets the list item of the index. + * + * @param[in] index The index for the list + * @return The list item of the index + */ + const std::string& GetListItem( unsigned int index ) const; + + /** + * @brief Sets the selected item to fill out. + * + * @param[in] selected The selected item + */ + void SetSelectedItem( const std::string& selected ); + +public: + // Signals + + /** + * @brief AutofillServiceShownSignal + * + * @return The signal containing the received data + */ + AuthenticationSignalType& AutofillServiceShownSignal(); + + /** + * @brief AutofillListShownSignal + * + * @return The signal containing the received data + */ + ListShownSignalType& AutofillListShownSignal(); + + +public: // Not intended for application developers + + /** + * @brief Creates a handle using the Toolkit::Internal implementation. + * + * @param[in] implementation The Control implementation + */ + DALI_INTERNAL AutofillContainer( Internal::AutofillContainer* implementation ); + +}; + + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_AUTO_FILL_CONTAINER_H diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index 36f0649..721a456 100755 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -26,6 +26,7 @@ SET( devel_api_src_files ${devel_api_src_dir}/controls/scene3d-view/scene3d-view.cpp ${devel_api_src_dir}/controls/shadow-view/shadow-view.cpp ${devel_api_src_dir}/controls/super-blur-view/super-blur-view.cpp + ${devel_api_src_dir}/controls/text-controls/autofill-container.cpp ${devel_api_src_dir}/controls/text-controls/text-editor-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-field-devel.cpp ${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp @@ -179,6 +180,7 @@ SET( devel_api_super_blur_view_header_files ) SET( devel_api_text_controls_header_files + ${devel_api_src_dir}/controls/text-controls/autofill-container.h ${devel_api_src_dir}/controls/text-controls/text-editor-devel.h ${devel_api_src_dir}/controls/text-controls/text-field-devel.h ${devel_api_src_dir}/controls/text-controls/text-label-devel.h diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp index eb6285a..b49a8c5 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -313,7 +313,6 @@ const PropertyRegistration Control::Impl::PROPERTY_13( typeRegistration, "upFocu const PropertyRegistration Control::Impl::PROPERTY_14( typeRegistration, "downFocusableActorId", Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty ); const PropertyRegistration Control::Impl::PROPERTY_15( typeRegistration, "shadow", Toolkit::DevelControl::Property::SHADOW, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty ); - Control::Impl::Impl( Control& controlImpl ) : mControlImpl( controlImpl ), mState( Toolkit::DevelControl::NORMAL ), @@ -338,9 +337,12 @@ Control::Impl::Impl( Control& controlImpl ) mLongPressGestureDetector(), mTooltip( NULL ), mInputMethodContext(), + mAutofillItem(), + mAutofillContainer(), mFlags( Control::ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ), mIsKeyboardNavigationSupported( false ), - mIsKeyboardFocusGroup( false ) + mIsKeyboardFocusGroup( false ), + mIsAutofillEnabled( false ) { } @@ -1450,6 +1452,36 @@ void Control::Impl::ClearShadow() mControlImpl.RelayoutRequest(); } +void Control::Impl::SetAutofillEnabled( bool autofillEnabled ) +{ + mIsAutofillEnabled = autofillEnabled; +} + +bool Control::Impl::IsAutofillEnabled() +{ + return mIsAutofillEnabled; +} + +void Control::Impl::SetAutofillItemHandle( Dali::AutofillItem item ) +{ + mAutofillItem = item; +} + +Dali::AutofillItem Control::Impl::GetAutofillItemHandle() +{ + return mAutofillItem; +} + +void Control::Impl::SetAutofillContainer( Toolkit::AutofillContainer container ) +{ + mAutofillContainer = container; +} + +Toolkit::AutofillContainer Control::Impl::GetAutofillContainer() +{ + return mAutofillContainer; +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/controls/control/control-data-impl.h b/dali-toolkit/internal/controls/control/control-data-impl.h index 210f6e2..9648cd6 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.h +++ b/dali-toolkit/internal/controls/control/control-data-impl.h @@ -21,11 +21,14 @@ // EXTERNAL INCLUDES #include #include +#include +#include #include // INTERNAL INCLUDES #include #include +#include #include #include #include @@ -346,6 +349,42 @@ public: * @brief Clear the shadow. */ void ClearShadow(); + + /** + * @brief Sets whether the Autofill functionality is enabled. + * @param[in] autofillEnabled Set true when Autofill should be enabled. + */ + void SetAutofillEnabled( bool autofillEnabled ); + + /** + * @brief Check if the Autofill framework is enabled. + * @return True if Autofill is enabled + */ + bool IsAutofillEnabled(); + + /** + * @brief Sets AutofillItemHandle + * @param item AutofillItem handle + */ + void SetAutofillItemHandle( Dali::AutofillItem item ); + + /** + * @brief Gets AutofillItemHandle + * @return AutofillItem handle + */ + Dali::AutofillItem GetAutofillItemHandle(); + + /** + * @brief Sets AutofillContainer which this control belongs to. + * @param[in] container + */ + void SetAutofillContainer( Toolkit::AutofillContainer container ); + + /** + * @brief Gets AutofillContainer that the control belongs to. + * @return AutofillContainer handle + */ + Toolkit::AutofillContainer GetAutofillContainer(); private: @@ -419,10 +458,13 @@ public: TooltipPtr mTooltip; InputMethodContext mInputMethodContext; + AutofillItem mAutofillItem; + Toolkit::AutofillContainer mAutofillContainer; ControlBehaviour mFlags : CONTROL_BEHAVIOUR_FLAG_COUNT; ///< Flags passed in from constructor. bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control. bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group. + bool mIsAutofillEnabled : 1; ///< Stroes whether the Autofill functionality is enabled. RegisteredVisualContainer mRemoveVisuals; ///< List of visuals that are being replaced by another visual once ready diff --git a/dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp b/dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp new file mode 100755 index 0000000..6c9628b --- /dev/null +++ b/dali-toolkit/internal/controls/text-controls/autofill-container-impl.cpp @@ -0,0 +1,332 @@ +/* + * Copyright (c) 2019 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 + +// EXTERNAL INCLUDES +#include // for strcmp +#include +#include + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace Internal +{ + +namespace +{ + +#if defined ( DEBUG_ENABLED ) + Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_AUTOFILL_CONTAINER"); +#endif + +// Type registration +BaseHandle Create() +{ + return Toolkit::AutofillContainer::New( "" ); +} + +// Setup properties, signals and actions using the type-registry. +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::AutofillContainer, Dali::BaseHandle, Create ); + +DALI_SIGNAL_REGISTRATION( Toolkit, AutofillContainer, "serviceShown", SIGNAL_SERVICE_SHOWN ) +DALI_SIGNAL_REGISTRATION( Toolkit, AutofillContainer, "listShown", SIGNAL_LIST_SHOWN ) + +DALI_TYPE_REGISTRATION_END() + +} // namespace + +Toolkit::AutofillContainer AutofillContainer::New( const std::string& name ) +{ + // Create the implementation, temporarily owned by this handle on stack + Internal::AutofillContainer* impl = new AutofillContainer(); + + // Pass ownership to CustomActor handle + Toolkit::AutofillContainer handle( impl ); + impl->Initialize( name ); + + return handle; +} + +void AutofillContainer::Initialize( const std::string& name ) +{ + mAutofillManager = Dali::AutofillManager::Get(); + mAutofillGroup = mAutofillManager.CreateAutofillGroup( name ); + + // If the authentication is needed, AuthenticationReceivedSignal would be emitted. + mAutofillManager.AuthenticationReceivedSignal().Connect( mSlotDelegate, &AutofillContainer::OnAutofillAuthReceived ); + + // If the data to be filled is present, FillResponseReceivedSignal would be emitted. + mAutofillManager.FillResponseReceivedSignal().Connect( mSlotDelegate, &AutofillContainer::OnDataFillReceived ); + + // If the values to be filled are multiple, ListEventSignal would be emitted. + mAutofillManager.ListEventSignal().Connect( mSlotDelegate, &AutofillContainer::OnListReceived ); +} + +void AutofillContainer::AddAutofillItem( Dali::Toolkit::Control control, Dali::Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) +{ + if( control ) + { + Dali::AutofillItem item = mAutofillManager.CreateAutofillItem( id, label, static_cast(hint), isSensitive ); + + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + controlDataImpl.SetAutofillContainer( this ); + controlDataImpl.SetAutofillEnabled( true ); + controlDataImpl.SetAutofillItemHandle( item ); // TODO : This instance would be here as... std::map or pair + + mAutofillGroup.AddAutofillItem( item ); + + mPropertyIndex = propertyIndex; + + // TODO : Remove the mControlItemList below and replace it. + mControlList.push_back( std::pair< Dali::Toolkit::Control, Dali::AutofillItem >( control, item ) ); + + // Push back a Control to the list + mControlItemList.push_back( control ); + } +} + +void AutofillContainer::RemoveAutofillItem( Dali::Toolkit::Control control ) +{ + if( control ) + { + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + controlDataImpl.SetAutofillEnabled( false ); + // TODO : Put the control out the list + } +} + +Dali::AutofillGroup AutofillContainer::GetAutofillGroup() +{ + return mAutofillGroup; +} + +void AutofillContainer::SetFocusedControl( Toolkit::Control focused ) +{ + mCurrentFocused = focused; +} + +Toolkit::Control AutofillContainer::GetFocusedControl() +{ + return mCurrentFocused; +} + +void AutofillContainer::SaveAutofillData() +{ + for( std::vector::iterator iter = mControlItemList.begin(), endIter = mControlItemList.end(); iter != endIter; ++iter ) + { + std::string controlValue = (*iter).GetProperty( mPropertyIndex ); + Internal::Control& controlImpl = GetImplementation( *iter ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + controlDataImpl.GetAutofillItemHandle().SetSaveValue( controlValue ); + } + + // Sends request to save the current autofill data + mAutofillGroup.SaveAutofillData(); + mAutofillManager.SaveAutofillData( mAutofillGroup ); +} + +void AutofillContainer::RequestFillData() +{ + // Sends fill request to fill out the data. + mAutofillGroup.SendFillRequest(); +} + +void AutofillContainer::SetAutofillServiceName( const std::string& serviceName ) +{ + mAutofillServiceName = serviceName; +} + +const std::string& AutofillContainer::GetAutofillServiceName() const +{ + return mAutofillServiceName; +} + +void AutofillContainer::SetAutofillServiceMessage( const std::string& serviceMessage ) +{ + mAutofillServiceMessage = serviceMessage; +} + +const std::string& AutofillContainer::GetAutofillServiceMessage() const +{ + return mAutofillServiceMessage; +} + +void AutofillContainer::SetAutofillServiceImagePath( const std::string& serviceImagePath ) +{ + mAutofillServiceImagePath = serviceImagePath; +} + +const std::string& AutofillContainer::GetAutofillServiceImagePath() const +{ + return mAutofillServiceImagePath; +} + +unsigned int AutofillContainer::GetListCount() +{ + Toolkit::Control control = mCurrentFocused; + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + return controlDataImpl.GetAutofillItemHandle().GetFillValueCount(); +} + +const std::string& AutofillContainer::GetListItem( unsigned int index ) const +{ + Toolkit::Control control = mCurrentFocused; + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + return controlDataImpl.GetAutofillItemHandle().GetPresentationText( index ); +} + +void AutofillContainer::SetSelectedItem( const std::string& selected ) +{ + Toolkit::Control control = mCurrentFocused; + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + unsigned int count = controlDataImpl.GetAutofillItemHandle().GetFillValueCount(); + unsigned int index = 0; + for( index = 0; index < count; index++ ) + { + std::string presentationText = controlDataImpl.GetAutofillItemHandle().GetPresentationText( index ); + if( 0 == strcmp( presentationText.c_str(), selected.c_str() ) ) + { + break; + } + } + + for( std::vector::iterator iter = mControlItemList.begin(), endIter = mControlItemList.end(); iter != endIter; ++iter ) + { + Internal::Control& controlImpl = GetImplementation( *iter ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + std::string fillValue = controlDataImpl.GetAutofillItemHandle().GetFillValue( index ); + (*iter).SetProperty( Toolkit::TextField::Property::TEXT, fillValue ); + } +} + +// +void AutofillContainer::OnAutofillAuthReceived() +{ + SetAutofillServiceName( mAutofillManager.GetAuthenticationServiceName() ); + SetAutofillServiceMessage( mAutofillManager.GetAuthenticationServiceMessage() ); + SetAutofillServiceImagePath( mAutofillManager.GetAuthenticationServiceImagePath() ); + + Dali::Toolkit::AutofillContainer handle( this ); + mAuthenticationEventSignal.Emit( handle ); + + DALI_LOG_ERROR(" [ Emit DALi signal to receive the auth information ] \n"); + +} + +void AutofillContainer::OnDataFillReceived( Dali::AutofillItem item ) +{ + for( std::vector::iterator iter = mControlItemList.begin(), endIter = mControlItemList.end(); iter != endIter; ++iter ) + { + Internal::Control& controlImpl = GetImplementation( *iter ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + + if( 0 == strcmp( controlDataImpl.GetAutofillItemHandle().GetId().c_str(), item.GetId().c_str() ) ) + { + // TODO : Is the index for fill data always 0 in this case? + std::string itemText = controlDataImpl.GetAutofillItemHandle().GetFillValue( 0 ); + (*iter).SetProperty( Toolkit::TextField::Property::TEXT, itemText ); + } + } + +} + +void AutofillContainer::OnListReceived() +{ + mListEventSignal.Emit( mCurrentFocused ); + +} + + +AutofillContainer::AutofillContainer() +: mAutofillManager(), + mAutofillGroup(), + mControlItemList(), + mControlList(), + mSlotDelegate( this ), + mPropertyIndex( Property::INVALID_INDEX ), + mAutofillServiceName( "" ), + mAutofillServiceMessage( "" ), + mAutofillServiceImagePath( "" ), + mCurrentFocused() +{ +} + +AutofillContainer::~AutofillContainer() +{ + mAutofillManager.AuthenticationReceivedSignal().Disconnect( mSlotDelegate, &AutofillContainer::OnAutofillAuthReceived ); + mAutofillManager.FillResponseReceivedSignal().Disconnect( mSlotDelegate, &AutofillContainer::OnDataFillReceived ); + mAutofillManager.ListEventSignal().Disconnect( mSlotDelegate, &AutofillContainer::OnListReceived ); +} + +// Signals +Toolkit::AutofillContainer::AuthenticationSignalType& AutofillContainer::AutofillServiceShownSignal() +{ + return mAuthenticationEventSignal; +} + +Toolkit::AutofillContainer::ListShownSignalType& AutofillContainer::AutofillListShownSignal() +{ + return mListEventSignal; +} + +bool AutofillContainer::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +{ + Dali::BaseHandle handle( object ); + + bool connected( true ); + Toolkit::AutofillContainer container = Toolkit::AutofillContainer::DownCast( handle ); + + if( container ) + { + if( 0 == signalName.compare( SIGNAL_SERVICE_SHOWN ) ) + { + container.AutofillServiceShownSignal().Connect( tracker, functor ); + } + else if( 0 == signalName.compare( SIGNAL_LIST_SHOWN ) ) + { + container.AutofillListShownSignal().Connect( tracker, functor ); + } + else + { + // signalName does not match any signal + connected = false; + } + } + + return connected; +} + +} // namespace Internal + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/internal/controls/text-controls/autofill-container-impl.h b/dali-toolkit/internal/controls/text-controls/autofill-container-impl.h new file mode 100644 index 0000000..1ef8262 --- /dev/null +++ b/dali-toolkit/internal/controls/text-controls/autofill-container-impl.h @@ -0,0 +1,249 @@ +#ifndef DALI_TOOLKIT_INTERNAL_AUTOFILL_CONTAINER_H +#define DALI_TOOLKIT_INTERNAL_AUTOFILL_CONTAINER_H + +/* + * Copyright (c) 2019 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 +{ + +namespace Internal +{ + +/** + * @copydoc Toolkit::AutofillContainer + */ +class AutofillContainer : public Dali::BaseObject +{ +public: + + /** + * @copydoc Dali::Toollkit::AutofillContainer::New() + */ + static Toolkit::AutofillContainer New( const std::string& name ); + + /** + * @brief Initialize AutofillContainer + */ + void Initialize( const std::string& name ); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::AddAutofillItem() + */ + void AddAutofillItem( Dali::Toolkit::Control control, Dali::Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::RemoveAutofillItem() + */ + void RemoveAutofillItem( Dali::Toolkit::Control control ); + + /** + * @brief Gets AutofillGroup setting to AutofillContainer. + * + * @return The AutofillGroup instance + */ + Dali::AutofillGroup GetAutofillGroup(); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::SetFocusedControl() + */ + void SetFocusedControl( Toolkit::Control focused ); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::GetFocusedControl() + */ + Toolkit::Control GetFocusedControl(); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::SaveAutofillData() + */ + void SaveAutofillData(); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::RequestFillData() + */ + void RequestFillData(); + + /** + * @brief Sets the Autofill Service Name + * + * @param serviceName Autofill Service Name + */ + void SetAutofillServiceName( const std::string& serviceName ); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::GetAutofillServiceName() + */ + const std::string& GetAutofillServiceName() const; + + /** + * @brief Sets the Autofill Service Message + * + * @param serviceMessage Autofill Service Message + */ + void SetAutofillServiceMessage( const std::string& serviceMessage ); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::GetAutofillServiceMessage() + */ + const std::string& GetAutofillServiceMessage() const; + + /** + * @brief Sets the Autofill Service Image Path + * + * @param serviceImagePath Autofill Service Image Path + */ + void SetAutofillServiceImagePath( const std::string& serviceImagePath ); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::GetAutofillServiceImagePath() + */ + const std::string& GetAutofillServiceImagePath() const; + + /** + * @copydoc Dali::Toollkit::AutofillContainer::GetListCount() + */ + unsigned int GetListCount(); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::GetListItem() + */ + const std::string& GetListItem( unsigned int index ) const; + + /** + * @copydoc Dali::Toollkit::AutofillContainer::SetSelectedItem() + */ + void SetSelectedItem( const std::string& selected ); + + /** + * @brief Callback when Autofill Authentication information is recieved. + */ + void OnAutofillAuthReceived(); + + /** + * @brief Callback when Autofill Fill Response is recieved. + * @param[in] item The callback parameter + */ + void OnDataFillReceived( Dali::AutofillItem item ); + + /** + * @brief Callback when the values to be filled are multiple. + */ + void OnListReceived(); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::AutofillServiceShownSignal() + */ + Toolkit::AutofillContainer::AuthenticationSignalType& AutofillServiceShownSignal(); + + /** + * @copydoc Dali::Toollkit::AutofillContainer::AutofillListShownSignal() + */ + Toolkit::AutofillContainer::ListShownSignalType& AutofillListShownSignal(); + + /** + * 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: // Implementation + + /** + * Construct a new AutofillContainer. + */ + AutofillContainer(); + + /** + * A reference counted object may only be deleted by calling Unreference() + */ + virtual ~AutofillContainer(); + +private: + + // Undefined copy constructor and assignment operators + AutofillContainer(const AutofillContainer&); + AutofillContainer& operator=(const AutofillContainer& rhs); + +private: // Data + + Dali::AutofillManager mAutofillManager; + Dali::AutofillGroup mAutofillGroup; + std::vector mControlItemList; ///< The List of Control adding to AutofillContainer + //std::map mControlList; + std::vector< std::pair< Dali::Toolkit::Control, Dali::AutofillItem > > mControlList; + + SlotDelegate< AutofillContainer > mSlotDelegate; + + Property::Index mPropertyIndex; ///< The index of property registered by each control + + Toolkit::AutofillContainer::AuthenticationSignalType mAuthenticationEventSignal; + Toolkit::AutofillContainer::ListShownSignalType mListEventSignal; + + std::string mAutofillServiceName; + std::string mAutofillServiceMessage; + std::string mAutofillServiceImagePath; + + Toolkit::Control mCurrentFocused; +}; + +} // namespace Internal + +// Helpers for public-api forwarding methods + +inline Toolkit::Internal::AutofillContainer& GetImpl( Toolkit::AutofillContainer& autofillContainer ) +{ + DALI_ASSERT_ALWAYS(autofillContainer); + + Dali::BaseObject& handle = autofillContainer.GetBaseObject(); + + return static_cast(handle); +} + +inline const Toolkit::Internal::AutofillContainer& GetImpl( const Toolkit::AutofillContainer& autofillContainer ) +{ + DALI_ASSERT_ALWAYS(autofillContainer); + + const Dali::BaseObject& handle = autofillContainer.GetBaseObject(); + + return static_cast(handle); +} + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_INTERNAL_AUTOFILL_CONTAINER_H 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 2b4fcc0..33d9689 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include #include @@ -1585,7 +1587,7 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType ) void TextField::OnKeyInputFocusGained() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() ); - if ( mInputMethodContext ) + if( mInputMethodContext ) { mInputMethodContext.ApplyOptions( mInputMethodOptions ); @@ -1599,13 +1601,30 @@ void TextField::OnKeyInputFocusGained() // When window gain lost focus, the inputMethodContext is deactivated. Thus when window gain focus again, the inputMethodContext must be activated. mInputMethodContext.SetRestoreAfterFocusLost( true ); } - ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); - if ( notifier ) + ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); + if( notifier ) { notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected ); } + Toolkit::Control control = Toolkit::Control::DownCast( Self() ); + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + bool enableAutofill = controlDataImpl.IsAutofillEnabled(); + if( enableAutofill ) + { + Toolkit::AutofillContainer container = controlDataImpl.GetAutofillContainer(); + container.SetFocusedControl( control ); + + Internal::AutofillContainer& containerImpl = GetImpl( container ); + Dali::AutofillGroup containerGroup = containerImpl.GetAutofillGroup(); + if( containerGroup != nullptr ) + { + containerGroup.RequestAuthentication(); + } + + } mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last. 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 2991931..59bedf8 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include // INTERNAL INCLUDES #include @@ -291,6 +292,7 @@ private: // Data Toolkit::Control mStencil; ///< For EXCEED_POLICY_CLIP std::vector mClippingDecorationActors; ///< Decoration actors which need clipping. Dali::InputMethodOptions mInputMethodOptions; + Dali::AutofillItem mAutofillItem; Actor mRenderableActor; Actor mActiveLayer; diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index 246ba89..b9fde11 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -95,6 +95,7 @@ SET( toolkit_src_files ${toolkit_src_dir}/controls/slider/slider-impl.cpp ${toolkit_src_dir}/controls/super-blur-view/super-blur-view-impl.cpp ${toolkit_src_dir}/controls/table-view/table-view-impl.cpp + ${toolkit_src_dir}/controls/text-controls/autofill-container-impl.cpp ${toolkit_src_dir}/controls/text-controls/text-editor-impl.cpp ${toolkit_src_dir}/controls/text-controls/text-field-impl.cpp ${toolkit_src_dir}/controls/text-controls/text-label-impl.cpp -- 2.7.4 From d65c9d224f52287085dadcee04526c217225666c Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 9 Sep 2020 14:56:45 +0900 Subject: [PATCH 14/16] [Tizen] Add deprecated log to Control - DALi projects are deprecated now, so added deprecated log to major class, Control. Change-Id: Ie21a7b184ee56bbdbb3c672d7d370800751b3620 Signed-off-by: Seoyeon Kim --- dali-toolkit/public-api/controls/control.cpp | 1 + dali-toolkit/public-api/controls/control.h | 4 ++++ doc/dali-toolkit-doc.h | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index d9b2f8f..38d67d0 100644 --- a/dali-toolkit/public-api/controls/control.cpp +++ b/dali-toolkit/public-api/controls/control.cpp @@ -33,6 +33,7 @@ namespace Toolkit Control Control::New() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" ); return Internal::Control::New(); } diff --git a/dali-toolkit/public-api/controls/control.h b/dali-toolkit/public-api/controls/control.h index ed68e15..dae155c 100644 --- a/dali-toolkit/public-api/controls/control.h +++ b/dali-toolkit/public-api/controls/control.h @@ -49,6 +49,8 @@ class Control; */ /** + * @DEPRECATED_1_5.19 + * * @brief Control is the base class for all controls. * * The implementation of the control must be supplied; see Internal::Control for more details. @@ -178,6 +180,8 @@ public: public: // Creation & Destruction /** + * @DEPRECATED_1_5.19 + * * @brief Creates a new instance of a Control. * * @SINCE_1_0.0 diff --git a/doc/dali-toolkit-doc.h b/doc/dali-toolkit-doc.h index 5765d9c..edb10e3 100755 --- a/doc/dali-toolkit-doc.h +++ b/doc/dali-toolkit-doc.h @@ -19,7 +19,7 @@ */ /** - * @defgroup dali DALi + * @defgroup dali DALi (Deprecated) * @ingroup CAPI_UI_FRAMEWORK * * @brief DALi is a cross-platform 3D UI Toolkit for embedded systems. -- 2.7.4 From 9a783ba8f2fc41e46590fc4a7119d4e21b81404f Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 16 Sep 2020 11:00:17 +0900 Subject: [PATCH 15/16] [Tizen] Add deprecated tag to dali-toolkit-doc.h - Missed to add (Deprecated) tag in dali-toolkit as well Change-Id: I86cfc5b8eab13488df30f7f78c1f7bfecf6c72fd Signed-off-by: Seoyeon Kim --- doc/dali-toolkit-doc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dali-toolkit-doc.h b/doc/dali-toolkit-doc.h index edb10e3..5b65ce6 100755 --- a/doc/dali-toolkit-doc.h +++ b/doc/dali-toolkit-doc.h @@ -55,7 +55,7 @@ * The layer diagram for DALi modules is shown below: * @image html dali-modules.png "Figure: DALi modules" * - * @defgroup dali_toolkit DALi Toolkit + * @defgroup dali_toolkit DALi Toolkit (Deprecated) * * @brief DALi Toolkit provides UI components and various effects on top of the DALi Core. * -- 2.7.4 From 02aeb497a2432e5d385307fb8e09165eb8407a10 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Mon, 12 Jul 2021 11:34:07 +0900 Subject: [PATCH 16/16] po: copy po resource from dali-toolkit This could resolve following issue: [07/09 11:48:41 UTC] file /usr/share/locale/zh_CN/LC_MESSAGES/dali-toolkit.mo conflicts between attempted installs of dali2-toolkit-resources_720x1280-2.0.33-20210709.104228.armv7l and dali-toolkit-resources_720x1280-1.5.19-116.222.armv7l which is detected by creating image Change-Id: I693c3ba81c2cc80ab547a10c835507abf8728edc --- dali-toolkit/po/ar.po | 2 ++ dali-toolkit/po/az.po | 5 +++++ dali-toolkit/po/bg.po | 5 +++++ dali-toolkit/po/bn_BD.po | 5 +++++ dali-toolkit/po/ca.po | 2 ++ dali-toolkit/po/cs.po | 2 ++ dali-toolkit/po/da.po | 5 +++++ dali-toolkit/po/de.po | 2 ++ dali-toolkit/po/el_GR.po | 5 +++++ dali-toolkit/po/en.po | 5 +++++ dali-toolkit/po/en_US.po | 5 +++++ dali-toolkit/po/es_ES.po | 5 +++++ dali-toolkit/po/es_US.po | 5 +++++ dali-toolkit/po/et.po | 5 +++++ dali-toolkit/po/eu.po | 5 +++++ dali-toolkit/po/fa.po | 2 ++ dali-toolkit/po/fi.po | 2 ++ dali-toolkit/po/fr.po | 2 ++ dali-toolkit/po/fr_CA.po | 5 +++++ dali-toolkit/po/gl.po | 2 ++ dali-toolkit/po/hr.po | 5 +++++ dali-toolkit/po/hu.po | 2 ++ dali-toolkit/po/hy.po | 5 +++++ dali-toolkit/po/is.po | 5 +++++ dali-toolkit/po/it_IT.po | 5 +++++ dali-toolkit/po/ka.po | 5 +++++ dali-toolkit/po/kk.po | 5 +++++ dali-toolkit/po/ko_KR.po | 2 ++ dali-toolkit/po/lt.po | 2 ++ dali-toolkit/po/lv.po | 5 +++++ dali-toolkit/po/mn_MN.po | 5 +++++ dali-toolkit/po/nb.po | 5 +++++ dali-toolkit/po/nl.po | 2 ++ dali-toolkit/po/pl.po | 2 ++ dali-toolkit/po/pt_BR.po | 5 +++++ dali-toolkit/po/pt_PT.po | 5 +++++ dali-toolkit/po/ro.po | 5 +++++ dali-toolkit/po/ru_RU.po | 5 +++++ dali-toolkit/po/sk.po | 5 +++++ dali-toolkit/po/sl.po | 2 ++ dali-toolkit/po/sr.po | 2 ++ dali-toolkit/po/sv.po | 5 +++++ dali-toolkit/po/tr_TR.po | 5 +++++ dali-toolkit/po/uk.po | 5 +++++ dali-toolkit/po/ur.po | 2 ++ dali-toolkit/po/uz.po | 5 +++++ dali-toolkit/po/vi.po | 2 ++ dali-toolkit/po/zh_CN.po | 2 ++ 48 files changed, 186 insertions(+) diff --git a/dali-toolkit/po/ar.po b/dali-toolkit/po/ar.po index 414fb07..20fcb02 100755 --- a/dali-toolkit/po/ar.po +++ b/dali-toolkit/po/ar.po @@ -20,3 +20,5 @@ msgstr "لصق" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "الحافظة" +msgid "slider" +msgstr "" diff --git a/dali-toolkit/po/az.po b/dali-toolkit/po/az.po index 6581e52..cfd4a80 100755 --- a/dali-toolkit/po/az.po +++ b/dali-toolkit/po/az.po @@ -16,3 +16,8 @@ msgstr "Yapışdır" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Mübadilə buferi" +msgid "icon" +msgstr "Piktoqram" + +msgid "slider" +msgstr "Sürüngəc" diff --git a/dali-toolkit/po/bg.po b/dali-toolkit/po/bg.po index 52a2d78..4b13de1 100755 --- a/dali-toolkit/po/bg.po +++ b/dali-toolkit/po/bg.po @@ -16,3 +16,8 @@ msgstr "Поставяне" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Системен буфер" +msgid "icon" +msgstr "Икона" + +msgid "slider" +msgstr "Плъзгач" diff --git a/dali-toolkit/po/bn_BD.po b/dali-toolkit/po/bn_BD.po index c29c744..a6191a8 100644 --- a/dali-toolkit/po/bn_BD.po +++ b/dali-toolkit/po/bn_BD.po @@ -16,3 +16,8 @@ msgstr "পেস্ট করুন" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "ক্লিপবোর্ড" +msgid "icon" +msgstr "Icon" + +msgid "slider" +msgstr "স্লাইডার" diff --git a/dali-toolkit/po/ca.po b/dali-toolkit/po/ca.po index 34c6125..ba85f18 100755 --- a/dali-toolkit/po/ca.po +++ b/dali-toolkit/po/ca.po @@ -16,3 +16,5 @@ msgstr "Enganxar" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Porta-retalls" +msgid "slider" +msgstr "control lliscant" diff --git a/dali-toolkit/po/cs.po b/dali-toolkit/po/cs.po index c8c68f9..3e4f477 100755 --- a/dali-toolkit/po/cs.po +++ b/dali-toolkit/po/cs.po @@ -16,3 +16,5 @@ msgstr "Vložit" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Schránka" +msgid "slider" +msgstr "šoupátko" diff --git a/dali-toolkit/po/da.po b/dali-toolkit/po/da.po index 0898d64..fea998c 100755 --- a/dali-toolkit/po/da.po +++ b/dali-toolkit/po/da.po @@ -16,3 +16,8 @@ msgstr "Indsæt" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Udklipsholder" +msgid "icon" +msgstr "Ikon" + +msgid "slider" +msgstr "skyder" diff --git a/dali-toolkit/po/de.po b/dali-toolkit/po/de.po index 3082bbb..f1b0020 100755 --- a/dali-toolkit/po/de.po +++ b/dali-toolkit/po/de.po @@ -16,3 +16,5 @@ msgstr "Einfügen" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Zwischenablage" +msgid "slider" +msgstr "" diff --git a/dali-toolkit/po/el_GR.po b/dali-toolkit/po/el_GR.po index 8f93b05..3ed1056 100755 --- a/dali-toolkit/po/el_GR.po +++ b/dali-toolkit/po/el_GR.po @@ -16,3 +16,8 @@ msgstr "Επικόλληση" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Πρόχειρο" +msgid "icon" +msgstr "Εικονίδιο" + +msgid "slider" +msgstr "Ρυθμιστικό" diff --git a/dali-toolkit/po/en.po b/dali-toolkit/po/en.po index 2579c1c..9945b39 100755 --- a/dali-toolkit/po/en.po +++ b/dali-toolkit/po/en.po @@ -16,3 +16,8 @@ msgstr "Paste" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Clipboard" +msgid "icon" +msgstr "Icon" + +msgid "slider" +msgstr "Slider" diff --git a/dali-toolkit/po/en_US.po b/dali-toolkit/po/en_US.po index 2579c1c..9945b39 100755 --- a/dali-toolkit/po/en_US.po +++ b/dali-toolkit/po/en_US.po @@ -16,3 +16,8 @@ msgstr "Paste" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Clipboard" +msgid "icon" +msgstr "Icon" + +msgid "slider" +msgstr "Slider" diff --git a/dali-toolkit/po/es_ES.po b/dali-toolkit/po/es_ES.po index 5fed085..b0b516e 100755 --- a/dali-toolkit/po/es_ES.po +++ b/dali-toolkit/po/es_ES.po @@ -16,3 +16,8 @@ msgstr "Pegar" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Portapapeles" +msgid "icon" +msgstr "Icono" + +msgid "slider" +msgstr "Controlador deslizante" diff --git a/dali-toolkit/po/es_US.po b/dali-toolkit/po/es_US.po index fdb40d8..5e7ec49 100755 --- a/dali-toolkit/po/es_US.po +++ b/dali-toolkit/po/es_US.po @@ -16,3 +16,8 @@ msgstr "Pegar" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Portapapeles" +msgid "icon" +msgstr "Icono" + +msgid "slider" +msgstr "Controlador deslizante" diff --git a/dali-toolkit/po/et.po b/dali-toolkit/po/et.po index 361b88a..a68fc27 100755 --- a/dali-toolkit/po/et.po +++ b/dali-toolkit/po/et.po @@ -16,3 +16,8 @@ msgstr "Kleebi" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Lõikelaud" +msgid "icon" +msgstr "Ikoon" + +msgid "slider" +msgstr "Liugur" diff --git a/dali-toolkit/po/eu.po b/dali-toolkit/po/eu.po index 86fe6e5..616c68f 100755 --- a/dali-toolkit/po/eu.po +++ b/dali-toolkit/po/eu.po @@ -16,3 +16,8 @@ msgstr "Itsatsi" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Arbela" +msgid "icon" +msgstr "Ikonoa" + +msgid "slider" +msgstr "Irristagailua" diff --git a/dali-toolkit/po/fa.po b/dali-toolkit/po/fa.po index 5e8369b..5ac66a0 100644 --- a/dali-toolkit/po/fa.po +++ b/dali-toolkit/po/fa.po @@ -20,3 +20,5 @@ msgstr "الحاق" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "کلیپ بورد" +msgid "slider" +msgstr "" diff --git a/dali-toolkit/po/fi.po b/dali-toolkit/po/fi.po index fd23422..f6c7931 100755 --- a/dali-toolkit/po/fi.po +++ b/dali-toolkit/po/fi.po @@ -16,3 +16,5 @@ msgstr "Liitä" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Leikepöytä" +msgid "slider" +msgstr "liukusäädin" diff --git a/dali-toolkit/po/fr.po b/dali-toolkit/po/fr.po index e217eef..dfff479 100755 --- a/dali-toolkit/po/fr.po +++ b/dali-toolkit/po/fr.po @@ -16,3 +16,5 @@ msgstr "Coller" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Presse-papier" +msgid "slider" +msgstr "curseur" diff --git a/dali-toolkit/po/fr_CA.po b/dali-toolkit/po/fr_CA.po index 0a8fdd2..7902515 100755 --- a/dali-toolkit/po/fr_CA.po +++ b/dali-toolkit/po/fr_CA.po @@ -16,3 +16,8 @@ msgstr "Coller" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Presse-papier" +msgid "icon" +msgstr "Icône" + +msgid "slider" +msgstr "Curseur" diff --git a/dali-toolkit/po/gl.po b/dali-toolkit/po/gl.po index 3e66cbf..4b08c18 100755 --- a/dali-toolkit/po/gl.po +++ b/dali-toolkit/po/gl.po @@ -16,3 +16,5 @@ msgstr "Pegar" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Portapapeis" +msgid "slider" +msgstr "Barra de desprazamento" diff --git a/dali-toolkit/po/hr.po b/dali-toolkit/po/hr.po index 6c8a251..436f894 100755 --- a/dali-toolkit/po/hr.po +++ b/dali-toolkit/po/hr.po @@ -16,3 +16,8 @@ msgstr "Zalijepi" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Međuspremnik" +msgid "icon" +msgstr "Ikona" + +msgid "slider" +msgstr "Klizač" diff --git a/dali-toolkit/po/hu.po b/dali-toolkit/po/hu.po index accab91..367144c 100755 --- a/dali-toolkit/po/hu.po +++ b/dali-toolkit/po/hu.po @@ -16,3 +16,5 @@ msgstr "Beilleszt" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Vágólap" +msgid "slider" +msgstr "csúszka" diff --git a/dali-toolkit/po/hy.po b/dali-toolkit/po/hy.po index 9892948..42a66e1 100755 --- a/dali-toolkit/po/hy.po +++ b/dali-toolkit/po/hy.po @@ -16,3 +16,8 @@ msgstr "Տեղադրել" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Գզրոց" +msgid "icon" +msgstr "Պատկերակ" + +msgid "slider" +msgstr "Սողանիկ" diff --git a/dali-toolkit/po/is.po b/dali-toolkit/po/is.po index bd1952e..fe0b00d 100755 --- a/dali-toolkit/po/is.po +++ b/dali-toolkit/po/is.po @@ -16,3 +16,8 @@ msgstr "Líma" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Klippiborð" +msgid "icon" +msgstr "Tákn" + +msgid "slider" +msgstr "Skyggna" diff --git a/dali-toolkit/po/it_IT.po b/dali-toolkit/po/it_IT.po index f68a4f9..0f578de 100755 --- a/dali-toolkit/po/it_IT.po +++ b/dali-toolkit/po/it_IT.po @@ -16,3 +16,8 @@ msgstr "Incolla" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Appunti" +msgid "icon" +msgstr "Icona" + +msgid "slider" +msgstr "Dispositivo di scorrimento" diff --git a/dali-toolkit/po/ka.po b/dali-toolkit/po/ka.po index 5dd6d53..28f1b73 100755 --- a/dali-toolkit/po/ka.po +++ b/dali-toolkit/po/ka.po @@ -16,3 +16,8 @@ msgstr "ჩასმა" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "ბუფერული მეხს." +msgid "icon" +msgstr "ნიშანი" + +msgid "slider" +msgstr "სლაიდერი" diff --git a/dali-toolkit/po/kk.po b/dali-toolkit/po/kk.po index 6de1a32..20845c9 100755 --- a/dali-toolkit/po/kk.po +++ b/dali-toolkit/po/kk.po @@ -16,3 +16,8 @@ msgstr "Қою" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Буфер" +msgid "icon" +msgstr "Белгіше" + +msgid "slider" +msgstr "Сырғытпа" diff --git a/dali-toolkit/po/ko_KR.po b/dali-toolkit/po/ko_KR.po index 8ecb8d3..dadd773 100755 --- a/dali-toolkit/po/ko_KR.po +++ b/dali-toolkit/po/ko_KR.po @@ -16,3 +16,5 @@ msgstr "붙여넣기" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "클립보드" +msgid "slider" +msgstr "슬라이더" diff --git a/dali-toolkit/po/lt.po b/dali-toolkit/po/lt.po index d403fcc..4163cd3 100755 --- a/dali-toolkit/po/lt.po +++ b/dali-toolkit/po/lt.po @@ -16,3 +16,5 @@ msgstr "Įklijuoti" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Iškarpinė" +msgid "slider" +msgstr "šliaužiklis" diff --git a/dali-toolkit/po/lv.po b/dali-toolkit/po/lv.po index 519597b..9698938 100755 --- a/dali-toolkit/po/lv.po +++ b/dali-toolkit/po/lv.po @@ -16,3 +16,8 @@ msgstr "Ielīmēt" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Starpliktuve" +msgid "icon" +msgstr "Ikona" + +msgid "slider" +msgstr "Slīdnis" diff --git a/dali-toolkit/po/mn_MN.po b/dali-toolkit/po/mn_MN.po index cc2b51b..ee6fc24 100644 --- a/dali-toolkit/po/mn_MN.po +++ b/dali-toolkit/po/mn_MN.po @@ -16,3 +16,8 @@ msgstr "Буулгах" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Түр санах ой" +msgid "icon" +msgstr "Дүрс" + +msgid "slider" +msgstr "Slider" diff --git a/dali-toolkit/po/nb.po b/dali-toolkit/po/nb.po index 0c15456..ae6d545 100755 --- a/dali-toolkit/po/nb.po +++ b/dali-toolkit/po/nb.po @@ -16,3 +16,8 @@ msgstr "Lim inn" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Utklippstavle" +msgid "icon" +msgstr "Ikon" + +msgid "slider" +msgstr "Glidebryter" diff --git a/dali-toolkit/po/nl.po b/dali-toolkit/po/nl.po index 48645c4..16e7bd4 100755 --- a/dali-toolkit/po/nl.po +++ b/dali-toolkit/po/nl.po @@ -16,3 +16,5 @@ msgstr "Plakken" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Klembord" +msgid "slider" +msgstr "" diff --git a/dali-toolkit/po/pl.po b/dali-toolkit/po/pl.po index c87ec62..b1a99b5 100755 --- a/dali-toolkit/po/pl.po +++ b/dali-toolkit/po/pl.po @@ -16,3 +16,5 @@ msgstr "Wklej" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Schowek" +msgid "slider" +msgstr "slajder" diff --git a/dali-toolkit/po/pt_BR.po b/dali-toolkit/po/pt_BR.po index 9c6743a..eb86f8e 100755 --- a/dali-toolkit/po/pt_BR.po +++ b/dali-toolkit/po/pt_BR.po @@ -16,3 +16,8 @@ msgstr "Colar" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Área de transferência" +msgid "icon" +msgstr "Ícone" + +msgid "slider" +msgstr "Controle deslizante" diff --git a/dali-toolkit/po/pt_PT.po b/dali-toolkit/po/pt_PT.po index e1a21da..b6c820e 100755 --- a/dali-toolkit/po/pt_PT.po +++ b/dali-toolkit/po/pt_PT.po @@ -16,3 +16,8 @@ msgstr "Colar" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Área transferência" +msgid "icon" +msgstr "Ícone" + +msgid "slider" +msgstr "Cursor de deslocamento" diff --git a/dali-toolkit/po/ro.po b/dali-toolkit/po/ro.po index 0d78703..4e5278e 100755 --- a/dali-toolkit/po/ro.po +++ b/dali-toolkit/po/ro.po @@ -16,3 +16,8 @@ msgstr "Lipire" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Clipboard" +msgid "icon" +msgstr "Pictogr." + +msgid "slider" +msgstr "Cursor" diff --git a/dali-toolkit/po/ru_RU.po b/dali-toolkit/po/ru_RU.po index 8134f66..c7dc38c 100755 --- a/dali-toolkit/po/ru_RU.po +++ b/dali-toolkit/po/ru_RU.po @@ -16,3 +16,8 @@ msgstr "Вставить" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Буфер обмена" +msgid "icon" +msgstr "Значок" + +msgid "slider" +msgstr "Ползунок" diff --git a/dali-toolkit/po/sk.po b/dali-toolkit/po/sk.po index 1944646..327899d 100755 --- a/dali-toolkit/po/sk.po +++ b/dali-toolkit/po/sk.po @@ -16,3 +16,8 @@ msgstr "Vložiť" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Schránka" +msgid "icon" +msgstr "Ikona" + +msgid "slider" +msgstr "Posuvný ovládač" diff --git a/dali-toolkit/po/sl.po b/dali-toolkit/po/sl.po index 4c8ad23..6de5ccd 100755 --- a/dali-toolkit/po/sl.po +++ b/dali-toolkit/po/sl.po @@ -16,3 +16,5 @@ msgstr "Prilepi" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Odložišče" +msgid "slider" +msgstr "drsnik" diff --git a/dali-toolkit/po/sr.po b/dali-toolkit/po/sr.po index 1be1832..d792061 100755 --- a/dali-toolkit/po/sr.po +++ b/dali-toolkit/po/sr.po @@ -16,3 +16,5 @@ msgstr "Zalepi" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Privremena memorija" +msgid "slider" +msgstr "клизач" diff --git a/dali-toolkit/po/sv.po b/dali-toolkit/po/sv.po index 13c587d..573dd6a 100755 --- a/dali-toolkit/po/sv.po +++ b/dali-toolkit/po/sv.po @@ -16,3 +16,8 @@ msgstr "Klistra in" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Urklipp" +msgid "icon" +msgstr "Ikon" + +msgid "slider" +msgstr "Slider" diff --git a/dali-toolkit/po/tr_TR.po b/dali-toolkit/po/tr_TR.po index a360194..e116eec 100755 --- a/dali-toolkit/po/tr_TR.po +++ b/dali-toolkit/po/tr_TR.po @@ -16,3 +16,8 @@ msgstr "Yapıştır" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Pano" +msgid "icon" +msgstr "Simge" + +msgid "slider" +msgstr "Kaydırıcı" diff --git a/dali-toolkit/po/uk.po b/dali-toolkit/po/uk.po index c41b559..baab2fa 100755 --- a/dali-toolkit/po/uk.po +++ b/dali-toolkit/po/uk.po @@ -16,3 +16,8 @@ msgstr "Вставити" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Буфер обміну" +msgid "icon" +msgstr "Значок" + +msgid "slider" +msgstr "Слайдер" diff --git a/dali-toolkit/po/ur.po b/dali-toolkit/po/ur.po index b4bf3be..b663b28 100644 --- a/dali-toolkit/po/ur.po +++ b/dali-toolkit/po/ur.po @@ -20,3 +20,5 @@ msgstr "جوڑ دیں" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "کلپ بورڈ" +msgid "slider" +msgstr "" diff --git a/dali-toolkit/po/uz.po b/dali-toolkit/po/uz.po index bcad8b0..bdce823 100755 --- a/dali-toolkit/po/uz.po +++ b/dali-toolkit/po/uz.po @@ -16,3 +16,8 @@ msgstr "Qo‘shib qo‘yish" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Bufer" +msgid "icon" +msgstr "Ikoncha" + +msgid "slider" +msgstr "Slider" diff --git a/dali-toolkit/po/vi.po b/dali-toolkit/po/vi.po index e22211f..5c1e515 100644 --- a/dali-toolkit/po/vi.po +++ b/dali-toolkit/po/vi.po @@ -16,3 +16,5 @@ msgstr "Dán" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "Bộ nhớ tạm" +msgid "slider" +msgstr "Thanh Trượt" diff --git a/dali-toolkit/po/zh_CN.po b/dali-toolkit/po/zh_CN.po index b80e9d9..603d05f 100755 --- a/dali-toolkit/po/zh_CN.po +++ b/dali-toolkit/po/zh_CN.po @@ -16,3 +16,5 @@ msgstr "粘贴" msgid "IDS_COM_BODY_CLIPBOARD" msgstr "剪贴板" +msgid "slider" +msgstr "滑块" -- 2.7.4