From: Victor Cebollada Date: Fri, 24 Jan 2020 13:50:22 +0000 (+0000) Subject: [dali_1.4.55] Merge branch 'devel/master' X-Git-Tag: dali_1.9.8~5^2~11 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=2b0beeb59996e7b52649eab32c9c5a964a894f08;hp=e1ed211ae09173ef63a8d57690d0b23354bdc355 [dali_1.4.55] Merge branch 'devel/master' Change-Id: Ia67ce58118fe187787bcbffbef98b63bc0f20cc9 --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp index b756ed7..a76ccb9 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -289,6 +289,107 @@ int UtcDaliTextControllerImfEvent(void) END_TEST; } +int UtcDaliTextControllerImfPreeditStyle(void) +{ + tet_infoline(" UtcDaliTextControllerImfPreeditStyle"); + ToolkitTestApplication application; + + // Creates a text controller. + ControllerPtr controller = Controller::New(); + + std::string text; + InputMethodContext::EventData imfEvent; + + DALI_TEST_CHECK( controller ); + + // Configures the text controller similarly to the text-field. + ConfigureTextField( controller ); + + InputMethodContext inputMethodContext = InputMethodContext::New(); + + // Send COMMIT event. + imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "Hello ", 0, 6 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Force to update the model. + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION ); + + // Send PRE_EDIT event + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::NONE ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Set the preedit style as REVERSE + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::REVERSE ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Set the preedit style as HIGHLIGHT + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::HIGHLIGHT ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Set the preedit style as CUSTOM_PLATFORM_STYLE_1 + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_1 ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Set the preedit style as CUSTOM_PLATFORM_STYLE_2 + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_2 ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Set the preedit style as CUSTOM_PLATFORM_STYLE_3 + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_3 ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); + + // Set the preedit style as CUSTOM_PLATFORM_STYLE_4 + inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_4 ); + controller->GetNaturalSize(); + + controller->GetText( text ); + DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); + + tet_result(TET_PASS); + END_TEST; +} + int UtcDaliTextControllerTextPopupButtonTouched(void) { tet_infoline(" UtcDaliTextControllerTextPopupButtonTouched"); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp index 8372e03..98a2fa5 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp @@ -46,9 +46,10 @@ void TestGlAbstraction::Initialize() mActiveTextureUnit = 0; mCheckFramebufferStatusResult = 0; mFramebufferStatus = 0; - mFramebufferColorAttached = 0; mFramebufferDepthAttached = 0; mFramebufferStencilAttached = 0; + mFramebufferColorAttachmentCount = 0; + mFrameBufferColorStatus = 0; mNumBinaryFormats = 0; mBinaryFormats = 0; mProgramBinaryLength = 0; @@ -58,6 +59,7 @@ void TestGlAbstraction::Initialize() mLastShaderCompiled = 0; mLastClearBitMask = 0; + mLastClearColor = Color::TRANSPARENT; mClearCount = 0; mLastBlendEquationRgb = 0; @@ -131,3 +133,4 @@ bool BlendDisabled(const Dali::TraceCallStack& callStack) bool blendEnabled = callStack.FindMethodAndParams( "Disable", out.str() ); return blendEnabled; } + diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h index 3fae461..9f458fc 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h @@ -2,7 +2,7 @@ #define TEST_GL_ABSTRACTION_H /* - * Copyright (c) 2019 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. @@ -29,6 +29,7 @@ // INTERNAL INCLUDES #include +#include #include #include #include @@ -252,9 +253,9 @@ public: return mCheckFramebufferStatusResult; } - inline GLenum CheckFramebufferColorAttachment() + inline GLuint CheckFramebufferColorAttachmentCount() { - return mFramebufferColorAttached; + return mFramebufferColorAttachmentCount; } inline GLenum CheckFramebufferDepthAttachment() @@ -275,6 +276,15 @@ public: inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + mLastClearColor.r = red; + mLastClearColor.g = green; + mLastClearColor.b = blue; + mLastClearColor.a = alpha; + } + + inline const Vector4& GetLastClearColor() const + { + return mLastClearColor; } inline void ClearDepthf(GLclampf depth) @@ -575,9 +585,14 @@ public: mFramebufferStatus |= 4; //We check 4 attachment colors - if ((attachment == GL_COLOR_ATTACHMENT0) || (attachment == GL_COLOR_ATTACHMENT1) || (attachment == GL_COLOR_ATTACHMENT2) || (attachment == GL_COLOR_ATTACHMENT4)) + if ((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS)) { - mFramebufferColorAttached = true; + uint8_t mask = 1 << (attachment - GL_COLOR_ATTACHMENT0); + if ((mFrameBufferColorStatus & mask) == 0) + { + mFrameBufferColorStatus |= mask; + ++mFramebufferColorAttachmentCount; + } } } @@ -2169,9 +2184,10 @@ private: GLenum mActiveTextureUnit; GLenum mCheckFramebufferStatusResult; GLint mFramebufferStatus; - GLenum mFramebufferColorAttached; GLenum mFramebufferDepthAttached; GLenum mFramebufferStencilAttached; + GLuint mFramebufferColorAttachmentCount; + GLuint mFrameBufferColorStatus; GLint mNumBinaryFormats; GLint mBinaryFormats; GLint mProgramBinaryLength; @@ -2182,6 +2198,7 @@ private: ShaderSourceMap mShaderSources; GLuint mLastShaderCompiled; GLbitfield mLastClearBitMask; + Vector4 mLastClearColor; unsigned int mClearCount; Vector4 mLastBlendColor; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp index f316e50..2446f29 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * 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. @@ -60,7 +60,7 @@ public: void ApplyOptions( const InputMethodOptions& options ); bool FilterEventKey( const Dali::KeyEvent& keyEvent ); void SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type ); - Dali::InputMethodContext::PreeditStyle GetPreeditStyle() const; + void GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttributeData >& attrs ) const; public: // Signals ActivatedSignalType& ActivatedSignal() { return mActivatedSignal; } @@ -87,7 +87,7 @@ private: bool mRestoreAfterFocusLost:1; ///< Whether the keyboard needs to be restored (activated ) after focus regained. bool mIdleCallbackConnected:1; ///< Whether the idle callback is already connected. InputMethodOptions mOptions; - Dali::InputMethodContext::PreeditStyle mPreeditStyle; + Vector< Dali::InputMethodContext::PreeditAttributeData > mPreeditAttrs; ///< Stores preedit attr data ActivatedSignalType mActivatedSignal; KeyboardEventSignalType mEventSignal; @@ -128,8 +128,7 @@ InputMethodContext::InputMethodContext( /*Ecore_X_Window ecoreXwin*/ ) : mIMFCursorPosition( 0 ), mSurroundingText(), mRestoreAfterFocusLost( false ), - mIdleCallbackConnected( false ), - mPreeditStyle( Dali::InputMethodContext::PreeditStyle::NONE ) + mIdleCallbackConnected( false ) { CreateContext( /*ecoreXwin*/ ); ConnectCallbacks(); @@ -219,12 +218,14 @@ bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent ) void InputMethodContext::SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type ) { - mPreeditStyle = type; + Dali::InputMethodContext::PreeditAttributeData data; + data.preeditType = type; + mPreeditAttrs.PushBack( data ); } -Dali::InputMethodContext::PreeditStyle InputMethodContext::GetPreeditStyle() const +void InputMethodContext::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttributeData >& attrs ) const { - return mPreeditStyle; + attrs = mPreeditAttrs; } } // Adaptor @@ -327,9 +328,9 @@ void InputMethodContext::SetPreeditStyle( Dali::InputMethodContext::PreeditStyle Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetPreeditStyle( type ); } -Dali::InputMethodContext::PreeditStyle InputMethodContext::GetPreeditStyle() const +void InputMethodContext::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttributeData >& attrs ) const { - return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle(); + Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle( attrs ); } // Signals diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h index a56ea81..395ad4d 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h @@ -102,10 +102,24 @@ public: */ enum class PreeditStyle { - NONE, ///< None style - UNDERLINE, ///< Underline substring style - REVERSE, ///< Reverse substring style - HIGHLIGHT ///< Highlight substring style + NONE, ///< None style + UNDERLINE, ///< Underline substring style + REVERSE, ///< Reverse substring style + HIGHLIGHT, ///< Highlight substring style + CUSTOM_PLATFORM_STYLE_1, ///< Custom style for platform + CUSTOM_PLATFORM_STYLE_2, ///< Custom style for platform + CUSTOM_PLATFORM_STYLE_3, ///< Custom style for platform + CUSTOM_PLATFORM_STYLE_4 ///< Custom style for platform + }; + + /** + * @brief This structure is for the preedit style types and indices. + */ + struct PreeditAttributeData + { + PreeditStyle preeditType; /// The preedit style type + unsigned int startIndex; /// The start index of preedit + unsigned int endIndex; /// The end index of preedit }; /** @@ -309,11 +323,11 @@ public: void SetPreeditStyle( PreeditStyle type ); /** - * @brief Gets the preedit type. + * @brief Gets the preedit attrs data. * - * @return The preedit style type + * @param[out] attrs The preedit attrs data. */ - PreeditStyle GetPreeditStyle() const; + void GetPreeditStyle( Vector& attrs ) const; public: diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp index b79213d..957681e 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp @@ -93,6 +93,11 @@ public: mDisplyMode = mode; } + Any GetMediaPlayer() + { + return NULL; + } + public: @@ -288,5 +293,10 @@ Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const return Internal::Adaptor::GetImplementation( *this ).GetDisplayMode(); } +Any VideoPlayer::GetMediaPlayer() +{ + return Internal::Adaptor::GetImplementation( *this ).GetMediaPlayer(); +} + } // namespace Dali; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp index 1fe89ea..069a644 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp @@ -413,7 +413,7 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); value = map.Find( DevelImageVisual::Property::PLAY_STATE ); - DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PAUSED ); + DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED ); tet_infoline( "On stage again" ); Stage::GetCurrent().Add( dummyControl ); @@ -423,7 +423,7 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); value = map.Find( DevelImageVisual::Property::PLAY_STATE ); - DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PAUSED ); + DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED ); tet_infoline( "Test Play action" ); DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 881fdde..7e050ff 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -102,6 +102,7 @@ const char* const PROPERTY_NAME_ENABLE_SHIFT_SELECTION = "enableSh const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE = "enableGrabHandle"; const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection"; const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup"; +const char* const PROPERTY_NAME_BACKGROUND = "textBackground"; const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f ); const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color. @@ -470,6 +471,7 @@ int UtcDaliTextFieldGetPropertyP(void) DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextField::Property::ENABLE_GRAB_HANDLE ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP ); + DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextField::Property::BACKGROUND ); END_TEST; } @@ -929,6 +931,10 @@ int UtcDaliTextFieldSetPropertyP(void) field.SetProperty( DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP, false ); DALI_TEST_CHECK( !field.GetProperty( DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP ) ); + // Check the background property + field.SetProperty( DevelTextField::Property::BACKGROUND, Color::RED ); + DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::BACKGROUND ), Color::RED, TEST_LOCATION ); + application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp index 03da3ff..a38ec18 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp @@ -20,6 +20,7 @@ #include #include #include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -301,6 +302,9 @@ int UtcDaliVideoViewMethodsForCoverage(void) videoView.Stop(); videoView.Forward(10); videoView.Backward(10); + + Toolkit::DevelVideoView::GetMediaPlayer( videoView ); + VideoView::VideoViewSignalType& signal = videoView.FinishedSignal(); DALI_TEST_EQUALS( 0, signal.GetConnectionCount(), TEST_LOCATION ); diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 07344eb..1b1d202 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -13,12 +13,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() -FIND_PACKAGE( PkgConfig REQUIRED ) -FIND_PACKAGE( Doxygen QUIET ) - -PKG_CHECK_MODULES(DALICORE REQUIRED dali-core) -PKG_CHECK_MODULES(DALIADAPTOR REQUIRED dali-adaptor) - # API VERSION (Not DALi release version) SET(${name}_VERSION_MAJOR 0) SET(${name}_VERSION_MINOR 0) @@ -28,11 +22,33 @@ SET(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_ SET(DALI_TOOLKIT_VERSION ${${name}_VERSION} ) # Define options to CMake -OPTION(ENABLE_EXPORTALL "Enable Export all symbols" OFF) -OPTION(ENABLE_DEBUG "Enable Debug" OFF) -OPTION(ENABLE_TRACE "Enable Trace" OFF) -OPTION(ENABLE_I18N "Turns on internationalisation" OFF) -OPTION(ENABLE_COVERAGE "Coverage" OFF) +OPTION(ENABLE_EXPORTALL "Enable Export all symbols" OFF) +OPTION(ENABLE_DEBUG "Enable Debug" OFF) +OPTION(ENABLE_TRACE "Enable Trace" OFF) +OPTION(ENABLE_I18N "Turns on internationalisation" OFF) +OPTION(ENABLE_COVERAGE "Coverage" OFF) +OPTION(ENABLE_PKG_CONFIGURE "Use pkgconfig" ON) +OPTION(ENABLE_LINK_TEST "Enable the link test" ON) +OPTION(INSTALL_DOXYGEN_DOC "Install doxygen doc" ON) +OPTION(CONFIGURE_AUTOMATED_TESTS "Configure automated tests" ON) + +IF( ENABLE_PKG_CONFIGURE ) + FIND_PACKAGE( PkgConfig REQUIRED ) + + PKG_CHECK_MODULES(DALICORE REQUIRED dali-core) + PKG_CHECK_MODULES(DALIADAPTOR REQUIRED dali-adaptor) +ENDIF() + +IF( INSTALL_DOXYGEN_DOC ) + FIND_PACKAGE( Doxygen QUIET ) +ENDIF() + +IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc. + FIND_PACKAGE( dali-windows-dependencies REQUIRED) + FIND_PACKAGE( dali-core REQUIRED) + FIND_PACKAGE( dali-adaptor REQUIRED) + FIND_PATH( SYSTEM_INCLUDE_DIR "dali-windows-dependencies.h" ) +ENDIF() # Define non-boolean options to CMake SET(WITH_STYLE "480x800" CACHE STRING "Select the style folder to use") @@ -74,30 +90,43 @@ ELSE() MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Release ) ENDIF() -ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS) -ADD_DEFINITIONS(-DDALI_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/images/\" - -DDALI_SOUND_DIR=\"${dataReadOnlyDir}/toolkit/sounds/\" - -DDALI_STYLE_DIR=\"${dataReadOnlyDir}/toolkit/styles/\" - -DDALI_STYLE_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/styles/images/\" - -DDALI_DATA_READ_ONLY_DIR=\"${dataReadOnlyDir}\" ) - -IF("${ARCH}" STREQUAL "arm") - ADD_DEFINITIONS("-DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") - IF( ENABLE_DEBUG ) ADD_DEFINITIONS( "-DDEBUG_ENABLED" ) SET( ENABLE_EXPORTALL ON ) ENDIF( ENABLE_DEBUG ) -IF( NOT ${ENABLE_EXPORTALL} ) - ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" ) -ENDIF( NOT ${ENABLE_EXPORTALL} ) - IF( ENABLE_I18N ) ADD_DEFINITIONS( "-DDGETTEXT_ENABLED" ) ENDIF( ENABLE_I18N ) +IF( SET_VCPKG_INSTALL_PREFIX ) + ADD_DEFINITIONS( "-DBUILDING_DALI_TOOLKIT" ) + ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/images/\" + -DDALI_SOUND_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/sounds/\" + -DDALI_STYLE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/styles/\" + -DDALI_STYLE_IMAGE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/styles/images/\" + -DDALI_DATA_READ_ONLY_DIR=\"${VCPKG_INSTALLED_DIR}/share/\" ) +ELSE() + ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS) + ADD_DEFINITIONS(-DDALI_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/images/\" + -DDALI_SOUND_DIR=\"${dataReadOnlyDir}/toolkit/sounds/\" + -DDALI_STYLE_DIR=\"${dataReadOnlyDir}/toolkit/styles/\" + -DDALI_STYLE_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/styles/images/\" + -DDALI_DATA_READ_ONLY_DIR=\"${dataReadOnlyDir}\" ) + + IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") + ENDIF("${ARCH}" STREQUAL "arm") + + IF( NOT ${ENABLE_EXPORTALL} ) + ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" ) + ENDIF( NOT ${ENABLE_EXPORTALL} ) +ENDIF() + +IF( ENABLE_TRACE ) + ADD_DEFINITIONS("-DTRACE_ENABLED") +ENDIF() + # Platforms with highp shader support can use vector based text IF( "${PROFILE}" STREQUAL "UBUNTU" ) SET( ENABLE_VECTOR_BASED_TEXT_RENDERING 1 ) @@ -126,44 +155,54 @@ IF( NOT INCLUDE_DIR ) ENDIF() # Set up the lib dir -SET( LIB_DIR $ENV{libdir} ) -IF( NOT LIB_DIR ) - SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} ) -ENDIF() -IF( NOT LIB_DIR ) +IF( SET_VCPKG_INSTALL_PREFIX ) SET( LIB_DIR ${PREFIX}/lib ) + SET( BIN_DIR ${PREFIX}/bin ) +ELSE() + SET( LIB_DIR $ENV{libdir} ) + IF( NOT LIB_DIR ) + SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} ) + ENDIF() + IF( NOT LIB_DIR ) + SET( LIB_DIR ${PREFIX}/lib ) + ENDIF() ENDIF() -# Configure the pkg-config file -# Requires the following variables to be setup: -# @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@ -SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} ) -SET( CORE_PKG_CFG_FILE dali-toolkit.pc ) -CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY ) - -# Set up compiler flags and warnings -ADD_COMPILE_OPTIONS( -std=c++11 ) -ADD_COMPILE_OPTIONS( -Wno-ignored-qualifiers ) - -# TODO: Clang is a lot more strict with warnings, we should address -# those issues at some point. -IF( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) - ADD_COMPILE_OPTIONS( -Werror ) +IF( ENABLE_PKG_CONFIGURE ) + # Configure the pkg-config file + # Requires the following variables to be setup: + # @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@ + SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} ) + SET( CORE_PKG_CFG_FILE dali-toolkit.pc ) + CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY ) ENDIF() -ADD_COMPILE_OPTIONS( -Wall -Wno-unused-parameter -Wno-float-equal -Wno-class-memaccess ) - -IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage ) - ADD_COMPILE_OPTIONS( --coverage ) - SET(ENABLE_COVERAGE ON) - SET(COVERAGE --coverage) +IF( WIN32 ) + ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions. + ADD_COMPILE_OPTIONS( /vmg ) # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks. +ELSE() + # Set up compiler flags and warnings + ADD_COMPILE_OPTIONS( -std=c++11 ) + ADD_COMPILE_OPTIONS( -Wno-ignored-qualifiers ) + + # TODO: Clang is a lot more strict with warnings, we should address + # those issues at some point. + IF( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) + ADD_COMPILE_OPTIONS( -Werror ) + ENDIF() + + ADD_COMPILE_OPTIONS( -Wall -Wno-unused-parameter -Wno-float-equal -Wno-class-memaccess ) + + IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage ) + ADD_COMPILE_OPTIONS( --coverage ) + SET(ENABLE_COVERAGE ON) + SET(COVERAGE --coverage) + ENDIF() ENDIF() -IF( ENABLE_TRACE ) - ADD_DEFINITIONS("-DTRACE_ENABLED") -ENDIF() INCLUDE_DIRECTORIES( + ${SYSTEM_INCLUDE_DIR} ${ROOT_SRC_DIR} ${DALICORE_INCLUDE_DIRS} ${DALIADAPTOR_INCLUDE_DIRS} @@ -190,14 +229,44 @@ IF(DEFINED STATIC) SET(LIBTYPE STATIC) ENDIF() +IF( WIN32 ) + SET( DALICORE_LDFLAGS + "${DALICORE_LDFLAGS}" + dali-core::dali-core ) + + FIND_PACKAGE( pthreads REQUIRED ) + FIND_PACKAGE( curl REQUIRED ) + FIND_LIBRARY( GETOPT_LIBRARY NAMES getopt ) + FIND_LIBRARY( EXIF_LIBRARY NAMES libexif ) + + FIND_PACKAGE( png REQUIRED ) + FIND_PACKAGE( gif REQUIRED ) + FIND_PACKAGE( jpeg REQUIRED ) + FIND_LIBRARY( TURBO_JPEG_LIBRARY NAMES turbojpeg ) + + FIND_PACKAGE( fontconfig REQUIRED ) + FIND_PACKAGE( freetype REQUIRED ) + FIND_PACKAGE( harfbuzz REQUIRED ) + FIND_LIBRARY( FRIBIDI_LIBRARY NAMES fribidi ) + + FIND_PACKAGE( unofficial-angle REQUIRED ) + FIND_PACKAGE( unofficial-cairo REQUIRED ) + + SET( DALIADAPTOR_LDFLAGS + "${DALIADAPTOR_LDFLAGS}" + dali-adaptor::dali-adaptor ) +ENDIF() + + ADD_LIBRARY( ${name} ${LIBTYPE} ${SOURCES} ) TARGET_LINK_LIBRARIES( ${name} ${DALICORE_LDFLAGS} ${DALIADAPTOR_LDFLAGS} ${COVERAGE} ) + IF( ANDROID ) -TARGET_LINK_LIBRARIES( ${name} log ) + TARGET_LINK_LIBRARIES( ${name} log ) ENDIF() SET_TARGET_PROPERTIES( ${name} @@ -208,10 +277,34 @@ SET_TARGET_PROPERTIES( ${name} ) # Install the library so file and symlinks -INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} ) +IF( INSTALL_CMAKE_MODULES ) + INSTALL( TARGETS ${name} + EXPORT ${name}-targets + LIBRARY DESTINATION ${LIB_DIR} + ARCHIVE DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) + + INSTALL( + EXPORT ${name}-targets + NAMESPACE ${name}:: + FILE ${name}-targets.cmake + DESTINATION share/${name} + ) + + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake " + include(CMakeFindDependencyMacro) + include(\${CMAKE_CURRENT_LIST_DIR}/${name}-targets.cmake) + ") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake DESTINATION share/${name}) +ELSE() + INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} ) +ENDIF() # Install the pkg-config file -INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig ) +IF( ENABLE_PKG_CONFIGURE ) + INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig ) +ENDIF() # Glob for resources MACRO( COPY_RESOURCES FILE_LIST SRC_RELATIVE_DIRECTORY DESTINATION EXPLICIT_DESTINATION ) @@ -248,7 +341,7 @@ INSTALL_HEADERS_WITH_DIRECTORY(INTEGRATION_API_HEADERS ${ROOT_SRC_DIR}/dali-tool INSTALL_HEADERS_WITH_DIRECTORY(PACKAGE_DOXY_HEADERS ${PACKAGE_DOXY_SRC_DIR} "dali-toolkit/doc" ) # Install dali-toolkit.h -INSTALL( FILES ${ROOT_SRC_DIR}/dali-toolkit/dali-toolkit.h DESTINATION ${DEV_INCLUDE_PATH}/dali-toolkit ) +INSTALL( FILES ${ROOT_SRC_DIR}/dali-toolkit/dali-toolkit.h DESTINATION ${INCLUDE_DIR}/dali-toolkit ) # package doxygen file (contains doxygen grouping information) INSTALL( FILES ${package_doxy_files} DESTINATION ${DEV_INCLUDE_PATH}/dali-toolkit/doc ) @@ -277,7 +370,7 @@ COPY_RESOURCES( "${dali_toolkit_style_images}" "${ROOT_SRC_DIR}" "${dataReadOnly # The DALI_TOOLKIT_PREFIX must be set if this CMakeLists.txt is executed # from the top-level CMake script using ADD_SUBDIRECTORY() to avoid # target names duplication with other DALi modules. -IF( UNIX ) +IF( ENABLE_COVERAGE ) FIND_PROGRAM( LCOV_BIN "lcov" ) IF( LCOV_BIN ) @@ -337,7 +430,7 @@ IF( UNIX ) ) ENDIF( LCOV_BIN ) -ENDIF( UNIX ) +ENDIF() # Build documentation if doxygen tool is available SET( doxygenEnabled OFF ) @@ -367,9 +460,11 @@ IF( DOXYGEN_FOUND ) ENDIF() -# Configure automated tests -CONFIGURE_FILE( ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt.in - ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt @ONLY ) +IF( CONFIGURE_AUTOMATED_TESTS ) + # Configure automated tests + CONFIGURE_FILE( ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt.in + ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt @ONLY ) +ENDIF() # Configuration Messages MESSAGE( STATUS "Configuration:\n" ) @@ -388,5 +483,8 @@ MESSAGE( STATUS "Data Install Dir (Read Only): " ${dataReadOnlyInstallDir} ) MESSAGE( STATUS "Style Dir: " ${STYLE_DIR} ) MESSAGE( STATUS "Style: " ${dali_style} ) MESSAGE( STATUS "i18n: " ${ENABLE_I18N} ) +MESSAGE( STATUS "Use pkg configure: " ${ENABLE_PKG_CONFIGURE} ) +MESSAGE( STATUS "Enable link test: " ${ENABLE_LINK_TEST} ) +MESSAGE( STATUS "Configure automated tests: " ${CONFIGURE_AUTOMATED_TESTS} ) MESSAGE( STATUS "CXXFLAGS: " ${CMAKE_CXX_FLAGS} ) MESSAGE( STATUS "LDFLAGS: " ${CMAKE_SHARED_LINKER_FLAGS_INIT}${CMAKE_SHARED_LINKER_FLAGS} ) diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h index 5e92a92..3a4864c 100755 --- a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h @@ -114,7 +114,15 @@ namespace Property * @details Name "enableGrabHandlePopup", type Property::BOOLEAN. * @note The default value is true, which means the grab handle popup is enabled by default. */ - ENABLE_GRAB_HANDLE_POPUP = ELLIPSIS + 4 + ENABLE_GRAB_HANDLE_POPUP = ELLIPSIS + 4, + + /** + * @brief The default text background parameters. + * @details Name "textBackground", type Property::VECTOR4. + * @note Use "textBackground" as property name to avoid conflict with Control's "background" property. + * @note The default value is Color::TRANSPARENT. + */ + BACKGROUND = ELLIPSIS + 5 }; } // namespace Property diff --git a/dali-toolkit/devel-api/controls/video-view/video-view-devel.cpp b/dali-toolkit/devel-api/controls/video-view/video-view-devel.cpp new file mode 100755 index 0000000..317d34d --- /dev/null +++ b/dali-toolkit/devel-api/controls/video-view/video-view-devel.cpp @@ -0,0 +1,41 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelVideoView +{ + +Any GetMediaPlayer( VideoView videoView ) +{ + return Dali::Toolkit::GetImpl( videoView ).GetMediaPlayer(); +} + + +} // namespace DevelVideoView + +} // namespace Toolkit + +} // namespace Dali diff --git a/dali-toolkit/devel-api/controls/video-view/video-view-devel.h b/dali-toolkit/devel-api/controls/video-view/video-view-devel.h new file mode 100755 index 0000000..b121506 --- /dev/null +++ b/dali-toolkit/devel-api/controls/video-view/video-view-devel.h @@ -0,0 +1,49 @@ +#ifndef DALI_TOOLKIT_VIDEO_VIEW_DEVEL_H +#define DALI_TOOLKIT_VIDEO_VIEW_DEVEL_H + +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelVideoView +{ + + +/** + * @brief Returns the internal media player. + * @param[in] videoView The current VideoView + * @return The internal media player of current VideoView + */ +DALI_TOOLKIT_API Any GetMediaPlayer( VideoView videoView ); + + +} // namespace DevelVideoView + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_VIDEO_VIEW_DEVEL_H diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list old mode 100644 new mode 100755 index 41fae57..fad069b --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -29,6 +29,7 @@ SET( devel_api_src_files ${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp ${devel_api_src_dir}/controls/text-controls/text-selection-toolbar.cpp ${devel_api_src_dir}/controls/tool-bar/tool-bar.cpp + ${devel_api_src_dir}/controls/video-view/video-view-devel.cpp ${devel_api_src_dir}/controls/web-view/web-view.cpp ${devel_api_src_dir}/focus-manager/keyinput-focus-manager.cpp ${devel_api_src_dir}/focus-manager/keyboard-focus-manager-devel.cpp @@ -202,6 +203,10 @@ SET( devel_api_gaussian_blur_view_header_files ${devel_api_src_dir}/controls/gaussian-blur-view/gaussian-blur-view.h ) +SET( devel_api_video_view_header_files + ${devel_api_src_dir}/controls/video-view/video-view-devel.h +) + SET( devel_api_web_view_header_files ${devel_api_src_dir}/controls/web-view/web-view.h ) @@ -242,6 +247,7 @@ SET( DEVEL_API_HEADERS ${DEVEL_API_HEADERS} ${devel_api_tooltip_header_files} ${devel_api_transition_effects_header_files} ${devel_api_gaussian_blur_view_header_files} + ${devel_api_video_view_header_files} ${devel_api_web_view_header_files} ${devel_api_drag_and_drop_detector_header_files} ) diff --git a/dali-toolkit/internal/builder/builder-filesystem.h b/dali-toolkit/internal/builder/builder-filesystem.h index 90a87fc..2222d1b 100755 --- a/dali-toolkit/internal/builder/builder-filesystem.h +++ b/dali-toolkit/internal/builder/builder-filesystem.h @@ -24,7 +24,6 @@ #include #include -#include #include diff --git a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp index 485cd59..1488f5e 100755 --- a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp +++ b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp @@ -38,7 +38,7 @@ namespace // currently not called from code so compiler will optimize these away, kept here for future debugging #define FLEX_CONTAINER_TAG "DALI Toolkit::FlexContainer " -#define FC_LOG(fmt, args...) Debug::LogMessage(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ## args) +#define FC_LOG(fmt, args,...) Debug::LogMessage(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ## args) // #define FLEX_CONTAINER_DEBUG 1 #if defined(FLEX_CONTAINER_DEBUG) diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp index abb9eea..b4e81c7 100755 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp @@ -48,7 +48,7 @@ bool FitToChild( Actor actor, Dimension::Type dimension ) // currently not called from code so compiler will optimize these away, kept here for future debugging #define TABLEVIEW_TAG "DALI Toolkit::TableView " -#define TV_LOG(fmt, args...) Debug::LogMessage(Debug::DebugInfo, TABLEVIEW_TAG fmt, ## args) +#define TV_LOG(fmt, args,...) Debug::LogMessage(Debug::DebugInfo, TABLEVIEW_TAG fmt, ## args) //#define TABLEVIEW_DEBUG 1 #if defined(TABLEVIEW_DEBUG) 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 6a1f1c9..e9d1fe4 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -134,6 +134,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableShiftSelection", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandle", BOOLEAN, ENABLE_GRAB_HANDLE ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "textBackground", VECTOR4, BACKGROUND ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED ) @@ -767,7 +768,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr } case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP: { - if (impl.mController) + if( impl.mController ) { const bool grabHandlePopupEnabled = value.Get(); DALI_LOG_INFO(gLogFilter, Debug::General, "TextField %p ENABLE_GRAB_HANDLE_POPUP %d\n", impl.mController.Get(), grabHandlePopupEnabled); @@ -776,6 +777,18 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr break; } } + case Toolkit::DevelTextField::Property::BACKGROUND: + { + if( impl.mController ) + { + const Vector4 backgroundColor = value.Get< Vector4 >(); + DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p BACKGROUND %f,%f,%f,%f\n", impl.mController.Get(), backgroundColor.r, backgroundColor.g, backgroundColor.b, backgroundColor.a ); + + impl.mController->SetBackgroundEnabled( true ); + impl.mController->SetBackgroundColor( backgroundColor ); + } + break; + } } // switch } // textfield } @@ -1185,12 +1198,20 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP: { - if (impl.mController) + if( impl.mController ) { value = impl.mController->IsGrabHandlePopupEnabled(); } break; } + case Toolkit::DevelTextField::Property::BACKGROUND: + { + if( impl.mController ) + { + value = impl.mController->GetBackgroundColor(); + } + break; + } } //switch } diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp index 7fcab03..8c34ab5 100755 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp @@ -808,6 +808,11 @@ int VideoView::GetDisplayMode() const return static_cast< int >( mVideoPlayer.GetDisplayMode() ); } +Any VideoView::GetMediaPlayer() +{ + return mVideoPlayer.GetMediaPlayer(); +} + Dali::Shader VideoView::CreateShader() { std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n"; diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.h b/dali-toolkit/internal/controls/video-view/video-view-impl.h index ca8a2f8..3d345a3 100755 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.h +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.h @@ -251,6 +251,11 @@ public: */ int GetDisplayMode() const; + /** + * @brief Gets internal media player. + */ + Any GetMediaPlayer(); + private: // From Control /** diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index fa48e52..c39d5e8 100755 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -98,6 +98,12 @@ struct BackgroundMesh Vector< unsigned short > mIndices; ///< container of indices }; +const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); +const Dali::Vector4 BACKGROUND_SUB4( 0.58f, 0.87f, 0.96f, 1.f ); +const Dali::Vector4 BACKGROUND_SUB5( 0.83f, 0.94f, 0.98f, 1.f ); +const Dali::Vector4 BACKGROUND_SUB6( 1.f, 0.5f, 0.5f, 1.f ); +const Dali::Vector4 BACKGROUND_SUB7( 1.f, 0.8f, 0.8f, 1.f ); + } // namespace namespace Dali @@ -1080,35 +1086,130 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired ) mEventData->mPreEditFlag && ( 0u != mModel->mVisualModel->mCharactersToGlyph.Count() ) ) { - Dali::InputMethodContext::PreeditStyle type = mEventData->mInputMethodContext.GetPreeditStyle(); + Vector< Dali::InputMethodContext::PreeditAttributeData > attrs; + mEventData->mInputMethodContext.GetPreeditStyle( attrs ); + Dali::InputMethodContext::PreeditStyle type = Dali::InputMethodContext::PreeditStyle::NONE; - switch( type ) + // Check the type of preedit and run it. + for( Vector::Iterator it = attrs.Begin(), endIt = attrs.End(); it != endIt; it++ ) { - case Dali::InputMethodContext::PreeditStyle::UNDERLINE: - { - // Add the underline for the pre-edit text. - const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin(); - const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin(); + Dali::InputMethodContext::PreeditAttributeData attrData = *it; + DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::UpdateModel PreeditStyle type : %d start %d end %d \n", attrData.preeditType, attrData.startIndex, attrData.endIndex ); + type = attrData.preeditType; - const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition ); - const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u ); - const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter ); - const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u ); + // Check the number of commit characters for the start position. + unsigned int numberOfCommit = mEventData->mPrimaryCursorPosition - mEventData->mPreEditLength; + Length numberOfIndices = attrData.endIndex - attrData.startIndex; - GlyphRun underlineRun; - underlineRun.glyphIndex = glyphStart; - underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart; - - mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); - break; + switch( type ) + { + case Dali::InputMethodContext::PreeditStyle::UNDERLINE: + { + // Add the underline for the pre-edit text. + GlyphRun underlineRun; + underlineRun.glyphIndex = attrData.startIndex + numberOfCommit; + underlineRun.numberOfGlyphs = attrData.endIndex - attrData.startIndex; + mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::REVERSE: + { + Vector4 textColor = mModel->mVisualModel->GetTextColor(); + ColorRun backgroundColorRun; + backgroundColorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + backgroundColorRun.characterRun.numberOfCharacters = numberOfIndices; + backgroundColorRun.color = textColor; + mModel->mLogicalModel->mBackgroundColorRuns.PushBack( backgroundColorRun ); + + Vector4 backgroundColor = mModel->mVisualModel->GetBackgroundColor(); + Vector colorRuns; + colorRuns.Resize( 1u ); + ColorRun& colorRun = *( colorRuns.Begin() ); + colorRun.color = backgroundColor; + colorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + colorRun.characterRun.numberOfCharacters = numberOfIndices; + + mModel->mLogicalModel->mColorRuns.PushBack( colorRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::HIGHLIGHT: + { + ColorRun backgroundColorRun; + backgroundColorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + backgroundColorRun.characterRun.numberOfCharacters = numberOfIndices; + backgroundColorRun.color = LIGHT_BLUE; + mModel->mLogicalModel->mBackgroundColorRuns.PushBack( backgroundColorRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_1: + { + // CUSTOM_PLATFORM_STYLE_1 should be drawn with background and underline together. + ColorRun backgroundColorRun; + backgroundColorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + backgroundColorRun.characterRun.numberOfCharacters = numberOfIndices; + backgroundColorRun.color = BACKGROUND_SUB4; + mModel->mLogicalModel->mBackgroundColorRuns.PushBack( backgroundColorRun ); + + GlyphRun underlineRun; + underlineRun.glyphIndex = attrData.startIndex + numberOfCommit; + underlineRun.numberOfGlyphs = attrData.endIndex - attrData.startIndex; + mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_2: + { + // CUSTOM_PLATFORM_STYLE_2 should be drawn with background and underline together. + ColorRun backgroundColorRun; + backgroundColorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + backgroundColorRun.characterRun.numberOfCharacters = numberOfIndices; + backgroundColorRun.color = BACKGROUND_SUB5; + mModel->mLogicalModel->mBackgroundColorRuns.PushBack( backgroundColorRun ); + + GlyphRun underlineRun; + underlineRun.glyphIndex = attrData.startIndex + numberOfCommit; + underlineRun.numberOfGlyphs = attrData.endIndex - attrData.startIndex; + mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_3: + { + // CUSTOM_PLATFORM_STYLE_3 should be drawn with background and underline together. + ColorRun backgroundColorRun; + backgroundColorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + backgroundColorRun.characterRun.numberOfCharacters = numberOfIndices; + backgroundColorRun.color = BACKGROUND_SUB6; + mModel->mLogicalModel->mBackgroundColorRuns.PushBack( backgroundColorRun ); + + GlyphRun underlineRun; + underlineRun.glyphIndex = attrData.startIndex + numberOfCommit; + underlineRun.numberOfGlyphs = attrData.endIndex - attrData.startIndex; + mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_4: + { + // CUSTOM_PLATFORM_STYLE_4 should be drawn with background and underline together. + ColorRun backgroundColorRun; + backgroundColorRun.characterRun.characterIndex = attrData.startIndex + numberOfCommit; + backgroundColorRun.characterRun.numberOfCharacters = numberOfIndices; + backgroundColorRun.color = BACKGROUND_SUB7; + mModel->mLogicalModel->mBackgroundColorRuns.PushBack( backgroundColorRun ); + + GlyphRun underlineRun; + underlineRun.glyphIndex = attrData.startIndex + numberOfCommit; + underlineRun.numberOfGlyphs = attrData.endIndex - attrData.startIndex; + mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun ); + break; + } + case Dali::InputMethodContext::PreeditStyle::NONE: + default: + { + break; + } } - // TODO : At this moment, other styles for preedit are not implemented yet. - case Dali::InputMethodContext::PreeditStyle::REVERSE: - case Dali::InputMethodContext::PreeditStyle::HIGHLIGHT: - case Dali::InputMethodContext::PreeditStyle::NONE: - default: - break; } + attrs.Clear(); + updated = true; } if( NO_OPERATION != ( COLOR & operations ) ) @@ -3165,6 +3266,7 @@ Actor Controller::Impl::CreateBackgroundActor() const Vector4* const backgroundColorsBuffer = mView.GetBackgroundColors(); const ColorIndex* const backgroundColorIndicesBuffer = mView.GetBackgroundColorIndices(); + const Vector4& defaultBackgroundColor = mModel->mVisualModel->IsBackgroundEnabled() ? mModel->mVisualModel->GetBackgroundColor() : Color::TRANSPARENT; Vector4 quad; uint32_t numberOfQuads = 0u; @@ -3176,7 +3278,7 @@ Actor Controller::Impl::CreateBackgroundActor() // Get the background color of the character. // The color index zero is reserved for the default background color (i.e. Color::TRANSPARENT) const ColorIndex backgroundColorIndex = ( nullptr == backgroundColorsBuffer ) ? 0u : *( backgroundColorIndicesBuffer + i ); - const Vector4& backgroundColor = ( 0u == backgroundColorIndex ) ? Color::TRANSPARENT : *( backgroundColorsBuffer + backgroundColorIndex - 1u ); + const Vector4& backgroundColor = ( 0u == backgroundColorIndex ) ? defaultBackgroundColor : *( backgroundColorsBuffer + backgroundColorIndex - 1u ); // Only create quads for glyphs with a background color if ( backgroundColor != Color::TRANSPARENT ) diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 0b0e9cf..0407147 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -3714,11 +3714,7 @@ bool Controller::RemoveText( int cursorOffset, // it means all texts should be removed and all Preedit variables should be initialized. if( ( currentText.Count() - numberOfCharacters == 0 ) && ( cursorIndex == 0 ) ) { - if( mImpl->mEventData ) - { - mImpl->mEventData->mPreEditStartPosition = 0; - mImpl->mEventData->mPreEditLength = 0; - } + mImpl->ClearPreEditFlag(); } // Updates the text style runs by removing characters. Runs with no characters are removed. diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index 3b1f5b7..6a06e58 100755 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -469,7 +469,7 @@ VisualModel::VisualModel() mShadowColor( Color::BLACK ), mUnderlineColor( Color::BLACK ), mOutlineColor( Color::WHITE ), - mBackgroundColor( Color::CYAN ), + mBackgroundColor( Color::TRANSPARENT ), mControlSize(), mShadowOffset(), mUnderlineHeight( 0.0f ), diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp index d4de346..2ed0502 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp @@ -307,7 +307,7 @@ void AnimatedVectorImageVisual::DoSetOnStage( Actor& actor ) void AnimatedVectorImageVisual::DoSetOffStage( Actor& actor ) { - PauseAnimation(); + StopAnimation(); if( mImpl->mRenderer ) { @@ -535,13 +535,13 @@ void AnimatedVectorImageVisual::SetVectorImageSize() } } -void AnimatedVectorImageVisual::PauseAnimation() +void AnimatedVectorImageVisual::StopAnimation() { - if( mActionStatus == DevelAnimatedVectorImageVisual::Action::PLAY ) + if( mActionStatus != DevelAnimatedVectorImageVisual::Action::STOP ) { - mVectorAnimationTask->PauseAnimation(); + mVectorAnimationTask->StopAnimation(); - mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE; + mActionStatus = DevelAnimatedVectorImageVisual::Action::STOP; if( mImpl->mRenderer ) { @@ -584,7 +584,7 @@ void AnimatedVectorImageVisual::OnControlVisibilityChanged( Actor actor, bool vi { if( !visible ) { - PauseAnimation(); + StopAnimation(); DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnControlVisibilityChanged: invisibile. Pause animation [%p]\n", this ); } @@ -594,7 +594,7 @@ void AnimatedVectorImageVisual::OnWindowVisibilityChanged( Window window, bool v { if( !visible ) { - PauseAnimation(); + StopAnimation(); DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnWindowVisibilityChanged: invisibile. Pause animation [%p]\n", this ); } diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h index 0ff2cdd..8aaed9c 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h @@ -168,9 +168,9 @@ private: void SetVectorImageSize(); /** - * @brief Pause the animation. + * @brief Stop the animation. */ - void PauseAnimation(); + void StopAnimation(); /** * @brief Callback when the world scale factor changes. diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 7ecfb81..f656e2d 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -425,7 +425,6 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v if( value.Get( alphaUrl ) ) { AllocateMaskData(); - // Immediately trigger the alpha mask loading (it may just get a cached value) mMaskingData->mAlphaMaskUrl = alphaUrl; } break; diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index fbb8114..a2381e8 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -146,7 +146,7 @@ TextureManager::~TextureManager() TextureSet TextureManager::LoadTexture( const VisualUrl& url, Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode, - Dali::SamplingMode::Type samplingMode, const MaskingDataPointer& maskInfo, + Dali::SamplingMode::Type samplingMode, MaskingDataPointer& maskInfo, bool synchronousLoading, TextureManager::TextureId& textureId, Vector4& textureRect, Dali::ImageDimensions& textureRectSize, bool& atlasingStatus, bool& loadingStatus, Dali::WrapMode::Type wrapModeU, Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver, @@ -252,9 +252,9 @@ TextureSet TextureManager::LoadTexture( } else { - TextureId alphaMaskId = RequestMaskLoad( maskInfo->mAlphaMaskUrl ); + maskInfo->mAlphaMaskId = RequestMaskLoad( maskInfo->mAlphaMaskUrl ); textureId = RequestLoad( url, - alphaMaskId, + maskInfo->mAlphaMaskId, maskInfo->mContentScaleFactor, desiredSize, fittingMode, samplingMode, diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.h b/dali-toolkit/internal/visuals/texture-manager-impl.h index b782517..651bc44 100755 --- a/dali-toolkit/internal/visuals/texture-manager-impl.h +++ b/dali-toolkit/internal/visuals/texture-manager-impl.h @@ -174,7 +174,7 @@ public: * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic * @param[in] fittingMode The FittingMode to use * @param[in] samplingMode The SamplingMode to use - * @param[in] maskInfo Mask info structure + * @param[in, out] maskInfo Mask info structure * @param[in] synchronousLoading true if the URL should be loaded synchronously * @param[out] textureId, The textureId of the URL * @param[out] textureRect The rectangle within the texture atlas that this URL occupies, @@ -204,7 +204,7 @@ public: Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode, - const MaskingDataPointer& maskInfo, + MaskingDataPointer& maskInfo, bool synchronousLoading, TextureManager::TextureId& textureId, Vector4& textureRect, diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index 2866a77..81c37e0 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 = 4; -const unsigned int TOOLKIT_MICRO_VERSION = 54; +const unsigned int TOOLKIT_MICRO_VERSION = 55; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 8a0508c..ce1fa3e 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.4.54 +Version: 1.4.55 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT