From: Adeel Kazmi Date: Fri, 27 Apr 2018 07:53:39 +0000 (+0000) Subject: Merge "Previous model height return problem fixed" into devel/master X-Git-Tag: dali_1.3.23~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=e37f48bb34e81585a6ed436bd7a2f9dce02c19f5;hp=e2e0eec8d2b46b908bd0f40f2edca3d7100ade7c Merge "Previous model height return problem fixed" into devel/master --- diff --git a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt index 8b2160f..902b00d 100755 --- a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt @@ -39,7 +39,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp - ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp + ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp old mode 100644 new mode 100755 index 9248151..7768344 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp @@ -357,8 +357,9 @@ void ConfigureTextLabel( ControllerPtr controller ) // Set cursor's width to zero. controller->GetLayoutEngine().SetCursorWidth( 0 ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Disables the text input. - controller->EnableTextInput( NULL ); + controller->EnableTextInput( NULL, inputMethodContext ); // Disables the vertical scrolling. controller->SetVerticalScrollEnabled( false ); @@ -382,8 +383,9 @@ void ConfigureTextField( ControllerPtr controller ) // Set the text layout as multi-line. controller->GetLayoutEngine().SetLayout( Layout::Engine::SINGLE_LINE_BOX ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Enables the vertical scrolling after the text input has been enabled. controller->SetVerticalScrollEnabled( false ); @@ -410,8 +412,9 @@ void ConfigureTextEditor( ControllerPtr controller ) // Set the text layout as multi-line. controller->GetLayoutEngine().SetLayout( Layout::Engine::MULTI_LINE_BOX ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Enables the vertical scrolling after the text input has been enabled. controller->SetVerticalScrollEnabled( true ); 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 old mode 100644 new mode 100755 index ad36607..c87af41 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -146,9 +146,9 @@ int UtcDaliTextControllerEnableCursorBlinking(void) // Creates a decorator. Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller ); - + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Enables the cursor blink. controller->SetEnableCursorBlink( true ); @@ -173,7 +173,7 @@ int UtcDaliTextControllerImfEvent(void) ControllerPtr controller = Controller::New(); std::string text; - ImfManager::ImfEventData imfEvent; + InputMethodContext::EventData imfEvent; DALI_TEST_CHECK( controller ); @@ -182,41 +182,39 @@ int UtcDaliTextControllerImfEvent(void) Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Set the placeholder text. controller->SetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, "Hello Dali" ); - // Creates an ImfManager. - ImfManager imfManager = ImfManager::Get(); - // For coverage. - imfEvent = ImfManager::ImfEventData( ImfManager::GETSURROUNDING, "", 0, 0 ); - controller->OnImfEvent( imfManager, imfEvent ); + imfEvent = InputMethodContext::EventData( InputMethodContext::GET_SURROUNDING, "", 0, 0 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); // Send VOID event. - imfEvent = ImfManager::ImfEventData( ImfManager::VOID, "", 0, 0 ); - controller->OnImfEvent( imfManager, imfEvent ); + imfEvent = InputMethodContext::EventData( InputMethodContext::VOID, "", 0, 0 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); controller->GetText( text ); DALI_TEST_CHECK( text.empty() ); - imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 ); - controller->OnImfEvent( imfManager, imfEvent ); + imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "Hello ", 0, 6 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); controller->GetNaturalSize(); // Check 'Delete All' key which means the input panel send a big range - imfEvent = ImfManager::ImfEventData( ImfManager::DELETESURROUNDING, "", -100, 100 ); - controller->OnImfEvent( imfManager, imfEvent ); + imfEvent = InputMethodContext::EventData( InputMethodContext::DELETE_SURROUNDING, "", -100, 100 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); controller->GetNaturalSize(); controller->GetText( text ); DALI_TEST_EQUALS( "", text, TEST_LOCATION ); // Send COMMIT event. - imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 ); - controller->OnImfEvent( imfManager, imfEvent ); + imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "Hello ", 0, 6 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); // Force to update the model. controller->GetNaturalSize(); @@ -224,9 +222,9 @@ int UtcDaliTextControllerImfEvent(void) controller->GetText( text ); DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION ); - // Send PREEDIT event - imfEvent = ImfManager::ImfEventData( ImfManager::PREEDIT, "w", 6, 1 ); - controller->OnImfEvent( imfManager, imfEvent ); + // Send PRE_EDIT event + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); // Force to update the model. controller->GetNaturalSize(); @@ -234,9 +232,9 @@ int UtcDaliTextControllerImfEvent(void) controller->GetText( text ); DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION ); - // Send DELETESURROUNDING event - imfEvent = ImfManager::ImfEventData( ImfManager::DELETESURROUNDING, "", -1, 1 ); - controller->OnImfEvent( imfManager, imfEvent ); + // Send DELETE_SURROUNDING event + imfEvent = InputMethodContext::EventData( InputMethodContext::DELETE_SURROUNDING, "", -1, 1 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); // Force to update the model. controller->GetNaturalSize(); @@ -244,9 +242,9 @@ int UtcDaliTextControllerImfEvent(void) controller->GetText( text ); DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION ); - // Send PREEDIT event - imfEvent = ImfManager::ImfEventData( ImfManager::PREEDIT, "wo", 6, 2 ); - controller->OnImfEvent( imfManager, imfEvent ); + // Send PRE_EDIT event + imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "wo", 6, 2 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); // Force to update the model. controller->GetNaturalSize(); @@ -254,16 +252,16 @@ int UtcDaliTextControllerImfEvent(void) controller->GetText( text ); DALI_TEST_EQUALS( "Hello wo", text, TEST_LOCATION ); - // Send GETSURROUNDING event - imfEvent = ImfManager::ImfEventData( ImfManager::GETSURROUNDING, "", 0, 0 ); - controller->OnImfEvent( imfManager, imfEvent ); + // Send GET_SURROUNDING event + imfEvent = InputMethodContext::EventData( InputMethodContext::GET_SURROUNDING, "", 0, 0 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); controller->GetText( text ); DALI_TEST_EQUALS( "Hello wo", text, TEST_LOCATION ); - // Send PRIVATECOMMAND event - imfEvent = ImfManager::ImfEventData( ImfManager::PRIVATECOMMAND, "", 0, 0 ); - controller->OnImfEvent( imfManager, imfEvent ); + // Send PRIVATE_COMMAND event + imfEvent = InputMethodContext::EventData( InputMethodContext::PRIVATE_COMMAND, "", 0, 0 ); + controller->OnInputMethodContextEvent( inputMethodContext, imfEvent ); controller->GetText( text ); DALI_TEST_EQUALS( "Hello wo", text, TEST_LOCATION ); @@ -291,8 +289,9 @@ int UtcDaliTextControllerTextPopupButtonTouched(void) Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); // Creates the text's popup. TextSelectionPopupCallbackInterface& callbackInterface = *controller; @@ -479,8 +478,9 @@ int UtcDaliTextControllerSetGetCheckProperty(void) // Creates a decorator. Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); DALI_TEST_CHECK( !controller->IsInputModePassword() ); @@ -523,8 +523,9 @@ int UtcDaliTextControllerSetGetTapLongPressAction(void) // Creates a decorator. Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller ); + InputMethodContext inputMethodContext = InputMethodContext::New(); // Enables the text input. - controller->EnableTextInput( decorator ); + controller->EnableTextInput( decorator, inputMethodContext ); DALI_TEST_EQUALS( Controller::NoTextTap::NO_ACTION, controller->GetNoTextDoubleTapAction(), TEST_LOCATION ); controller->SetNoTextDoubleTapAction( Controller::NoTextTap::HIGHLIGHT ); diff --git a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt index 51f2551..6b38451 100644 --- a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt @@ -22,7 +22,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-feedback-player.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-file-loader.cpp - ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp + ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp diff --git a/automated-tests/src/dali-toolkit-styling/default-theme.json b/automated-tests/src/dali-toolkit-styling/default-theme.json index 30edbfd..7630242 100644 --- a/automated-tests/src/dali-toolkit-styling/default-theme.json +++ b/automated-tests/src/dali-toolkit-styling/default-theme.json @@ -2,7 +2,8 @@ "config": { "alwaysShowFocus":false, - "clearFocusOnEscape":true + "clearFocusOnEscape":true, + "brokenImageUrl":"{DALI_IMAGE_DIR}broken.png" }, "constants": { diff --git a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp old mode 100644 new mode 100755 index 07d657f..591ec8f --- a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp +++ b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp @@ -238,6 +238,12 @@ int UtcDaliStyleManagerApplyTheme(void) styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged); + // To ensure we make VisualFactory + VisualFactory factory = VisualFactory::Get(); + Property::Map propertyMap; + propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::TEXT ); + Visual::Base textVisual = factory.CreateVisual( propertyMap ); + // Render and notify application.SendNotification(); application.Render(); @@ -1306,8 +1312,13 @@ int UtcDaliStyleManagerConfigSectionTest(void) const char* defaultTheme = "{\n" + " \"constants\":\n" + " {\n" + " \"TEST\":\"broken\"\n" + " },\n" " \"config\":\n" " {\n" + " \"brokenImageUrl\":\"{TEST}|{TEST}|{TEST|TEST.png\",\n" " \"alwaysShowFocus\":false,\n" " \"clearFocusOnEscape\":false\n" " },\n" @@ -1327,6 +1338,8 @@ int UtcDaliStyleManagerConfigSectionTest(void) DALI_TEST_CHECK( !alwaysShowFocus ); bool clearFocusOnEscape = config["clearFocusOnEscape"].Get(); DALI_TEST_CHECK( !clearFocusOnEscape ); + std::string brokenImageUrl = config["brokenImageUrl"].Get(); + DALI_TEST_CHECK( brokenImageUrl.compare( "broken|broken|{TEST|TEST.png" ) == 0 ); // For coverage Toolkit::TextEditor editor = Toolkit::TextEditor::New(); @@ -1335,7 +1348,7 @@ int UtcDaliStyleManagerConfigSectionTest(void) Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( editor ); - application.ProcessEvent( Integration::KeyEvent( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( Integration::KeyEvent( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", "", Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt b/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt index 9417822..43c4be3 100644 --- a/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt @@ -18,7 +18,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp - ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp + ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp diff --git a/automated-tests/src/dali-toolkit/CMakeLists.txt b/automated-tests/src/dali-toolkit/CMakeLists.txt index 4def66d..c754d35 100755 --- a/automated-tests/src/dali-toolkit/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit/CMakeLists.txt @@ -76,7 +76,7 @@ LIST(APPEND TC_SOURCES dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp dali-toolkit-test-utils/toolkit-event-thread-callback.cpp dali-toolkit-test-utils/toolkit-environment-variable.cpp - dali-toolkit-test-utils/toolkit-imf-manager.cpp + dali-toolkit-test-utils/toolkit-input-method-context.cpp dali-toolkit-test-utils/toolkit-orientation.cpp dali-toolkit-test-utils/toolkit-physical-keyboard.cpp dali-toolkit-test-utils/toolkit-style-monitor.cpp diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h index 50a5828..32dac4b 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h @@ -23,7 +23,7 @@ #include #include "toolkit-test-application.h" #include "toolkit-application.h" -#include "toolkit-imf-manager.h" +#include "toolkit-input-method-context.h" #include "toolkit-clipboard-event-notifier.h" #endif // __DALI_TOOLKIT_TEST_SUITE_UTILS_H__ diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h index 2e5a2cb..06350f5 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h @@ -18,7 +18,7 @@ * */ -#include +#include namespace Dali { @@ -62,7 +62,7 @@ public: virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {} - virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::ECORE_RENDER_SURFACE; } + virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::WINDOW_RENDER_SURFACE; } }; namespace Internal diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp deleted file mode 100644 index edb97ba..0000000 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include "toolkit-imf-manager.h" - -// EXTERNAL INCLUDES -#include -#include - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ -class RenderSurface; - - -class ImfManager : public Dali::BaseObject -{ -public: - typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType; - typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType; - typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType; - typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType; - -public: - static Dali::ImfManager Get(); - - ImfManager( /* Ecore_X_Window ecoreXwin */ ); - void ConnectCallbacks(); - void DisconnectCallbacks(); - void Activate(); - void Deactivate(); - void Reset(); - - bool RestoreAfterFocusLost() const; - void SetRestoreAfterFocusLost( bool toggle ); - void NotifyCursorPosition(); - void SetCursorPosition( unsigned int cursorPosition ); - unsigned int GetCursorPosition() const; - void SetSurroundingText( const std::string& text ); - const std::string& GetSurroundingText() const; - void ApplyOptions( const InputMethodOptions& options ); - -public: // Signals - ImfManagerSignalType& ActivatedSignal() { return mActivatedSignal; } - ImfEventSignalType& EventReceivedSignal() { return mEventSignal; } - ImfStatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; } - ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; } - ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; } - -protected: - virtual ~ImfManager(); - -private: - void CreateContext( /*Ecore_X_Window ecoreXwin*/ ); - void DeleteContext(); - -private: - // Undefined - ImfManager( const ImfManager& ); - ImfManager& operator=( ImfManager& ); - -private: - int mIMFCursorPosition; - std::string mSurroundingText; - 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; - - ImfManagerSignalType mActivatedSignal; - ImfEventSignalType mEventSignal; - ImfStatusSignalType mKeyboardStatusSignal; - ImfVoidSignalType mKeyboardResizeSignal; - ImfVoidSignalType mKeyboardLanguageChangedSignal; - - static Dali::ImfManager mToolkitImfManager; - -public: - -inline static Internal::Adaptor::ImfManager& GetImplementation(Dali::ImfManager& imfManager) -{ - Dali::ImfManager actualImfManager = ImfManager::Get(); - - BaseObject& handle = actualImfManager.GetBaseObject(); - return static_cast(handle); -} - -inline static const Internal::Adaptor::ImfManager& GetImplementation(const Dali::ImfManager& imfManager) -{ - Dali::ImfManager actualImfManager = ImfManager::Get(); - - const BaseObject& handle = imfManager.GetBaseObject(); - return static_cast(handle); -} - -}; - -Dali::ImfManager Dali::Internal::Adaptor::ImfManager::mToolkitImfManager; - -Dali::ImfManager ImfManager::Get() -{ - Dali::ImfManager manager; - - if( ! mToolkitImfManager ) - { - mToolkitImfManager = Dali::ImfManager( new Dali::Internal::Adaptor::ImfManager() ); - } - return mToolkitImfManager; -} - -ImfManager::ImfManager( /*Ecore_X_Window ecoreXwin*/ ) -: mIMFCursorPosition( 0 ), - mSurroundingText(), - mRestoreAfterFocusLost( false ), - mIdleCallbackConnected( false ) -{ - CreateContext( /*ecoreXwin*/ ); - ConnectCallbacks(); -} - -ImfManager::~ImfManager() -{ - DisconnectCallbacks(); - DeleteContext(); -} - -void ImfManager::CreateContext( /*Ecore_X_Window ecoreXwin*/ ) -{ -} - -void ImfManager::DeleteContext() -{ -} - -// Callbacks for predicitive text support. -void ImfManager::ConnectCallbacks() -{ -} - -void ImfManager::DisconnectCallbacks() -{ -} - -void ImfManager::Activate() -{ -} - -void ImfManager::Deactivate() -{ -} - -void ImfManager::Reset() -{ -} - -bool ImfManager::RestoreAfterFocusLost() const -{ - return mRestoreAfterFocusLost; -} - -void ImfManager::SetRestoreAfterFocusLost( bool toggle ) -{ - mRestoreAfterFocusLost = toggle; -} - -void ImfManager::NotifyCursorPosition() -{ -} - -void ImfManager::SetCursorPosition( unsigned int cursorPosition ) -{ - mIMFCursorPosition = static_cast< int >( cursorPosition ); -} - -unsigned int ImfManager::GetCursorPosition() const -{ - return static_cast( mIMFCursorPosition ); -} - -void ImfManager::SetSurroundingText( const std::string& text ) -{ - mSurroundingText = text; -} - -const std::string& ImfManager::GetSurroundingText() const -{ - return mSurroundingText; -} - -void ImfManager::ApplyOptions( const InputMethodOptions& options ) -{ -} - -} // Adaptor - -} // Internal - - -/********************************************************************************/ -/********************************* PUBLIC CLASS *******************************/ -/********************************************************************************/ - -ImfManager::ImfManager() -{ -} - -ImfManager::~ImfManager() -{ -} - -ImfManager ImfManager::Get() -{ - return Internal::Adaptor::ImfManager::Get(); -} - -void ImfManager::Activate() -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).Activate(); -} - -void ImfManager::Deactivate() -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).Deactivate(); -} - -bool ImfManager::RestoreAfterFocusLost() const -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).RestoreAfterFocusLost(); -} - -void ImfManager::SetRestoreAfterFocusLost( bool toggle ) -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).SetRestoreAfterFocusLost( toggle ); -} - -void ImfManager::Reset() -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).Reset(); -} - -void ImfManager::NotifyCursorPosition() -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).NotifyCursorPosition(); -} - -void ImfManager::SetCursorPosition( unsigned int SetCursorPosition ) -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).SetCursorPosition( SetCursorPosition ); -} - -unsigned int ImfManager::GetCursorPosition() const -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).GetCursorPosition(); -} - -void ImfManager::SetSurroundingText( const std::string& text ) -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).SetSurroundingText( text ); -} - -const std::string& ImfManager::GetSurroundingText() const -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText(); -} - -void ImfManager::NotifyTextInputMultiLine( bool multiLine ) -{ -} - -void ImfManager::ApplyOptions( const InputMethodOptions& options ) -{ - Internal::Adaptor::ImfManager::GetImplementation(*this).ApplyOptions( options ); -} - -ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal() -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal(); -} - -ImfManager::ImfEventSignalType& ImfManager::EventReceivedSignal() -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).EventReceivedSignal(); -} - -ImfManager::StatusSignalType& ImfManager::StatusChangedSignal() -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).StatusChangedSignal(); -} - -ImfManager::VoidSignalType& ImfManager::ResizedSignal() -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).ResizedSignal(); -} - -ImfManager::VoidSignalType& ImfManager::LanguageChangedSignal() -{ - return Internal::Adaptor::ImfManager::GetImplementation(*this).LanguageChangedSignal(); -} - -ImfManager::ImfManager(Internal::Adaptor::ImfManager *impl) - : BaseHandle(impl) -{ -} - -} // namespace Dali 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 new file mode 100755 index 0000000..775c0c0 --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2018 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 "toolkit-input-method-context.h" + +// EXTERNAL INCLUDES +#include +#include + +namespace Dali +{ +namespace Internal +{ +namespace Adaptor +{ +class RenderSurface; + + +class InputMethodContext : public Dali::BaseObject +{ +public: + typedef Dali::InputMethodContext::ActivatedSignalType ActivatedSignalType; + typedef Dali::InputMethodContext::KeyboardEventSignalType KeyboardEventSignalType; + typedef Dali::InputMethodContext::StatusSignalType StatusSignalType; + typedef Dali::InputMethodContext::VoidSignalType VoidSignalType; + +public: + static Dali::InputMethodContext New(); + + InputMethodContext( /* Ecore_X_Window ecoreXwin */ ); + void Finalize(); + void ConnectCallbacks(); + void DisconnectCallbacks(); + void Activate(); + void Deactivate(); + void Reset(); + + bool RestoreAfterFocusLost() const; + void SetRestoreAfterFocusLost( bool toggle ); + void NotifyCursorPosition(); + void SetCursorPosition( unsigned int cursorPosition ); + unsigned int GetCursorPosition() const; + void SetSurroundingText( const std::string& text ); + const std::string& GetSurroundingText() const; + void ApplyOptions( const InputMethodOptions& options ); + bool FilterEventKey( const Dali::KeyEvent& keyEvent ); + +public: // Signals + ActivatedSignalType& ActivatedSignal() { return mActivatedSignal; } + KeyboardEventSignalType& EventReceivedSignal() { return mEventSignal; } + StatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; } + VoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; } + VoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; } + +protected: + virtual ~InputMethodContext(); + +private: + void CreateContext( /*Ecore_X_Window ecoreXwin*/ ); + void DeleteContext(); + +private: + // Undefined + InputMethodContext( const InputMethodContext& ); + InputMethodContext& operator=( InputMethodContext& ); + +private: + int mIMFCursorPosition; + std::string mSurroundingText; + 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; + + ActivatedSignalType mActivatedSignal; + KeyboardEventSignalType mEventSignal; + StatusSignalType mKeyboardStatusSignal; + VoidSignalType mKeyboardResizeSignal; + VoidSignalType mKeyboardLanguageChangedSignal; + + static Dali::InputMethodContext mToolkitInputMethodContext; + +public: + +inline static Internal::Adaptor::InputMethodContext& GetImplementation(Dali::InputMethodContext& inputMethodContext) +{ + BaseObject& handle = inputMethodContext.GetBaseObject(); + return static_cast(handle); +} + +inline static const Internal::Adaptor::InputMethodContext& GetImplementation(const Dali::InputMethodContext& inputMethodContext) +{ + const BaseObject& handle = inputMethodContext.GetBaseObject(); + return static_cast(handle); +} + +}; + +Dali::InputMethodContext Dali::Internal::Adaptor::InputMethodContext::mToolkitInputMethodContext; + +Dali::InputMethodContext InputMethodContext::New() +{ + if( ! mToolkitInputMethodContext ) + { + mToolkitInputMethodContext = Dali::InputMethodContext( new Dali::Internal::Adaptor::InputMethodContext() ); + } + return mToolkitInputMethodContext; +} + +InputMethodContext::InputMethodContext( /*Ecore_X_Window ecoreXwin*/ ) +: mIMFCursorPosition( 0 ), + mSurroundingText(), + mRestoreAfterFocusLost( false ), + mIdleCallbackConnected( false ) +{ + CreateContext( /*ecoreXwin*/ ); + ConnectCallbacks(); +} + +InputMethodContext::~InputMethodContext() +{ + DisconnectCallbacks(); + DeleteContext(); +} + +void InputMethodContext::Finalize() +{ +} + +void InputMethodContext::CreateContext( /*Ecore_X_Window ecoreXwin*/ ) +{ +} + +void InputMethodContext::DeleteContext() +{ +} + +// Callbacks for predicitive text support. +void InputMethodContext::ConnectCallbacks() +{ +} + +void InputMethodContext::DisconnectCallbacks() +{ +} + +void InputMethodContext::Activate() +{ +} + +void InputMethodContext::Deactivate() +{ +} + +void InputMethodContext::Reset() +{ +} + +bool InputMethodContext::RestoreAfterFocusLost() const +{ + return mRestoreAfterFocusLost; +} + +void InputMethodContext::SetRestoreAfterFocusLost( bool toggle ) +{ + mRestoreAfterFocusLost = toggle; +} + +void InputMethodContext::NotifyCursorPosition() +{ +} + +void InputMethodContext::SetCursorPosition( unsigned int cursorPosition ) +{ + mIMFCursorPosition = static_cast< int >( cursorPosition ); +} + +unsigned int InputMethodContext::GetCursorPosition() const +{ + return static_cast( mIMFCursorPosition ); +} + +void InputMethodContext::SetSurroundingText( const std::string& text ) +{ + mSurroundingText = text; +} + +const std::string& InputMethodContext::GetSurroundingText() const +{ + return mSurroundingText; +} + +void InputMethodContext::ApplyOptions( const InputMethodOptions& options ) +{ +} + +bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent ) +{ + return false; +} +} // Adaptor + +} // Internal + + +/********************************************************************************/ +/********************************* PUBLIC CLASS *******************************/ +/********************************************************************************/ + +InputMethodContext::InputMethodContext() +{ +} + +InputMethodContext::~InputMethodContext() +{ +} + +InputMethodContext InputMethodContext::New() +{ + return Internal::Adaptor::InputMethodContext::New(); +} + +void InputMethodContext::Finalize() +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize(); +} + +void InputMethodContext::Activate() +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate(); +} + +void InputMethodContext::Deactivate() +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate(); +} + +bool InputMethodContext::RestoreAfterFocusLost() const +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost(); +} + +void InputMethodContext::SetRestoreAfterFocusLost( bool toggle ) +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost( toggle ); +} + +void InputMethodContext::Reset() +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset(); +} + +void InputMethodContext::NotifyCursorPosition() +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition(); +} + +void InputMethodContext::SetCursorPosition( unsigned int SetCursorPosition ) +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition( SetCursorPosition ); +} + +unsigned int InputMethodContext::GetCursorPosition() const +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition(); +} + +void InputMethodContext::SetSurroundingText( const std::string& text ) +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText( text ); +} + +const std::string& InputMethodContext::GetSurroundingText() const +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText(); +} + +void InputMethodContext::NotifyTextInputMultiLine( bool multiLine ) +{ +} + +void InputMethodContext::ApplyOptions( const InputMethodOptions& options ) +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions( options ); +} + +bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent ) +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent ); +} + +InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal() +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal(); +} + +InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal() +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal(); +} + +InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal() +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal(); +} + +InputMethodContext::VoidSignalType& InputMethodContext::ResizedSignal() +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal(); +} + +InputMethodContext::VoidSignalType& InputMethodContext::LanguageChangedSignal() +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal(); +} + +InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl) + : BaseHandle(impl) +{ +} + +} // namespace Dali diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h old mode 100644 new mode 100755 similarity index 62% rename from automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h rename to automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h index 392b580..cb4e085 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__ -#define __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__ +#ifndef __DALI_TOOLKIT_TOOLKIT_INPUT_METHOD_CONTEXT_H__ +#define __DALI_TOOLKIT_TOOLKIT_INPUT_METHOD_CONTEXT_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -19,10 +19,11 @@ */ // EXTERNAL INCLUDES -#define __DALI_IMF_MANAGER_H__ +#define __DALI_INPUT_METHOD_CONTEXT_H__ #include #include #include +#include namespace Dali DALI_IMPORT_API { @@ -31,41 +32,41 @@ namespace Internal DALI_INTERNAL { namespace Adaptor { -class ImfManager; +class InputMethodContext; } } /** - * @brief The ImfManager class + * @brief The InputMethodContext class * * Specifically manages the ecore input method framework which enables the virtual or hardware keyboards. */ -class ImfManager : public BaseHandle +class InputMethodContext : public BaseHandle { public: /** - * @brief Events that are generated by the IMF. + * @brief Events that are generated by the input method context. */ - enum ImfEvent + enum EventType { VOID, ///< No event - PREEDIT, ///< Pre-Edit changed + PRE_EDIT, ///< Pre-Edit changed COMMIT, ///< Commit recieved - DELETESURROUNDING, ///< Event to delete a range of characters from the string - GETSURROUNDING, ///< Event to query string and cursor position - PRIVATECOMMAND ///< Private command sent from the input panel + DELETE_SURROUNDING, ///< Event to delete a range of characters from the string + GET_SURROUNDING, ///< Event to query string and cursor position + PRIVATE_COMMAND ///< Private command sent from the input panel }; /** - * @brief This structure is used to pass on data from the IMF regarding predictive text. + * @brief This structure is used to pass on data from the input method cotext regarding predictive text. */ - struct ImfEventData + struct EventData { /** * @brief Default Constructor. */ - ImfEventData() + EventData() : predictiveString(), eventName( VOID ), cursorOffset( 0 ), @@ -76,12 +77,12 @@ public: /** * @brief Constructor * - * @param[in] aEventName The name of the event from the IMF. + * @param[in] aEventName The name of the event from the input method context. * @param[in] aPredictiveString The pre-edit or commit string. * @param[in] aCursorOffset Start position from the current cursor position to start deleting characters. * @param[in] aNumberOfChars The number of characters to delete from the cursorOffset. */ - ImfEventData( ImfEvent aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars ) + EventData( EventType aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars ) : predictiveString( aPredictiveString ), eventName( aEventName ), cursorOffset( aCursorOffset ), @@ -91,20 +92,20 @@ public: // Data std::string predictiveString; ///< The pre-edit or commit string. - ImfEvent eventName; ///< The name of the event from the IMF. + EventType eventName; ///< The name of the event from the input method context. int cursorOffset; ///< Start position from the current cursor position to start deleting characters. int numberOfChars; ///< number of characters to delete from the cursorOffset. }; /** - * @brief Data required by IMF from the callback + * @brief Data required by input method context from the callback */ - struct ImfCallbackData + struct CallbackData { /** * @brief Constructor */ - ImfCallbackData() + CallbackData() : currentText(), cursorPosition( 0 ), update( false ), @@ -119,7 +120,7 @@ public: * @param[in] aCurrentText current text string * @param[in] aPreeditResetRequired flag if preedit reset is required. */ - ImfCallbackData( bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired ) + CallbackData( bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired ) : currentText( aCurrentText ), cursorPosition( aCursorPosition ), update( aUpdate ), @@ -133,21 +134,28 @@ public: bool preeditResetRequired :1; ///< flag if preedit reset is required. }; - typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal - typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events + typedef Signal< void (InputMethodContext&) > ActivatedSignalType; ///< Keyboard actived signal + typedef Signal< CallbackData ( InputMethodContext&, const EventData& ) > KeyboardEventSignalType; ///< keyboard events typedef Signal< void () > VoidSignalType; typedef Signal< void (bool) > StatusSignalType; public: /** - * @brief Retrieve a handle to the instance of ImfManager. - * @return A handle to the ImfManager. + * @brief Create a handle to the instance of InputMethodContext. + * @return A handle to the InputMethodContext. */ - static ImfManager Get(); + static InputMethodContext New(); /** - * @brief Activate the IMF. + * @brief Finalize the InputMethodContext. + * + * It means that the context will be deleted. + */ + void Finalize(); + + /** + * @brief Activate the input method context. * * It means that the text editing is started at somewhere. * If the H/W keyboard isn't connected then it will show the virtual keyboard. @@ -155,7 +163,7 @@ public: void Activate(); /** - * @brief Deactivate the IMF. + * @brief Deactivate the input method context. * * It means that the text editing is finished at somewhere. */ @@ -170,54 +178,54 @@ public: bool RestoreAfterFocusLost() const; /** - * @brief Set status whether the IMF has to restore the keyboard after losing focus. + * @brief Set status whether the input method context has to restore the keyboard after losing focus. * * @param[in] toggle True means that keyboard should be restored after focus lost and regained. */ void SetRestoreAfterFocusLost( bool toggle ); /** - * @brief Send message reset the pred-edit state / imf module. + * @brief Send message reset the pred-edit state / input method context module. * * Used to interupt pre-edit state maybe due to a touch input. */ void Reset(); /** - * @brief Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation. + * @brief Notifies ImfContext that the cursor position has changed, required for features like auto-capitalisation. */ void NotifyCursorPosition(); /** - * @brief Sets cursor position stored in VirtualKeyboard, this is required by the IMF context. + * @brief Sets cursor position stored in VirtualKeyboard, this is required by the ImfContext. * * @param[in] cursorPosition position of cursor */ void SetCursorPosition( unsigned int cursorPosition ); /** - * @brief Gets cursor position stored in VirtualKeyboard, this is required by the IMF context. + * @brief Gets cursor position stored in VirtualKeyboard, this is required by the ImfContext. * * @return current position of cursor */ unsigned int GetCursorPosition() const; /** - * @brief Method to store the string required by the IMF, this is used to provide predictive word suggestions. + * @brief Method to store the string required by the input method context, this is used to provide predictive word suggestions. * * @param[in] text The text string surrounding the current cursor point. */ void SetSurroundingText( const std::string& text ); /** - * @brief Gets current text string set within the IMF manager, this is used to offer predictive suggestions. + * @brief Gets current text string set within the input method context, this is used to offer predictive suggestions. * * @return current position of cursor */ const std::string& GetSurroundingText() const; /** - * @brief Notifies IMF context that text input is set to multi line or not + * @brief Notifies ImfContext that text input is set to multi line or not */ void NotifyTextInputMultiLine( bool multiLine ); @@ -227,6 +235,14 @@ public: */ void ApplyOptions( const InputMethodOptions& options ); + /** + * @brief Process event key down or up, whether filter a key to isf. + * + * @param[in] keyEvent The event key to be handled. + * @return Whether the event key is handled. + */ + bool FilterEventKey( const Dali::KeyEvent& keyEvent ); + public: // Signals @@ -234,16 +250,16 @@ public: /** * @brief This is emitted when the virtual keyboard is connected to or the hardware keyboard is activated. * - * @return The IMF Activated signal. + * @return The input method context Activated signal. */ - ImfManagerSignalType& ActivatedSignal(); + ActivatedSignalType& ActivatedSignal(); /** - * @brief This is emitted when the IMF manager receives an event from the IMF. + * @brief This is emitted when the input method context receives an event. * * @return The Event signal containing the event data. */ - ImfEventSignalType& EventReceivedSignal(); + KeyboardEventSignalType& EventReceivedSignal(); /** * @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden. @@ -271,23 +287,23 @@ public: /** * @brief Constructor. */ - ImfManager(); + InputMethodContext(); /** * @brief Destructor * * This is non-virtual since derived Handle types must not contain data or virtual methods. */ - ~ImfManager(); + ~InputMethodContext(); /** - * @brief This constructor is used by ImfManager::Get(). + * @brief This constructor is used by InputMethodContext::Get(). * - * @param[in] imfManager A pointer to the imf Manager. + * @param[in] inputMethodContext A pointer to the input method context. */ - explicit ImfManager( Internal::Adaptor::ImfManager* imfManager ); + explicit InputMethodContext( Internal::Adaptor::InputMethodContext* inputMethodContext ); }; } // namespace Dali -#endif // __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__ +#endif // __DALI_TOOLKIT_TOOLKIT_INPUT_METHOD_CONTEXT_H__ diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp index c17872b..a15a793 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp @@ -27,7 +27,13 @@ namespace { const char* DEFAULT_THEME= - "{\"styles\":{\n" + "{\n" + " \"config\":\n" + " {\n" + " \"brokenImageUrl\":\"{DALI_IMAGE_DIR}broken.png\"\n" + " },\n" + " \"styles\":\n" + " {\n" " \"textlabel\":\n" " {\n" " \"fontStyle\":{\"weight\":\"normal\"},\n" diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp old mode 100644 new mode 100755 index f574485..4623958 --- a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp @@ -250,7 +250,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation01(void) manager.SetFocus( dummy3 ); DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained ); - Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", Device::Class::TOUCH, Device::Subclass::NONE ); + Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", "", Device::Class::TOUCH, Device::Subclass::NONE ); application.ProcessEvent(event); DALI_TEST_CHECK( callback1.mIsCalled ); @@ -296,7 +296,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation02(void) manager.SetFocus( dummy3 ); DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained ); - Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", Device::Class::TOUCH, Device::Subclass::NONE ); + Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", "", Device::Class::TOUCH, Device::Subclass::NONE ); application.ProcessEvent(event); DALI_TEST_CHECK( !callback1.mIsCalled ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp old mode 100644 new mode 100755 index becbaaa..8b9547a --- a/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp @@ -865,7 +865,7 @@ int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void) FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified); manager.FocusedActorEnterKeySignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback ); - Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager // It makes mIsFocusIndicatorEnabled true @@ -923,8 +923,8 @@ int UtcDaliKeyboardFocusManagerSignalFocusGroupChanged(void) FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified); manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback ); - Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); - Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager // It makes mIsFocusIndicatorEnabled true @@ -1063,12 +1063,12 @@ int UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents(void) FocusChangedCallback focusChangedCallback(focusChangedSignalVerified); manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback ); - Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); - Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); - Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); - Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); - Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); - Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager // It makes mIsFocusIndicatorEnabled true diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp old mode 100644 new mode 100755 index 3e50df3..b190b5f --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -179,6 +179,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, int keyModifier, unsigned long timeStamp, const Integration::KeyEvent::State& keyState, + const std::string& compose = "", const std::string& deviceName = "", const Device::Class::Type& deviceClass = Device::Class::NONE, const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE @@ -190,6 +191,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, keyModifier, timeStamp, keyState, + compose, deviceName, deviceClass, deviceSubclass ); @@ -1432,7 +1434,7 @@ int UtcDaliPopupOnKeyEvent(void) popup.SetKeyInputFocus(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", Device::Class::TOUCH, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", "", Device::Class::TOUCH, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp old mode 100644 new mode 100755 index a55d637..dd538d4 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -217,6 +217,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, int keyModifier, unsigned long timeStamp, const Integration::KeyEvent::State& keyState, + const std::string& compose = "", const std::string& deviceName = DEFAULT_DEVICE_NAME, const Device::Class::Type& deviceClass = Device::Class::NONE, const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE ) @@ -227,6 +228,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, keyModifier, timeStamp, keyState, + compose, deviceName, deviceClass, deviceSubclass ); @@ -1012,7 +1014,7 @@ int utcDaliTextEditorTextChangedP(void) editor.SetKeyInputFocus(); gTextChangedCallBackCalled = false; - application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); END_TEST; @@ -1332,7 +1334,7 @@ int utcDaliTextEditorInputStyleChanged02(void) gInputStyleMask = TextEditor::InputStyle::NONE; inputStyleChangedSignal = false; - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1357,7 +1359,7 @@ int utcDaliTextEditorInputStyleChanged02(void) gInputStyleMask = TextEditor::InputStyle::NONE; inputStyleChangedSignal = false; - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1373,7 +1375,7 @@ int utcDaliTextEditorInputStyleChanged02(void) gInputStyleMask = TextEditor::InputStyle::NONE; inputStyleChangedSignal = false; - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1414,7 +1416,7 @@ int utcDaliTextEditorInputStyleChanged02(void) editor.SetProperty( TextEditor::Property::INPUT_EMBOSS, "emboss" ); editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "outline" ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1522,7 +1524,7 @@ int utcDaliTextEditorEvent01(void) application.Render(); // Add a key event but as the text editor has not the focus it should do nothing. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1539,8 +1541,8 @@ int utcDaliTextEditorEvent01(void) application.Render(); // Now the text editor has the focus, so it can handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1571,8 +1573,8 @@ int utcDaliTextEditorEvent01(void) application.Render(); // The second text editor has the focus. It should handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1628,8 +1630,8 @@ int utcDaliTextEditorEvent02(void) DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION ); // Now the text editor has the focus, so it can handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1653,8 +1655,8 @@ int utcDaliTextEditorEvent02(void) // Move the cursor and check the position changes. Vector3 position1 = cursor.GetCurrentPosition(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1664,8 +1666,8 @@ int utcDaliTextEditorEvent02(void) DALI_TEST_CHECK( position2.x < position1.x ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1703,8 +1705,8 @@ int utcDaliTextEditorEvent02(void) DALI_TEST_CHECK( position5.x > position4.x ); // Remove all the text. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); editor.SetProperty( TextEditor::Property::TEXT, "" ); // Render and notify @@ -1853,8 +1855,8 @@ int utcDaliTextEditorEvent04(void) application.Render(); // Move at the end of the text. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1862,8 +1864,8 @@ int utcDaliTextEditorEvent04(void) for( unsigned int index = 0u; index < 10u; ++index ) { - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1871,7 +1873,7 @@ int utcDaliTextEditorEvent04(void) } // Add a character - application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1880,8 +1882,8 @@ int utcDaliTextEditorEvent04(void) DALI_TEST_EQUALS( "Hello\nworld", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Add some key events - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1889,8 +1891,8 @@ int utcDaliTextEditorEvent04(void) for( unsigned int index = 0u; index < 10u; ++index ) { - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1898,7 +1900,7 @@ int utcDaliTextEditorEvent04(void) } // Add a character - application.ProcessEvent( GenerateKey( " ", " ", KEY_WHITE_SPACE_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( " ", " ", KEY_WHITE_SPACE_CODE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1948,8 +1950,8 @@ int utcDaliTextEditorEvent05(void) application.Render(); // Move at the end of the text. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1958,7 +1960,7 @@ int utcDaliTextEditorEvent05(void) for( unsigned int index = 0u; index < 10u; ++index ) { // Add a character - application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1970,7 +1972,7 @@ int utcDaliTextEditorEvent05(void) // Continuous scroll left to increase coverage for( unsigned int index = 0u; index < 10u; ++index ) { - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1983,7 +1985,7 @@ int utcDaliTextEditorEvent05(void) DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); // Press Escape to increase coverage - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); @@ -2026,7 +2028,7 @@ int utcDaliTextEditorEvent06(void) application.Render(); // Move to seconds line of the text. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2036,12 +2038,12 @@ int utcDaliTextEditorEvent06(void) // Add another script characters ( glyph height is defferent ) - application.ProcessEvent( GenerateKey( "d", "ㅁ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "d", "ኢ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "ㅁ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "ㅁ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "ኢ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "ኢ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Delete characters - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_EQUALS( layoutHeight, editor.GetHeightForWidth( 100.f ), TEST_LOCATION ); @@ -2052,31 +2054,31 @@ int utcDaliTextEditorEvent06(void) DALI_TEST_EQUALS( "Hello\nworld\nHello world", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // For coverage - application.ProcessEvent( GenerateKey( "", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_UP, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); @@ -2117,25 +2119,25 @@ int utcDaliTextEditorEvent07(void) application.Render(); // Move to second line of the text. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Select some text in the right of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Cut the selected text - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2144,34 +2146,34 @@ int utcDaliTextEditorEvent07(void) DALI_TEST_EQUALS( "Hello\nld\nHello world", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Select some text in the left of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "",DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Copy the selected text - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Move the cursor to the third line - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Paste the selected text at the current cursor position - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "v", "v", KEY_V_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "v", "v", KEY_V_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "v", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2184,18 +2186,18 @@ int utcDaliTextEditorEvent07(void) editor.SetProperty( DevelTextEditor::Property::ENABLE_SHIFT_SELECTION, false ); // Test to select some text in the right of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Cut the selected text - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2205,18 +2207,18 @@ int utcDaliTextEditorEvent07(void) DALI_TEST_EQUALS( "Hello\nld\nHello lo\nworld", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Test to select some text in the left of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Copy the selected text - application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2263,54 +2265,54 @@ int utcDaliTextEditorEvent08(void) // When the left selection handle and the right selection handle are at the same position, the highlight box should be deactivated. // Test to select some text in the left of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test to the left selection handle position and the right selection handle position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test to select full text in the left of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test to release the current full text selection - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test to move the current cursor position correctly - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Add a character - application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2319,23 +2321,23 @@ int utcDaliTextEditorEvent08(void) DALI_TEST_EQUALS( "DdALi", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Test to select some text in the right of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test the cursor position with right arrow key - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Add a character - application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2344,25 +2346,25 @@ int utcDaliTextEditorEvent08(void) DALI_TEST_EQUALS( "DdALci", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Test to select some text in the left of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test the cursor position with left arrow key - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Add a character - application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2371,24 +2373,24 @@ int utcDaliTextEditorEvent08(void) DALI_TEST_EQUALS( "DcdALci", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Test to select some text in the right of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test the cursor position with left arrow key - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Add a character - application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, 0, 0, Integration::KeyEvent::Down, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2397,24 +2399,24 @@ int utcDaliTextEditorEvent08(void) DALI_TEST_EQUALS( "DcxdALci", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); // Test to select some text in the left of the current cursor position - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Test the cursor position with right arrow key - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Add a character - application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2874,3 +2876,14 @@ int UtcDaliTextEditorEnableGrabHandleProperty(void) END_TEST; } + +int UtcDaliTextEditorGetInputMethodContext(void) +{ + ToolkitTestApplication application; + tet_infoline("UtcDaliTextEditorGetInputMethodContext"); + + TextEditor editor = TextEditor::New(); + DALI_TEST_CHECK( DevelTextEditor::GetInputMethodContext( editor ) ); + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp old mode 100644 new mode 100755 index 96f0258..64a5d55 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -311,6 +311,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, int keyModifier, unsigned long timeStamp, const Integration::KeyEvent::State& keyState, + const std::string& compose = "", const std::string& deviceName = DEFAULT_DEVICE_NAME, const Device::Class::Type& deviceClass = Device::Class::NONE, const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE ) @@ -321,6 +322,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, keyModifier, timeStamp, keyState, + compose, deviceName, deviceClass, deviceSubclass ); @@ -1068,7 +1070,7 @@ int utcDaliTextFieldTextChangedP(void) field.SetKeyInputFocus(); gTextChangedCallBackCalled = false; - application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); END_TEST; @@ -1121,8 +1123,8 @@ int utcDaliTextFieldMaxCharactersReachedP(void) gMaxCharactersCallBackCalled = false; - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( gMaxCharactersCallBackCalled ); DALI_TEST_CHECK( maxLengthReachedSignal ); @@ -1153,13 +1155,13 @@ int utcDaliTextFieldMaxCharactersReachedN(void) gMaxCharactersCallBackCalled = false; - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( !gMaxCharactersCallBackCalled ); DALI_TEST_CHECK( !maxLengthReachedSignal ); - application.ProcessEvent( GenerateKey( "Return", "\r", KEY_RETURN_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "Return", "\r", KEY_RETURN_CODE, 0, 0, Integration::KeyEvent::Down, "\r", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( !gMaxCharactersCallBackCalled ); DALI_TEST_CHECK( !maxLengthReachedSignal ); @@ -1476,7 +1478,7 @@ int utcDaliTextFieldInputStyleChanged02(void) gInputStyleMask = TextField::InputStyle::NONE; inputStyleChangedSignal = false; - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1501,7 +1503,7 @@ int utcDaliTextFieldInputStyleChanged02(void) gInputStyleMask = TextField::InputStyle::NONE; inputStyleChangedSignal = false; - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1517,7 +1519,7 @@ int utcDaliTextFieldInputStyleChanged02(void) gInputStyleMask = TextField::InputStyle::NONE; inputStyleChangedSignal = false; - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1624,7 +1626,7 @@ int utcDaliTextFieldEvent01(void) application.Render(); // Add a key event but as the text field has not the focus it should do nothing. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1641,14 +1643,14 @@ int utcDaliTextFieldEvent01(void) application.Render(); // Pressing delete key should be fine even if there is no text in TextField. - application.ProcessEvent( GenerateKey( "Delete", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "Delete", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Now the text field has the focus, so it can handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1679,8 +1681,8 @@ int utcDaliTextFieldEvent01(void) application.Render(); // The second text field has the focus. It should handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1738,8 +1740,8 @@ int utcDaliTextFieldEvent02(void) DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION ); // Now the text field has the focus, so it can handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1763,8 +1765,8 @@ int utcDaliTextFieldEvent02(void) // Move the cursor and check the position changes. Vector3 position1 = cursor.GetCurrentPosition(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1774,8 +1776,8 @@ int utcDaliTextFieldEvent02(void) DALI_TEST_CHECK( position2.x < position1.x ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1813,8 +1815,8 @@ int utcDaliTextFieldEvent02(void) DALI_TEST_CHECK( position5.x > position4.x ); // Remove all the text. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); field.SetProperty( TextField::Property::TEXT, "" ); // Render and notify @@ -2230,14 +2232,14 @@ int utcDaliTextFieldEvent09(void) Property::Map map; map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_NONE; field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map ); - application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_ALL; map[ HiddenInput::Property::SUBSTITUTE_CHARACTER ] = 0x23; field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map ); - application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); @@ -2246,7 +2248,7 @@ int utcDaliTextFieldEvent09(void) field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map ); for( unsigned int index = 0u; index < 5u; ++index ) { - application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); } @@ -2256,7 +2258,7 @@ int utcDaliTextFieldEvent09(void) field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map ); for( unsigned int index = 0u; index < 5u; ++index ) { - application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); } @@ -2264,16 +2266,16 @@ int utcDaliTextFieldEvent09(void) map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::SHOW_LAST_CHARACTER; map[ HiddenInput::Property::SHOW_LAST_CHARACTER_DURATION ] = 0; field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); - application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); map[ HiddenInput::Property::SHOW_LAST_CHARACTER_DURATION ] = 100; field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map ); - application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); @@ -2385,7 +2387,7 @@ int utcDaliTextFieldStyleWhilstSelected(void) DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION ); // Press Escape to increase coverage - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); @@ -2419,8 +2421,8 @@ int utcDaliTextFieldEscKeyLoseFocus(void) application.Render(); // Add a key event but as the text field has not the focus it should do nothing. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2437,10 +2439,10 @@ int utcDaliTextFieldEscKeyLoseFocus(void) application.Render(); // Now the text field has the focus, so it can handle the key events. - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Up, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2449,8 +2451,8 @@ int utcDaliTextFieldEscKeyLoseFocus(void) DALI_TEST_EQUALS( field.GetProperty( TextField::Property::TEXT ), std::string("ad"), TEST_LOCATION ); // Generate a Esc key event. The text field should lose the focus. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2459,8 +2461,8 @@ int utcDaliTextFieldEscKeyLoseFocus(void) DALI_TEST_EQUALS( false, field.HasKeyInputFocus(), TEST_LOCATION ); // No more text should be introduced - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2525,24 +2527,24 @@ int utcDaliTextFieldSomeSpecialKeys(void) application.Render(); // Generate a Esc key event. The text field should lose the focus. - application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Down, "XF86PowerOff", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Up, "XF86PowerOff", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Generate a Esc key event. The text field should lose the focus. - application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Down, "XF86Menu", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Up, "XF86Menu", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); // Generate a Esc key event. The text field should lose the focus. - application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Down, "XF86Home", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Up, "XF86Home", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -2588,8 +2590,8 @@ int utcDaliTextFieldSizeUpdate(void) DALI_TEST_EQUALS( previousHeight, field.GetProperty( Actor::Property::SIZE_HEIGHT ) , TEST_LOCATION ); // Add another script characters ( glyph height is defferent ) - application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "ㅁ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "ㅁ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.SendNotification(); application.Render(); @@ -2820,3 +2822,14 @@ int UtcDaliTextFieldEnableGrabHandleProperty(void) END_TEST; } + +int UtcDaliTextFieldGetInputMethodContext(void) +{ + ToolkitTestApplication application; + tet_infoline("UtcDaliTextFieldGetInputMethodContext"); + + TextField field = TextField::New(); + DALI_TEST_CHECK( DevelTextField::GetInputMethodContext( field ) ); + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp index d1d35b1..03da3ff 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp @@ -48,9 +48,10 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( }\n ); +const char* fragmentShaderPrefix( "#extension GL_OES_EGL_image_external:require\n" ); const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( varying mediump vec2 vTexCoord;\n - uniform sampler2D sTexture;\n + uniform samplerExternalOES sTexture;\n uniform lowp vec4 uColor;\n \n void main()\n @@ -347,6 +348,12 @@ int UtcDaliVideoViewCustomShaderForCoverage(void) VideoView videoView = VideoView::New(); DALI_TEST_CHECK( videoView ); + ToolkitApplication::DECODED_IMAGES_SUPPORTED = true; + + videoView.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false ); + bool isUnderlay = videoView.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >(); + DALI_TEST_CHECK( !isUnderlay ); + Stage::GetCurrent().Add( videoView ); videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" ); @@ -528,3 +535,61 @@ int UtcDaliVideoViewPropertyDisplayMode(void) END_TEST; } + + +int UtcDaliVideoViewCustomShader(void) +{ + ToolkitTestApplication application; + tet_infoline( "VideoView with custom shader" ); + + VideoView view = VideoView::New(); + DALI_TEST_CHECK( view ); + + ToolkitApplication::DECODED_IMAGES_SUPPORTED = true; + + view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false ); + bool isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >(); + DALI_TEST_CHECK( !isUnderlay ); + + Stage::GetCurrent().Add( view ); + view.SetProperty( VideoView::Property::VIDEO, "testvideo" ); + + /* insert custom shader */ + Property::Map customShader; + std::string fragmentShaderString; + fragmentShaderString.reserve( strlen( fragmentShaderPrefix ) + strlen( FRAGMENT_SHADER ) ); + fragmentShaderString.append( fragmentShaderPrefix ); + fragmentShaderString.append( FRAGMENT_SHADER ); + customShader.Insert( "vertexShader", VERTEX_SHADER ); + customShader.Insert( "fragmentShader", fragmentShaderString ); + + Property::Map map; + map.Insert( "shader", customShader ); + + view.SetProperty( VideoView::Property::VIDEO, map ); + + /* do render for check custom shader */ + Stage::GetCurrent().Add( view ); + view.Play(); + + application.SendNotification(); + application.Render(); + + /* get renderer */ + DALI_TEST_CHECK( view.GetRendererCount() == 1u ); + Renderer renderer = view.GetRendererAt( 0 ); + Shader shader = renderer.GetShader(); + DALI_TEST_CHECK( shader ); + + Property::Value value = shader.GetProperty(Shader::Property::PROGRAM); + Property::Map* shaderMap = value.GetMap(); + DALI_TEST_CHECK( shaderMap ); + + Property::Value* fragment = shaderMap->Find( "fragment" ); // fragment key name from shader-impl.cpp + DALI_TEST_EQUALS( fragmentShaderString, fragment->Get(), TEST_LOCATION ); + + Property::Value* vertex = shaderMap->Find( "vertex" ); // vertex key name from shader-impl.cpp + DALI_TEST_EQUALS( VERTEX_SHADER, vertex->Get(), TEST_LOCATION ); + + END_TEST; +} diff --git a/dali-toolkit/devel-api/controls/control-devel.cpp b/dali-toolkit/devel-api/controls/control-devel.cpp old mode 100644 new mode 100755 index 116f69a..a9a83dd --- a/dali-toolkit/devel-api/controls/control-devel.cpp +++ b/dali-toolkit/devel-api/controls/control-devel.cpp @@ -96,6 +96,11 @@ void DoAction( Control& control, Dali::Property::Index visualIndex, Dali::Proper controlDataImpl.DoAction( visualIndex, actionId, attributes ); } +void SetInputMethodContext( Internal::Control& control, InputMethodContext& inputMethodContext ) +{ + Internal::Control::Impl::Get( control ).SetInputMethodContext( inputMethodContext ); +} + } // namespace DevelControl } // namespace Toolkit diff --git a/dali-toolkit/devel-api/controls/control-devel.h b/dali-toolkit/devel-api/controls/control-devel.h old mode 100644 new mode 100755 index ae90f4d..1fece4f --- a/dali-toolkit/devel-api/controls/control-devel.h +++ b/dali-toolkit/devel-api/controls/control-devel.h @@ -17,6 +17,8 @@ * limitations under the License. * */ +// EXTERNAL INCLUDES +#include // INTERNAL INCLUDES #include @@ -241,6 +243,14 @@ DALI_IMPORT_API Dali::Animation CreateTransition( Internal::Control& control, co */ DALI_IMPORT_API void DoAction( Control& control, Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes ); +/** + * @brief Set input method context. + * + * @param[in] control The control. + * @param[in] inputMethodContext The input method context. + */ +DALI_IMPORT_API void SetInputMethodContext( Internal::Control& control, InputMethodContext& inputMethodContext ); + } // namespace DevelControl } // namespace Toolkit diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp new file mode 100755 index 0000000..875e270 --- /dev/null +++ b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp @@ -0,0 +1,45 @@ +#ifndef DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H +#define DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H + +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelTextEditor +{ + +InputMethodContext GetInputMethodContext( TextEditor textEditor ) +{ + return GetImpl( textEditor ).GetInputMethodContext(); +} + +} // namespace DevelTextEditor + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h old mode 100644 new mode 100755 index 34c1b09..fd2d4bb --- a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h @@ -17,6 +17,8 @@ * limitations under the License. * */ +// EXTERNAL INCLUDES +#include // INTERNAL INCLUDES #include @@ -113,6 +115,14 @@ namespace Property } // namespace Property +/** + * @brief Return the input method context of TextEditor. + * + * @param[in] textEditor The instance of TextEditor. + * @return InputMethodContext instance. + */ +DALI_IMPORT_API InputMethodContext GetInputMethodContext( TextEditor textEditor ); + } // namespace DevelTextEditor } // namespace Toolkit diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp new file mode 100755 index 0000000..c73bb5e --- /dev/null +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp @@ -0,0 +1,45 @@ +#ifndef DALI_TOOLKIT_TEXT_FIELD_DEVEL_H +#define DALI_TOOLKIT_TEXT_FIELD_DEVEL_H + +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelTextField +{ + +InputMethodContext GetInputMethodContext( TextField textField ) +{ + return GetImpl( textField ).GetInputMethodContext(); +} + +} // namespace DevelText + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_TEXT_FIELD_DEVEL_H 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 old mode 100644 new mode 100755 index a5b1df3..5075358 --- a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h @@ -17,6 +17,8 @@ * limitations under the License. * */ +// EXTERNAL INCLUDES +#include // INTERNAL INCLUDES #include @@ -102,6 +104,14 @@ namespace Property }; } // namespace Property +/** + * @brief Return the input method context of TextField. + * + * @param[in] textField The instance of TextField. + * @return InputMethodContext instance. + */ +DALI_IMPORT_API InputMethodContext GetInputMethodContext( TextField textField ); + } // namespace DevelText } // namespace Toolkit diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list old mode 100644 new mode 100755 index 03b3b6e..a04fc74 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -20,6 +20,8 @@ devel_api_src_files = \ $(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/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 \ $(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.cpp \ $(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \ diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index 7f1b441..e5da81e 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -179,10 +179,10 @@ void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::U } else { - // load configuration map - LoadConfiguration( *parser.GetRoot(), mConfigurationMap ); // load constant map (allows the user to override the constants in the json after loading) LoadConstants( *parser.GetRoot(), mReplacementMap ); + // load configuration map + LoadConfiguration( *parser.GetRoot(), mConfigurationMap ); // merge includes if( OptionalChild includes = IsChild(*parser.GetRoot(), KEYNAME_INCLUDES) ) { @@ -797,6 +797,61 @@ void Builder::LoadConfiguration( const TreeNode& root, Property::Map& intoMap ) if( (*iter).second.GetName() ) { DeterminePropertyFromNode( (*iter).second, property, replacer ); + + // If config is string, find constant and replace it to original value. + if( (*iter).second.GetType() == TreeNode::STRING ) + { + std::string stringConfigValue; + if( property.Get( stringConfigValue ) ) + { + std::size_t pos = 0; + + while( pos < stringConfigValue.size() ) + { + // If we can't find "{","}" pair in stringConfigValue, will out loop. + std::size_t leftPos = stringConfigValue.find( "{", pos ); + if( leftPos != std::string::npos ) + { + std::size_t rightPos = stringConfigValue.find( "}", pos+1 ); + + if( rightPos != std::string::npos ) + { + // If we find "{","}" pair but can't find matched constant + // try to find other "{","}" pair after current left position. + pos = leftPos+1; + + for( unsigned int i = 0; i < mReplacementMap.Count() ; i++ ) + { + std::string constant = mReplacementMap.GetKey(i); + + // Compare string which is between "{" and "}" with constant string + // If they are same, change string in stringConfigValue to mapped constant value. + if ( stringConfigValue.compare( leftPos+1, rightPos-leftPos-1,constant) == 0 ) + { + std::string replaceString; + mReplacementMap.GetValue(i).Get( replaceString ); + + stringConfigValue.replace( leftPos, rightPos-leftPos+1, replaceString ); + pos = leftPos + replaceString.size(); + break; + } + } + } + else + { + // If we cannot find constant in const value, will out loop. + pos = stringConfigValue.size(); + } + } + else + { + // If we cannot find constant in const value, will out loop. + pos = stringConfigValue.size(); + } + } + property = Property::Value( stringConfigValue ); + } + } intoMap[ (*iter).second.GetName() ] = property; } } diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp old mode 100644 new mode 100755 index 369c409..af3aac4 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -338,7 +338,6 @@ Control::Impl::Impl( Control& controlImpl ) mIsKeyboardNavigationSupported( false ), mIsKeyboardFocusGroup( false ) { - } Control::Impl::~Impl() @@ -1392,6 +1391,22 @@ Extents Control::Impl::GetPadding() const return mControlImpl.mImpl->mPadding; } +void Control::Impl::SetInputMethodContext( InputMethodContext& inputMethodContext ) +{ + mInputMethodContext = inputMethodContext; +} + +bool Control::Impl::FilterKeyEvent( const KeyEvent& event ) +{ + bool consumed ( false ); + + if ( mInputMethodContext ) + { + consumed = mInputMethodContext.FilterEventKey( event ); + } + return consumed; +} + } // 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 old mode 100644 new mode 100755 index ddd7506..a0ff3d1 --- a/dali-toolkit/internal/controls/control/control-data-impl.h +++ b/dali-toolkit/internal/controls/control/control-data-impl.h @@ -300,6 +300,19 @@ public: */ Extents GetPadding() const; + /** + * @brief Set the input method context. + * @param[in] inputMethodContext The input method context. + */ + void SetInputMethodContext( InputMethodContext& inputMethodContext ); + + /** + * @brief Filter an key event. + * @param[in] event The key to be filtered. + * @return True if the key handled, otherwise false. + */ + bool FilterKeyEvent( const KeyEvent& event ); + private: /** @@ -370,6 +383,8 @@ public: // Tooltip TooltipPtr mTooltip; + InputMethodContext mInputMethodContext; + 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. diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp old mode 100644 new mode 100755 index 20fd25c..80e884a --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -44,6 +44,7 @@ #include #include #include +#include using namespace Dali::Toolkit::Text; @@ -1150,6 +1151,11 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind return value; } +InputMethodContext TextEditor::GetInputMethodContext() +{ + return mInputMethodContext; +} + bool TextEditor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { Dali::BaseHandle handle( object ); @@ -1198,10 +1204,12 @@ void TextEditor::OnInitialize() mDecorator = Text::Decorator::New( *mController, *mController ); + mInputMethodContext = InputMethodContext::New(); + mController->GetLayoutEngine().SetLayout( Layout::Engine::MULTI_LINE_BOX ); // Enables the text input. - mController->EnableTextInput( mDecorator ); + mController->EnableTextInput( mDecorator, mInputMethodContext ); // Enables the vertical scrolling after the text input has been enabled. mController->SetVerticalScrollEnabled( true ); @@ -1222,8 +1230,6 @@ void TextEditor::OnInitialize() EnableGestureDetection( static_cast( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) ); GetTapGestureDetector().SetMaximumTapsRequired( 2 ); - mImfManager = ImfManager::Get(); - self.TouchSignal().Connect( this, &TextEditor::OnTouched ); // Set BoundingBox to stage size if not already set. @@ -1247,6 +1253,8 @@ void TextEditor::OnInitialize() self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); self.OnStageSignal().Connect( this, &TextEditor::OnStageConnect ); + DevelControl::SetInputMethodContext( *this, mInputMethodContext ); + // Creates an extra control to be used as stencil buffer. mStencil = Control::New(); mStencil.SetAnchorPoint( AnchorPoint::TOP_LEFT ); @@ -1434,23 +1442,24 @@ void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType ) void TextEditor::OnKeyInputFocusGained() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnKeyInputFocusGained %p\n", mController.Get() ); + if ( mInputMethodContext ) + { + mInputMethodContext.StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged ); - mImfManager.StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged ); - - mImfManager.EventReceivedSignal().Connect( this, &TextEditor::OnImfEvent ); - - // Notify that the text editing start. - mImfManager.Activate(); + mInputMethodContext.EventReceivedSignal().Connect( this, &TextEditor::OnInputMethodContextEvent ); - // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated. - mImfManager.SetRestoreAfterFocusLost( true ); + // Notify that the text editing start. + mInputMethodContext.Activate(); - ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); + // 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 ) - { - notifier.ContentSelectedSignal().Connect( this, &TextEditor::OnClipboardTextSelected ); - } + if ( notifier ) + { + notifier.ContentSelectedSignal().Connect( this, &TextEditor::OnClipboardTextSelected ); + } mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event @@ -1460,17 +1469,18 @@ void TextEditor::OnKeyInputFocusGained() void TextEditor::OnKeyInputFocusLost() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor:OnKeyInputFocusLost %p\n", mController.Get() ); + if ( mInputMethodContext ) + { + mInputMethodContext.StatusChangedSignal().Disconnect( this, &TextEditor::KeyboardStatusChanged ); - mImfManager.StatusChangedSignal().Disconnect( this, &TextEditor::KeyboardStatusChanged ); - - // The text editing is finished. Therefore the imf manager don't have restore activation. - mImfManager.SetRestoreAfterFocusLost( false ); - - // Notify that the text editing finish. - mImfManager.Deactivate(); + // The text editing is finished. Therefore the InputMethodContext don't have restore activation. + mInputMethodContext.SetRestoreAfterFocusLost( false ); - mImfManager.EventReceivedSignal().Disconnect( this, &TextEditor::OnImfEvent ); + // Notify that the text editing finish. + mInputMethodContext.Deactivate(); + mInputMethodContext.EventReceivedSignal().Disconnect( this, &TextEditor::OnInputMethodContextEvent ); + } ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); if ( notifier ) @@ -1486,9 +1496,10 @@ void TextEditor::OnKeyInputFocusLost() void TextEditor::OnTap( const TapGesture& gesture ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnTap %p\n", mController.Get() ); - - mImfManager.Activate(); - + if ( mInputMethodContext ) + { + mInputMethodContext.Activate(); + } // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); @@ -1504,8 +1515,10 @@ void TextEditor::OnPan( const PanGesture& gesture ) void TextEditor::OnLongPress( const LongPressGesture& gesture ) { - mImfManager.Activate(); - + if ( mInputMethodContext ) + { + mInputMethodContext.Activate(); + } Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top ); @@ -1727,10 +1740,10 @@ void TextEditor::OnStageConnect( Dali::Actor actor ) } } -ImfManager::ImfCallbackData TextEditor::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ) +InputMethodContext::CallbackData TextEditor::OnInputMethodContextEvent( Dali::InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName ); - return mController->OnImfEvent( imfManager, imfEvent ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnInputMethodContextEvent %p eventName %d\n", mController.Get(), inputMethodContextEvent.eventName ); + return mController->OnInputMethodContextEvent( inputMethodContext, inputMethodContextEvent ); } void TextEditor::GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType ) diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.h b/dali-toolkit/internal/controls/text-controls/text-editor-impl.h old mode 100644 new mode 100755 index a3a8854..5595e18 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include #include // INTERNAL INCLUDES @@ -41,7 +42,6 @@ namespace Toolkit namespace Internal { - /** * @brief A control which renders a long text string with styles. */ @@ -75,6 +75,11 @@ public: static Property::Value GetProperty( BaseObject* object, Property::Index index ); /** + * @copydoc Dali::Toollkit::TextEditor::GetInputMethodContext() + */ + InputMethodContext GetInputMethodContext(); + + /** * 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. @@ -194,9 +199,9 @@ private: // From Control private: // Implementation /** - * @copydoc Dali::Toolkit::Text::Controller::(ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent) + * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent) */ - ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ); + InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ); /** * @brief Callback when Clipboard signals an item should be pasted @@ -283,7 +288,7 @@ private: // Data Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal; Toolkit::TextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal; - ImfManager mImfManager; + InputMethodContext mInputMethodContext; Text::ControllerPtr mController; Text::RendererPtr mRenderer; Text::DecoratorPtr mDecorator; diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp old mode 100644 new mode 100755 index 137d0c4..d92be64 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -44,6 +44,7 @@ #include #include #include +#include using namespace Dali::Toolkit::Text; @@ -586,7 +587,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl(); if (control == textField) { - impl.mImfManager.ApplyOptions( impl.mInputMethodOptions ); + impl.mInputMethodContext.ApplyOptions( impl.mInputMethodOptions ); } break; } @@ -1205,6 +1206,11 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde return value; } +InputMethodContext TextField::GetInputMethodContext() +{ + return mInputMethodContext; +} + bool TextField::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { Dali::BaseHandle handle( object ); @@ -1261,10 +1267,12 @@ void TextField::OnInitialize() mDecorator = Text::Decorator::New( *mController, *mController ); + mInputMethodContext = InputMethodContext::New(); + mController->GetLayoutEngine().SetLayout( Layout::Engine::SINGLE_LINE_BOX ); // Enables the text input. - mController->EnableTextInput( mDecorator ); + mController->EnableTextInput( mDecorator, mInputMethodContext ); // Enables the horizontal scrolling after the text input has been enabled. mController->SetHorizontalScrollEnabled( true ); @@ -1282,8 +1290,6 @@ void TextField::OnInitialize() EnableGestureDetection( static_cast( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) ); GetTapGestureDetector().SetMaximumTapsRequired( 2 ); - mImfManager = ImfManager::Get(); - self.TouchSignal().Connect( this, &TextField::OnTouched ); // Set BoundingBox to stage size if not already set. @@ -1304,6 +1310,8 @@ void TextField::OnInitialize() self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); self.OnStageSignal().Connect( this, &TextField::OnStageConnect ); + DevelControl::SetInputMethodContext( *this, mInputMethodContext ); + if( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy ) { EnableClipping(); @@ -1499,25 +1507,26 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType ) void TextField::OnKeyInputFocusGained() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() ); + if ( mInputMethodContext ) + { + mInputMethodContext.ApplyOptions( mInputMethodOptions ); - mImfManager.ApplyOptions( mInputMethodOptions ); - - mImfManager.StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged ); - - mImfManager.EventReceivedSignal().Connect( this, &TextField::OnImfEvent ); + mInputMethodContext.StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged ); - // Notify that the text editing start. - mImfManager.Activate(); + mInputMethodContext.EventReceivedSignal().Connect( this, &TextField::OnInputMethodContextEvent ); - // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated. - mImfManager.SetRestoreAfterFocusLost( true ); + // Notify that the text editing start. + mInputMethodContext.Activate(); - ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); + // 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 ) - { - notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected ); - } + if ( notifier ) + { + notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected ); + } mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event @@ -1527,16 +1536,17 @@ void TextField::OnKeyInputFocusGained() void TextField::OnKeyInputFocusLost() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField:OnKeyInputFocusLost %p\n", mController.Get() ); + if ( mInputMethodContext ) + { + mInputMethodContext.StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged ); + // The text editing is finished. Therefore the inputMethodContext don't have restore activation. + mInputMethodContext.SetRestoreAfterFocusLost( false ); - mImfManager.StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged ); - // The text editing is finished. Therefore the imf manager don't have restore activation. - mImfManager.SetRestoreAfterFocusLost( false ); - - // Notify that the text editing finish. - mImfManager.Deactivate(); - - mImfManager.EventReceivedSignal().Disconnect( this, &TextField::OnImfEvent ); + // Notify that the text editing finish. + mInputMethodContext.Deactivate(); + mInputMethodContext.EventReceivedSignal().Disconnect( this, &TextField::OnInputMethodContextEvent ); + } ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); if ( notifier ) @@ -1552,9 +1562,10 @@ void TextField::OnKeyInputFocusLost() void TextField::OnTap( const TapGesture& gesture ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get() ); - - mImfManager.Activate(); - + if ( mInputMethodContext ) + { + mInputMethodContext.Activate(); + } // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); @@ -1570,8 +1581,10 @@ void TextField::OnPan( const PanGesture& gesture ) void TextField::OnLongPress( const LongPressGesture& gesture ) { - mImfManager.Activate(); - + if ( mInputMethodContext ) + { + mInputMethodContext.Activate(); + } Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top ); @@ -1699,10 +1712,10 @@ void TextField::OnStageConnect( Dali::Actor actor ) } } -ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ) +InputMethodContext::CallbackData TextField::OnInputMethodContextEvent( Dali::InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName ); - return mController->OnImfEvent( imfManager, imfEvent ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnInputMethodContextEvent %p eventName %d\n", mController.Get(), inputMethodContextEvent.eventName ); + return mController->OnInputMethodContextEvent( inputMethodContext, inputMethodContextEvent ); } void TextField::GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType ) diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.h b/dali-toolkit/internal/controls/text-controls/text-field-impl.h old mode 100644 new mode 100755 index b8f49ee..495f789 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -38,7 +39,6 @@ namespace Toolkit namespace Internal { - /** * @brief A control which renders a short text string. */ @@ -72,6 +72,11 @@ public: static Property::Value GetProperty( BaseObject* object, Property::Index index ); /** + * @copydoc Dali::Toollkit::TextField::GetInputMethodContext() + */ + InputMethodContext GetInputMethodContext(); + + /** * 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. @@ -191,9 +196,9 @@ private: // From Control private: // Implementation /** - * @copydoc Dali::Toolkit::Text::Controller::(ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent) + * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent) */ - ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ); + InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ); /** * @brief Callback when Clipboard signals an item should be pasted @@ -265,7 +270,7 @@ private: // Data Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal; Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal; - ImfManager mImfManager; + InputMethodContext mInputMethodContext; Text::ControllerPtr mController; Text::RendererPtr mRenderer; Text::DecoratorPtr mDecorator; 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 1e6da13..baacf73 100755 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp @@ -32,11 +32,6 @@ // INTERNAL INCLUDES #include -#include -#include -#include -#include -#include #include namespace Dali @@ -84,6 +79,12 @@ const char* const RENDERING_TARGET( "renderingTarget" ); const char* const WINDOW_SURFACE_TARGET( "windowSurfaceTarget" ); const char* const NATIVE_IMAGE_TARGET( "nativeImageTarget" ); +const char* const CUSTOM_SHADER( "shader" ); +const char* const CUSTOM_VERTEX_SHADER( "vertexShader" ); +const char* const CUSTOM_FRAGMENT_SHADER( "fragmentShader" ); +const char* const DEFAULT_SAMPLER_TYPE_NAME( "sampler2D" ); +const char* const CUSTOM_SAMPLER_TYPE_NAME( "samplerExternalOES" ); + const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform mediump mat4 uMvpMatrix;\n @@ -98,12 +99,33 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( ); const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( - uniform lowp vec4 uColor;\n - uniform lowp vec3 mixColor;\n \n void main()\n {\n - gl_FragColor = vec4(mixColor, 1.0)*uColor;\n + gl_FragColor = vec4(0.0);\n + }\n +); + +const char* VERTEX_SHADER_TEXTURE = DALI_COMPOSE_SHADER( + attribute mediump vec2 aPosition;\n + varying mediump vec2 vTexCoord;\n + uniform mediump mat4 uMvpMatrix;\n + uniform mediump vec3 uSize;\n + varying mediump vec2 sTexCoordRect;\n + void main()\n + {\n + gl_Position = uMvpMatrix * vec4(aPosition * uSize.xy, 0.0, 1.0);\n + vTexCoord = aPosition + vec2(0.5);\n + }\n +); + +const char* FRAGMENT_SHADER_TEXTURE = DALI_COMPOSE_SHADER( + uniform lowp vec4 uColor;\n + varying mediump vec2 vTexCoord;\n + uniform samplerExternalOES sTexture;\n + void main()\n + {\n + gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n }\n ); @@ -140,17 +162,8 @@ void VideoView::OnInitialize() void VideoView::SetUrl( const std::string& url ) { - if( mUrl != url || !mPropertyMap.Empty() ) - { mUrl = url; mPropertyMap.Clear(); - } - - if( !mIsUnderlay ) - { - Actor self( Self() ); - Internal::InitializeVisual( self, mVisual, mNativeImage ); - } mVideoPlayer.SetUrl( mUrl ); } @@ -159,29 +172,6 @@ void VideoView::SetPropertyMap( Property::Map map ) { mPropertyMap = map; - Actor self( Self() ); - Internal::InitializeVisual( self, mVisual, mPropertyMap ); - - Property::Value* widthValue = mPropertyMap.Find( "width" ); - if( widthValue ) - { - int width; - if( widthValue->Get( width ) ) - { - mVideoSize = ImageDimensions( width, mVideoSize.GetHeight() ); - } - } - - Property::Value* heightValue = mPropertyMap.Find( "height" ); - if( heightValue ) - { - int height; - if( heightValue->Get( height ) ) - { - mVideoSize = ImageDimensions( mVideoSize.GetWidth(), height ); - } - } - Property::Value* target = map.Find( RENDERING_TARGET ); std::string targetType; @@ -196,6 +186,24 @@ void VideoView::SetPropertyMap( Property::Map map ) SetNativeImageTarget(); } + // Custom shader + Property::Value* shaderValue; + if( !map.Empty() ) + { + shaderValue = map.Find( CUSTOM_SHADER ); + + if( shaderValue ) + { + mEffectPropertyMap = *( shaderValue->GetMap() ); + } + } + + if( mTextureRenderer && !mEffectPropertyMap.Empty() ) + { + Dali::Shader shader = CreateShader(); + mTextureRenderer.SetShader( shader ); + } + RelayoutRequest(); } @@ -204,7 +212,7 @@ std::string VideoView::GetUrl() return mUrl; } -void VideoView::SetLooping(bool looping) +void VideoView::SetLooping( bool looping ) { mVideoPlayer.SetLooping( looping ); } @@ -218,7 +226,7 @@ void VideoView::Play() { if( mIsUnderlay ) { - Self().AddRenderer( mRenderer ); + Self().AddRenderer( mOverlayRenderer ); } mVideoPlayer.Play(); @@ -285,7 +293,7 @@ void VideoView::EmitSignalFinish() { if( mIsUnderlay ) { - Self().RemoveRenderer( mRenderer ); + Self().RemoveRenderer( mOverlayRenderer ); } if ( !mFinishedSignal.Empty() ) @@ -387,27 +395,8 @@ void VideoView::SetProperty( BaseObject* object, Property::Index index, const Pr } else if( value.Get( map ) ) { - Property::Value* shaderValue = map.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER ); - - if( map.Count() > 1u || !shaderValue ) - { impl.SetPropertyMap( map ); } - else if( impl.mVisual && map.Count() == 1u && shaderValue ) - { - Property::Map shaderMap; - if( shaderValue->Get( shaderMap ) ) - { - Internal::Visual::Base& visual = Toolkit::GetImplementation( impl.mVisual ); - visual.SetCustomShader( shaderMap ); - if( videoView.OnStage() ) - { - visual.SetOffStage( videoView ); - visual.SetOnStage( videoView ); - } - } - } - } break; } case Toolkit::VideoView::Property::LOOPING: @@ -541,31 +530,19 @@ Property::Value VideoView::GetProperty( BaseObject* object, Property::Index prop void VideoView::SetDepthIndex( int depthIndex ) { - if( mVisual ) + if( mTextureRenderer ) { - mVisual.SetDepthIndex( depthIndex ); + mTextureRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, depthIndex ); } } void VideoView::OnStageConnection( int depth ) { - if( mVisual ) - { - CustomActor self = Self(); - Toolkit::GetImplementation(mVisual).SetOnStage( self ); - } - Control::OnStageConnection( depth ); } void VideoView::OnStageDisconnection() { - if( mVisual ) - { - CustomActor self = Self(); - Toolkit::GetImplementation(mVisual).SetOffStage( self ); - } - Control::OnStageDisconnection(); } @@ -615,12 +592,6 @@ void VideoView::SetWindowSurfaceTarget() Actor self = Self(); int curPos = mVideoPlayer.GetPlayPosition(); - if( mVisual ) - { - Toolkit::GetImplementation(mVisual).SetOffStage(self); - mVisual.Reset(); - } - if( mIsPlay ) { mVideoPlayer.Pause(); @@ -633,21 +604,21 @@ void VideoView::SetWindowSurfaceTarget() mSizeUpdateNotification.NotifySignal().Connect( this, &VideoView::UpdateDisplayArea ); mScaleUpdateNotification.NotifySignal().Connect( this, &VideoView::UpdateDisplayArea ); + if( mTextureRenderer ) + { + self.RemoveRenderer( mTextureRenderer ); + } + mVideoPlayer.SetRenderingTarget( Dali::Adaptor::Get().GetNativeWindowHandle() ); mVideoPlayer.SetUrl( mUrl ); - if( !mRenderer ) + if( !mOverlayRenderer ) { // For underlay rendering mode, video display area have to be transparent. Geometry geometry = VisualFactoryCache::CreateQuadGeometry(); Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ); - mRenderer = Renderer::New( geometry, shader ); - - mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON ); - mRenderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE ); - mRenderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ZERO ); - mRenderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA, BlendFactor::ONE ); - mRenderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ZERO ); + mOverlayRenderer = Renderer::New( geometry, shader ); + mOverlayRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::OFF ); } if( mIsPlay ) @@ -676,8 +647,11 @@ void VideoView::SetNativeImageTarget() } Actor self( Self() ); - self.RemoveRenderer( mRenderer ); - Dali::Stage::GetCurrent().KeepRendering( 0.0f ); + + if( mOverlayRenderer ) + { + self.RemoveRenderer( mOverlayRenderer ); + } self.RemovePropertyNotification( mPositionUpdateNotification ); self.RemovePropertyNotification( mSizeUpdateNotification ); @@ -687,14 +661,28 @@ void VideoView::SetNativeImageTarget() Any source; Dali::NativeImageSourcePtr nativeImageSourcePtr = Dali::NativeImageSource::New( source ); - mNativeImage = Dali::NativeImage::New( *nativeImageSourcePtr ); + mNativeTexture = Dali::Texture::New( *nativeImageSourcePtr ); + + if( !mTextureRenderer ) + { + Dali::Geometry geometry = VisualFactoryCache::CreateQuadGeometry(); + Dali::Shader shader = CreateShader(); + Dali::TextureSet textureSet = Dali::TextureSet::New(); + textureSet.SetTexture( 0u, mNativeTexture ); + + mTextureRenderer = Renderer::New( geometry, shader ); + mTextureRenderer.SetTextures( textureSet ); + } + else + { + Dali::TextureSet textureSet = mTextureRenderer.GetTextures(); + textureSet.SetTexture( 0u, mNativeTexture ); + } + Self().AddRenderer( mTextureRenderer ); mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr ); mVideoPlayer.SetUrl( mUrl ); - Internal::InitializeVisual( self, mVisual, mNativeImage ); - Self().RemoveRenderer( mRenderer ); - if( mIsPlay ) { Play(); @@ -787,6 +775,62 @@ int VideoView::GetDisplayMode() const return static_cast< int >( mVideoPlayer.GetDisplayMode() ); } +Dali::Shader VideoView::CreateShader() +{ + std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n"; + std::string vertexShader; + std::string customFragmentShader; + bool checkShader = false; + + if( !mEffectPropertyMap.Empty() ) + { + Property::Value* vertexShaderValue = mEffectPropertyMap.Find( CUSTOM_VERTEX_SHADER ); + if( vertexShaderValue ) + { + checkShader = GetStringFromProperty( *vertexShaderValue, vertexShader ); + } + + if( !vertexShaderValue || !checkShader ) + { + vertexShader = VERTEX_SHADER_TEXTURE; + } + + Property::Value* fragmentShaderValue = mEffectPropertyMap.Find( CUSTOM_FRAGMENT_SHADER ); + if( fragmentShaderValue ) + { + checkShader = GetStringFromProperty( *fragmentShaderValue, customFragmentShader ); + + if( checkShader ) + { + fragmentShader = customFragmentShader; + } + } + + if( !fragmentShaderValue || !checkShader ) + { + fragmentShader += FRAGMENT_SHADER_TEXTURE; + } + } + else + { + vertexShader = VERTEX_SHADER_TEXTURE; + fragmentShader += FRAGMENT_SHADER_TEXTURE; + } + + return Dali::Shader::New( vertexShader, fragmentShader ); +} + +bool VideoView::GetStringFromProperty( const Dali::Property::Value& value, std::string& output ) +{ + bool extracted = false; + if( value.Get( output ) ) + { + extracted = true; + } + + return extracted; +} + } // namespace Internal } // namespace toolkit 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 728539a..bed7c9f 100755 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.h +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.h @@ -25,9 +25,11 @@ #include #include #include +#include +#include +#include // INTERNAL INCLUDES -#include #include #include @@ -283,26 +285,49 @@ private: // From Control private: - // Undefined + /** + * @brief Construct a new VideoView. + */ VideoView( const VideoView& videoView ); + // Undefined assignment operator. VideoView& operator=( const VideoView& videoView ); + /** + * @brief SetWindowSurfaceTarget for underlay video playback. + */ void SetWindowSurfaceTarget(); + /** + * @brief SetNativeImageTarget for native image video playback. + */ void SetNativeImageTarget(); + /** + * @brief CreateShader for native image target + */ + Dali::Shader CreateShader(); + + /** + * @brief Checks whether the property has a string value. + * @param Property value + * @param String output + * @return true if the output was found + */ + bool GetStringFromProperty( const Dali::Property::Value& value, std::string& output ); + private: Dali::VideoPlayer mVideoPlayer; Dali::ImageDimensions mVideoSize; - Toolkit::Visual::Base mVisual; Dali::Property::Map mPropertyMap; - Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming + Dali::Property::Map mEffectPropertyMap; + Dali::Texture mNativeTexture; Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal; std::string mUrl; Dali::DisplayArea mDisplayArea; - Dali::Renderer mRenderer; + Dali::Renderer mOverlayRenderer; + Dali::Renderer mTextureRenderer; Dali::PropertyNotification mPositionUpdateNotification; Dali::PropertyNotification mSizeUpdateNotification; Dali::PropertyNotification mScaleUpdateNotification; diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp old mode 100644 new mode 100755 index 5f34488..caefc0c --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -67,9 +67,9 @@ namespace Toolkit namespace Text { -EventData::EventData( DecoratorPtr decorator ) +EventData::EventData( DecoratorPtr decorator, InputMethodContext& inputMethodContext ) : mDecorator( decorator ), - mImfManager(), + mInputMethodContext( inputMethodContext ), mPlaceholderFont( NULL ), mPlaceholderTextActive(), mPlaceholderTextInactive(), @@ -112,7 +112,6 @@ EventData::EventData( DecoratorPtr decorator ) mPlaceholderEllipsisFlag( false ), mShiftSelectionFlag( true ) { - mImfManager = ImfManager::Get(); } EventData::~EventData() @@ -180,7 +179,7 @@ bool Controller::Impl::ProcessInputEvents() if( mEventData->mUpdateCursorPosition || mEventData->mUpdateHighlightBox ) { - NotifyImfManager(); + NotifyInputMethodContext(); } // The cursor must also be repositioned after inserts into the model @@ -329,9 +328,9 @@ bool Controller::Impl::ProcessInputEvents() return decoratorUpdated; } -void Controller::Impl::NotifyImfManager() +void Controller::Impl::NotifyInputMethodContext() { - if( mEventData && mEventData->mImfManager ) + if( mEventData && mEventData->mInputMethodContext ) { CharacterIndex cursorPosition = GetLogicalCursorPosition(); @@ -347,17 +346,17 @@ void Controller::Impl::NotifyImfManager() cursorPosition -= numberOfWhiteSpaces; } - mEventData->mImfManager.SetCursorPosition( cursorPosition ); - mEventData->mImfManager.NotifyCursorPosition(); + mEventData->mInputMethodContext.SetCursorPosition( cursorPosition ); + mEventData->mInputMethodContext.NotifyCursorPosition(); } } -void Controller::Impl::NotifyImfMultiLineStatus() +void Controller::Impl::NotifyInputMethodContextMultiLineStatus() { - if ( mEventData ) + if ( mEventData && mEventData->mInputMethodContext ) { Text::Layout::Engine::Type layout = mLayoutEngine.GetLayout(); - mEventData->mImfManager.NotifyTextInputMultiLine( layout == Text::Layout::Engine::MULTI_LINE_BOX ); + mEventData->mInputMethodContext.NotifyTextInputMultiLine( layout == Text::Layout::Engine::MULTI_LINE_BOX ); } } @@ -1320,11 +1319,11 @@ void Controller::Impl::OnCursorKeyEvent( const Event& event ) if ( selecting ) { - // Notify the cursor position to the imf manager. - if( mEventData->mImfManager ) + // Notify the cursor position to the InputMethodContext. + if( mEventData->mInputMethodContext ) { - mEventData->mImfManager.SetCursorPosition( mEventData->mPrimaryCursorPosition ); - mEventData->mImfManager.NotifyCursorPosition(); + mEventData->mInputMethodContext.SetCursorPosition( mEventData->mPrimaryCursorPosition ); + mEventData->mInputMethodContext.NotifyCursorPosition(); } ChangeState( EventData::SELECTING ); @@ -1396,11 +1395,11 @@ void Controller::Impl::OnTapEvent( const Event& event ) mEventData->mScrollAfterUpdatePosition = true; mEventData->mUpdateInputStyle = true; - // Notify the cursor position to the imf manager. - if( mEventData->mImfManager ) + // Notify the cursor position to the InputMethodContext. + if( mEventData->mInputMethodContext ) { - mEventData->mImfManager.SetCursorPosition( mEventData->mPrimaryCursorPosition ); - mEventData->mImfManager.NotifyCursorPosition(); + mEventData->mInputMethodContext.SetCursorPosition( mEventData->mPrimaryCursorPosition ); + mEventData->mInputMethodContext.NotifyCursorPosition(); } } else if( 2u == tapCount ) @@ -2418,8 +2417,8 @@ void Controller::Impl::RepositionSelectionHandles( float visualX, float visualY, mEventData->mUpdateRightSelectionPosition = true; mEventData->mUpdateHighlightBox = true; - // It may happen an IMF commit event arrives before the selection event - // if the IMF manager is in pre-edit state. The commit event will set the + // It may happen an InputMethodContext commit event arrives before the selection event + // if the InputMethodContext is in pre-edit state. The commit event will set the // mEventData->mUpdateCursorPosition flag to true. If it's not set back // to false, the highlight box won't be updated. mEventData->mUpdateCursorPosition = false; diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h old mode 100644 new mode 100755 index 52dad25..34601f5 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -97,7 +97,7 @@ struct EventData TEXT_PANNING }; - EventData( DecoratorPtr decorator ); + EventData( DecoratorPtr decorator, InputMethodContext& inputMethodContext ); ~EventData(); @@ -107,7 +107,7 @@ struct EventData } DecoratorPtr mDecorator; ///< Pointer to the decorator. - ImfManager mImfManager; ///< The Input Method Framework Manager. + InputMethodContext mInputMethodContext; ///< The Input Method Framework Manager. FontDefaults* mPlaceholderFont; ///< The placeholder default font. std::string mPlaceholderTextActive; ///< The text to display when the TextField is empty with key-input focus. std::string mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive. @@ -455,14 +455,14 @@ struct Controller::Impl } } - void ResetImfManager() + void ResetInputMethodContext() { if( mEventData ) { // Reset incase we are in a pre-edit state. - if( mEventData->mImfManager ) + if( mEventData->mInputMethodContext ) { - mEventData->mImfManager.Reset(); // Will trigger a message ( commit, get surrounding ) + mEventData->mInputMethodContext.Reset(); // Will trigger a message ( commit, get surrounding ) } ClearPreEditFlag(); @@ -470,14 +470,14 @@ struct Controller::Impl } /** - * @brief Helper to notify IMF manager with surrounding text & cursor changes. + * @brief Helper to notify InputMethodContext with surrounding text & cursor changes. */ - void NotifyImfManager(); + void NotifyInputMethodContext(); /** - * @brief Helper to notify IMF manager with multi line status. + * @brief Helper to notify InputMethodContext with multi line status. */ - void NotifyImfMultiLineStatus(); + void NotifyInputMethodContextMultiLineStatus(); /** * @brief Retrieve the current cursor position. diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 21e68e6..7192281 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -138,7 +138,7 @@ ControllerPtr Controller::New( ControlInterface* controlInterface, // public : Configure the text controller. -void Controller::EnableTextInput( DecoratorPtr decorator ) +void Controller::EnableTextInput( DecoratorPtr decorator, InputMethodContext& inputMethodContext ) { if( !decorator ) { @@ -151,7 +151,7 @@ void Controller::EnableTextInput( DecoratorPtr decorator ) if( NULL == mImpl->mEventData ) { - mImpl->mEventData = new EventData( decorator ); + mImpl->mEventData = new EventData( decorator, inputMethodContext ); } } @@ -493,7 +493,7 @@ void Controller::SetText( const std::string& text ) DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" ); // Reset keyboard as text changed - mImpl->ResetImfManager(); + mImpl->ResetInputMethodContext(); // Remove the previously set text and style. ResetText(); @@ -2396,7 +2396,7 @@ void Controller::KeyboardFocusGainEvent() mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. mImpl->mEventData->mUpdateInputStyle = true; } - mImpl->NotifyImfMultiLineStatus(); + mImpl->NotifyInputMethodContextMultiLineStatus(); if( mImpl->IsShowingPlaceholderText() ) { // Show alternative placeholder-text when editing @@ -2555,7 +2555,7 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) } else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode ) { - // DALI_KEY_SHIFT_LEFT is the key code for the Left Shift. It's sent (by the imf?) when the predictive text is enabled + // DALI_KEY_SHIFT_LEFT is the key code for the Left Shift. It's sent (by the InputMethodContext?) when the predictive text is enabled // and a character is typed after the type of a upper case latin character. // Do nothing. @@ -2571,7 +2571,7 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() ); - // IMF manager is no longer handling key-events + // InputMethodContext is no longer handling key-events mImpl->ClearPreEditFlag(); InsertText( keyString, COMMIT ); @@ -2588,9 +2588,9 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) ( Dali::DALI_KEY_VOLUME_UP != keyCode ) && ( Dali::DALI_KEY_VOLUME_DOWN != keyCode ) ) { - // Should not change the state if the key is the shift send by the imf manager. + // Should not change the state if the key is the shift send by the InputMethodContext. // Otherwise, when the state is SELECTING the text controller can't send the right - // surrounding info to the imf. + // surrounding info to the InputMethodContext. mImpl->ChangeState( EventData::EDITING ); // Will request for relayout. @@ -2687,7 +2687,7 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y ) } // Reset keyboard as tap event has occurred. - mImpl->ResetImfManager(); + mImpl->ResetInputMethodContext(); } void Controller::PanEvent( Gesture::State state, const Vector2& displacement ) @@ -2737,8 +2737,8 @@ void Controller::LongPressEvent( Gesture::State state, float x, float y ) } else if( !mImpl->IsClipboardVisible() ) { - // Reset the imf manager to commit the pre-edit before selecting the text. - mImpl->ResetImfManager(); + // Reset the InputMethodContext to commit the pre-edit before selecting the text. + mImpl->ResetInputMethodContext(); Event event( Event::LONG_PRESS_EVENT ); event.p1.mInt = state; @@ -2753,35 +2753,35 @@ void Controller::LongPressEvent( Gesture::State state, float x, float y ) } } -ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ) +InputMethodContext::CallbackData Controller::OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ) { // Whether the text needs to be relaid-out. bool requestRelayout = false; - // Whether to retrieve the text and cursor position to be sent to the IMF manager. + // Whether to retrieve the text and cursor position to be sent to the InputMethodContext. bool retrieveText = false; bool retrieveCursor = false; - switch( imfEvent.eventName ) + switch( inputMethodContextEvent.eventName ) { - case ImfManager::COMMIT: + case InputMethodContext::COMMIT: { - InsertText( imfEvent.predictiveString, Text::Controller::COMMIT ); + InsertText( inputMethodContextEvent.predictiveString, Text::Controller::COMMIT ); requestRelayout = true; retrieveCursor = true; break; } - case ImfManager::PREEDIT: + case InputMethodContext::PRE_EDIT: { - InsertText( imfEvent.predictiveString, Text::Controller::PRE_EDIT ); + InsertText( inputMethodContextEvent.predictiveString, Text::Controller::PRE_EDIT ); requestRelayout = true; retrieveCursor = true; break; } - case ImfManager::DELETESURROUNDING: + case InputMethodContext::DELETE_SURROUNDING: { - const bool textDeleted = RemoveText( imfEvent.cursorOffset, - imfEvent.numberOfChars, + const bool textDeleted = RemoveText( inputMethodContextEvent.cursorOffset, + inputMethodContextEvent.numberOfChars, DONT_UPDATE_INPUT_STYLE ); if( textDeleted ) @@ -2802,20 +2802,20 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons } break; } - case ImfManager::GETSURROUNDING: + case InputMethodContext::GET_SURROUNDING: { retrieveText = true; retrieveCursor = true; break; } - case ImfManager::PRIVATECOMMAND: + case InputMethodContext::PRIVATE_COMMAND: { // PRIVATECOMMAND event is just for getting the private command message retrieveText = true; retrieveCursor = true; break; } - case ImfManager::VOID: + case InputMethodContext::VOID: { // do nothing break; @@ -2863,7 +2863,7 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons } } - ImfManager::ImfCallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false ); + InputMethodContext::CallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false ); if( requestRelayout && ( NULL != mImpl->mEditableControlInterface ) ) @@ -2882,7 +2882,7 @@ void Controller::PasteClipboardItemEvent() std::string stringToPaste( notifier.GetContent() ); // Commit the current pre-edit text; the contents of the clipboard should be appended - mImpl->ResetImfManager(); + mImpl->ResetInputMethodContext(); // Temporary disable hiding clipboard mImpl->SetClipboardHideEnable( false ); @@ -3074,7 +3074,7 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ // TODO: At the moment the underline runs are only for pre-edit. mImpl->mModel->mVisualModel->mUnderlineRuns.Clear(); - // Remove the previous IMF pre-edit. + // Remove the previous InputMethodContext pre-edit. if( mImpl->mEventData->mPreEditFlag && ( 0u != mImpl->mEventData->mPreEditLength ) ) { removedPrevious = RemoveText( -static_cast( mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition ), @@ -3121,10 +3121,10 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ mImpl->ChangeState( EventData::EDITING ); - // Handle the IMF (predicitive text) state changes + // Handle the InputMethodContext (predicitive text) state changes if( COMMIT == type ) { - // IMF manager is no longer handling key-events + // InputMethodContext is no longer handling key-events mImpl->ClearPreEditFlag(); } else // PRE_EDIT @@ -3298,7 +3298,7 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "MaxLengthReached (%d)\n", mImpl->mModel->mLogicalModel->mText.Count() ); - mImpl->ResetImfManager(); + mImpl->ResetInputMethodContext(); if( NULL != mImpl->mEditableControlInterface ) { @@ -3832,7 +3832,7 @@ bool Controller::DeleteEvent( int keyCode ) return removed; } - // IMF manager is no longer handling key-events + // InputMethodContext is no longer handling key-events mImpl->ClearPreEditFlag(); if( EventData::SELECTING == mImpl->mEventData->mState ) diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index b2321c4..92677f2 100755 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include #include // INTERNAL INCLUDES @@ -88,7 +88,7 @@ public: // Enumerated types. }; /** - * @brief Used to distinguish between regular key events and IMF events + * @brief Used to distinguish between regular key events and InputMethodContext events */ enum InsertType { @@ -179,8 +179,9 @@ public: // Configure the text controller. * * @note Selectable or editable controls should call this once after Controller::New(). * @param[in] decorator Used to create cursor, selection handle decorations etc. + * @param[in] inputMethodContext Used to manager ime. */ - void EnableTextInput( DecoratorPtr decorator ); + void EnableTextInput( DecoratorPtr decorator, InputMethodContext& inputMethodContext ); /** * @brief Used to switch between bitmap & vector based glyphs @@ -1278,7 +1279,7 @@ public: // Text-input Event Queuing. * @brief Called by editable UI controls when key events are received. * * @param[in] event The key event. - * @param[in] type Used to distinguish between regular key events and IMF events. + * @param[in] type Used to distinguish between regular key events and InputMethodContext events. */ bool KeyEvent( const Dali::KeyEvent& event ); @@ -1308,13 +1309,13 @@ public: // Text-input Event Queuing. void LongPressEvent( Gesture::State state, float x, float y ); /** - * @brief Event received from IMF manager + * @brief Event received from input method context * - * @param[in] imfManager The IMF manager. - * @param[in] imfEvent The event received. + * @param[in] inputMethodContext The input method context. + * @param[in] inputMethodContextEvent The event received. * @return A data struture indicating if update is needed, cursor position and current text. */ - ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ); + InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ); /** * @brief Event from Clipboard notifying an Item has been selected for pasting @@ -1365,7 +1366,7 @@ private: // Update. * @brief Called by editable UI controls when key events are received. * * @param[in] text The text to insert. - * @param[in] type Used to distinguish between regular key events and IMF events. + * @param[in] type Used to distinguish between regular key events and InputMethodContext events. */ void InsertText( const std::string& text, InsertType type ); diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 6aaa271..0e4f018 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -623,7 +623,7 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize ) } else { - Image brokenImage = VisualFactoryCache::GetBrokenVisualImage(); + Image brokenImage = mFactoryCache.GetBrokenVisualImage(); naturalSize.x = brokenImage.GetWidth(); naturalSize.y = brokenImage.GetWidth(); @@ -1097,7 +1097,7 @@ void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, Textur } else { - Image brokenImage = VisualFactoryCache::GetBrokenVisualImage(); + Image brokenImage = mFactoryCache.GetBrokenVisualImage(); textureSet = TextureSet::New(); mImpl->mRenderer.SetTextures( textureSet ); diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 971c73d..618c466 100755 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -584,7 +584,7 @@ void NPatchVisual::ApplyTextureAndUniforms() DALI_LOG_ERROR("The N patch image '%s' is not a valid N patch image\n", mImageUrl.GetUrl().c_str() ); textureSet = TextureSet::New(); - Image croppedImage = VisualFactoryCache::GetBrokenVisualImage(); + Image croppedImage = mFactoryCache.GetBrokenVisualImage(); TextureSetImage( textureSet, 0u, croppedImage ); mImpl->mRenderer.RegisterProperty( "uFixed[0]", Vector2::ZERO ); mImpl->mRenderer.RegisterProperty( "uFixed[1]", Vector2::ZERO ); diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index 1ec606c..39e180b 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -83,7 +83,6 @@ Debug::Filter* gTextureManagerLogFilter = Debug::Filter::New( Debug::NoLogging, const uint32_t DEFAULT_ATLAS_SIZE( 1024u ); ///< This size can fit 8 by 8 images of average size 128 * 128 const Vector4 FULL_ATLAS_RECT( 0.0f, 0.0f, 1.0f, 1.0f ); ///< UV Rectangle that covers the full Texture -const char * const BROKEN_IMAGE_URL( DALI_IMAGE_DIR "broken.png" ); ///< URL For the broken image placeholder const int INVALID_INDEX( -1 ); ///< Invalid index used to represent a non-existant TextureInfo struct const int INVALID_CACHE_INDEX( -1 ); ///< Invalid Cache index @@ -116,6 +115,7 @@ TextureManager::MaskingData::MaskingData() TextureManager::TextureManager() : mAsyncLocalLoaders( GetNumberOfLocalLoaderThreads(), [&]() { return AsyncLoadingHelper(*this); } ), mAsyncRemoteLoaders( GetNumberOfRemoteLoaderThreads(), [&]() { return AsyncLoadingHelper(*this); } ), + mBrokenImageUrl(""), mCurrentTextureId( 0 ) { } @@ -176,7 +176,7 @@ TextureSet TextureManager::LoadTexture( { // use broken image textureSet = TextureSet::New(); - Devel::PixelBuffer pixelBuffer = LoadImageFromFile( BROKEN_IMAGE_URL ); + Devel::PixelBuffer pixelBuffer = LoadImageFromFile( mBrokenImageUrl ); if( pixelBuffer ) { PreMultiply( pixelBuffer, preMultiplyOnLoad ); @@ -1065,6 +1065,11 @@ void TextureManager::AsyncLoadingHelper::AsyncLoadComplete(uint32_t id mTextureManager.AsyncLoadComplete(mLoadingInfoContainer, id, pixelBuffer); } +void TextureManager::SetBrokenImageUrl(const std::string& brokenImageUrl) +{ + mBrokenImageUrl = brokenImageUrl; +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.h b/dali-toolkit/internal/visuals/texture-manager-impl.h index b8c6ab8..e56fec4 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.h +++ b/dali-toolkit/internal/visuals/texture-manager-impl.h @@ -355,6 +355,12 @@ public: */ void RemoveObserver( TextureManager::LifecycleObserver& observer ); + /** + * @brief Set an image to be used when a visual has failed to correctly render + * @param[in] brokenImageUrl The broken image url. + */ + void SetBrokenImageUrl(const std::string& brokenImageUrl); + private: /** @@ -737,6 +743,7 @@ private: // Member Variables: RoundRobinContainerView< AsyncLoadingHelper > mAsyncRemoteLoaders; ///< The Asynchronous image loaders used to provide all remote async loads std::vector< ExternalTextureInfo > mExternalTextures; ///< Externally provided textures Dali::Vector mLifecycleObservers; ///< Lifecycle observers of texture manager + std::string mBrokenImageUrl; ///< Broken image url TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation }; diff --git a/dali-toolkit/internal/visuals/visual-factory-cache.cpp b/dali-toolkit/internal/visuals/visual-factory-cache.cpp index 307791b..101e696 100644 --- a/dali-toolkit/internal/visuals/visual-factory-cache.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-cache.cpp @@ -26,6 +26,7 @@ #include #include + namespace { const char * const BROKEN_VISUAL_IMAGE_URL( DALI_IMAGE_DIR "broken.png"); @@ -42,6 +43,7 @@ namespace Internal VisualFactoryCache::VisualFactoryCache( bool preMultiplyOnLoad ) : mSvgRasterizeThread( NULL ), + mBrokenImageUrl(""), mPreMultiplyOnLoad( preMultiplyOnLoad ) { } @@ -107,7 +109,7 @@ ImageAtlasManagerPtr VisualFactoryCache::GetAtlasManager() if( !mAtlasManager ) { mAtlasManager = new ImageAtlasManager(); - mAtlasManager->SetBrokenImage( BROKEN_VISUAL_IMAGE_URL ); + mAtlasManager->SetBrokenImage( mBrokenImageUrl ); } return mAtlasManager; @@ -212,7 +214,7 @@ Geometry VisualFactoryCache::CreateGridGeometry( Uint16Pair gridSize ) Image VisualFactoryCache::GetBrokenVisualImage() { - return ResourceImage::New( BROKEN_VISUAL_IMAGE_URL ); + return ResourceImage::New( mBrokenImageUrl ); } void VisualFactoryCache::SetPreMultiplyOnLoad( bool preMultiply ) @@ -225,6 +227,19 @@ bool VisualFactoryCache::GetPreMultiplyOnLoad() return mPreMultiplyOnLoad; } +void VisualFactoryCache::SetBrokenImageUrl(const std::string& brokenImageUrl) +{ + mBrokenImageUrl = brokenImageUrl; + + if( !mAtlasManager ) + { + mAtlasManager = new ImageAtlasManager(); + } + + mAtlasManager->SetBrokenImage( mBrokenImageUrl ); + mTextureManager.SetBrokenImageUrl( mBrokenImageUrl ); +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/visuals/visual-factory-cache.h b/dali-toolkit/internal/visuals/visual-factory-cache.h index bb4744c..a62dfb4 100644 --- a/dali-toolkit/internal/visuals/visual-factory-cache.h +++ b/dali-toolkit/internal/visuals/visual-factory-cache.h @@ -161,7 +161,7 @@ public: * @brief Returns an image to be used when a visual has failed to correctly render * @return The broken image handle. */ - static Image GetBrokenVisualImage(); + Image GetBrokenVisualImage(); /** * @copydoc Toolkit::VisualFactory::SetPreMultiplyOnLoad() @@ -173,6 +173,12 @@ public: */ bool GetPreMultiplyOnLoad(); + /** + * @brief Set an image to be used when a visual has failed to correctly render + * @param[in] brokenImageUrl The broken image url. + */ + void SetBrokenImageUrl(const std::string& brokenImageUrl); + public: /** * Get the image atlas manager. @@ -225,6 +231,7 @@ private: TextureManager mTextureManager; NPatchLoader mNPatchLoader; SvgRasterizeThread* mSvgRasterizeThread; + std::string mBrokenImageUrl; bool mPreMultiplyOnLoad; }; diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index 4803e07..e762b3e 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -67,11 +67,13 @@ BaseHandle Create() DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::VisualFactory, Dali::BaseHandle, Create, true ) DALI_TYPE_REGISTRATION_END() +const char * const BROKEN_IMAGE_URL( DALI_IMAGE_DIR "broken.png" ); ///< URL For the broken image } // namespace VisualFactory::VisualFactory( bool debugEnabled ) : mFactoryCache(), + mSlotDelegate(this), mDebugEnabled( debugEnabled ), mPreMultiplyOnLoad( true ) { @@ -81,6 +83,22 @@ VisualFactory::~VisualFactory() { } +void VisualFactory::OnStyleChangedSignal( Toolkit::StyleManager styleManager, StyleChange::Type type) +{ + if( type == StyleChange::THEME_CHANGE ) + { + std::string brokenImageUrl(BROKEN_IMAGE_URL); + + Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager ); + config["brokenImageUrl"].Get( brokenImageUrl ); + + if( mFactoryCache ) + { + mFactoryCache->SetBrokenImageUrl(brokenImageUrl); + } + } +} + Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& propertyMap ) { Visual::BasePtr visualPtr; @@ -342,6 +360,17 @@ Internal::VisualFactoryCache& VisualFactory::GetFactoryCache() if( !mFactoryCache ) { mFactoryCache = std::unique_ptr( new VisualFactoryCache( mPreMultiplyOnLoad ) ); + + std::string brokenImageUrl(BROKEN_IMAGE_URL); + Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); + if( styleManager ) + { + Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager ); + config["brokenImageUrl"].Get( brokenImageUrl ); + styleManager.StyleChangedSignal().Connect( mSlotDelegate, &VisualFactory::OnStyleChangedSignal ); + } + + mFactoryCache->SetBrokenImageUrl(brokenImageUrl); } return *mFactoryCache; } diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.h b/dali-toolkit/internal/visuals/visual-factory-impl.h index 999a0c4..a9a6563 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.h +++ b/dali-toolkit/internal/visuals/visual-factory-impl.h @@ -24,6 +24,8 @@ #include #include #include +#include +#include namespace Dali { @@ -51,6 +53,14 @@ public: VisualFactory( bool debugEnabled ); /** + * @brief StyleChanged callback + * + * @param[in] styleManager Handle for style manager. + * @param[in] type Style change type. + */ + void OnStyleChangedSignal( Toolkit::StyleManager styleManager, StyleChange::Type type ); + + /** * @copydoc Toolkit::VisualFactory::CreateVisual( const Property::Map& ) */ Toolkit::Visual::Base CreateVisual( const Property::Map& propertyMap ); @@ -99,6 +109,7 @@ private: private: std::unique_ptr mFactoryCache; + SlotDelegate< VisualFactory > mSlotDelegate; bool mDebugEnabled:1; bool mPreMultiplyOnLoad:1; ///< Local store for this flag }; diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index 49064a8..df78b15 100755 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -465,13 +465,15 @@ bool Control::EmitKeyEventSignal( const KeyEvent& event ) bool consumed = false; + consumed = mImpl->FilterKeyEvent( event ); + // signals are allocated dynamically when someone connects - if ( !mImpl->mKeyEventSignal.Empty() ) + if ( !consumed && !mImpl->mKeyEventSignal.Empty() ) { consumed = mImpl->mKeyEventSignal.Emit( handle, event ); } - if (!consumed) + if ( !consumed ) { // Notification for derived classes consumed = OnKeyEvent(event); diff --git a/dali-toolkit/public-api/controls/text-controls/text-field.h b/dali-toolkit/public-api/controls/text-controls/text-field.h index d2d3ae5..7f7fd86 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-field.h +++ b/dali-toolkit/public-api/controls/text-controls/text-field.h @@ -317,7 +317,7 @@ public: * @note VARIATION key can be changed depending on PANEL_LAYOUT. * For example, when PANEL_LAYOUT key is InputMethod::PanelLayout::NORMAL, * then VARIATION would be among NORMAL, WITH_FILENAME, and WITH_PERSON_NAME in Dali::InputMethod::NormalLayout. - * For more information, see @ref Dali::InputMethod::Category. + * For more information, see Dali::InputMethod::Category. * * Example Usage: * @code diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index fb07b2a..78cefb1 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 = 3; -const unsigned int TOOLKIT_MICRO_VERSION = 20; +const unsigned int TOOLKIT_MICRO_VERSION = 21; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/dali-toolkit/public-api/visuals/visual-properties.h b/dali-toolkit/public-api/visuals/visual-properties.h index bb0ecd2..cb36f29 100644 --- a/dali-toolkit/public-api/visuals/visual-properties.h +++ b/dali-toolkit/public-api/visuals/visual-properties.h @@ -73,7 +73,7 @@ enum { /** * @brief The index for the visual type. - * @details Name "visualType", type [Type](@ref Dali::Toolkit::Visual::Type) (Property::INTEGER) or Property::STRING. + * @details Name "visualType", type [Type](Dali::Toolkit::Visual::Type) (Property::INTEGER) or Property::STRING. * @SINCE_1_1.45 * @note Mandatory. * @see Type diff --git a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json index 50f9529..fa8c6f8 100644 --- a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json @@ -28,6 +28,7 @@ { "config": { + "brokenImageUrl":"{DALI_IMAGE_DIR}broken.png", "alwaysShowFocus":true, "clearFocusOnEscape":false }, diff --git a/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json b/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json index 460d0f8..f35f988 100644 --- a/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json @@ -28,6 +28,7 @@ { "config": { + "brokenImageUrl":"{DALI_IMAGE_DIR}broken.png", "alwaysShowFocus":false, "clearFocusOnEscape":true }, diff --git a/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json b/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json index 9390546..1a9d7ab 100644 --- a/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json @@ -28,6 +28,7 @@ { "config": { + "brokenImageUrl":"{DALI_IMAGE_DIR}broken.png", "alwaysShowFocus":false, "clearFocusOnEscape":true }, diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 94149ef..186f8e5 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.3.20 +Version: 1.3.21 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT