From: Adeel Kazmi Date: Mon, 14 Jan 2019 10:40:50 +0000 (+0000) Subject: Merge "Enum properties added for the text effects style." into devel/master X-Git-Tag: dali_1.4.3~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=1b032e3f72c144d2da593a1c20d15041a3de00a3;hp=aa0a27e9a51008fe8d557cd85ad31b057724aa41 Merge "Enum properties added for the text effects style." into devel/master --- diff --git a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp index 591ec8f..3103f35 100755 --- a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp +++ b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp @@ -1348,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/dali-toolkit-test-utils/dummy-control.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp index 9825b56..b8ddd29 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp @@ -188,7 +188,17 @@ void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index in Property::Value DummyControlImpl::GetProperty( BaseObject* object, Dali::Property::Index propertyIndex ) { - Dali::Property::Value value; + Toolkit::DummyControl control = Toolkit::DummyControl::DownCast( Dali::BaseHandle( object ) ); + DummyControlImpl& dummyImpl = static_cast( control.GetImplementation() ); + + Visual::Base visual = dummyImpl.GetVisual( propertyIndex ); + Property::Map map; + if( visual ) + { + visual.CreatePropertyMap( map ); + } + Dali::Property::Value value = map; + return value; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp index c0fee41..4c80bf2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "dummy-control.h" using namespace Dali; @@ -45,6 +46,16 @@ namespace const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json"; +bool gAnimationFinishedSignalFired = false; + +void VisualEventSignal( Control control, Dali::Property::Index visualIndex, Dali::Property::Index signalId ) +{ + if( visualIndex == DummyControl::Property::TEST_VISUAL && signalId == DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED ) + { + gAnimationFinishedSignalFired = true; + } +} + } int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void) @@ -273,7 +284,9 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); - // test + Property::Map map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PLAYING ) ); tet_infoline( "Test Pause action" ); DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes ); @@ -281,15 +294,19 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) application.SendNotification(); application.Render(16); - // test + map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PAUSED ) ); - tet_infoline( "Test Resume action" ); - DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::RESUME, attributes ); + tet_infoline( "Test Play action" ); + DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes ); application.SendNotification(); application.Render(16); - // test + map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PLAYING ) ); tet_infoline( "Test Stop action" ); DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes ); @@ -297,7 +314,9 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) application.SendNotification(); application.Render(16); - // test + map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::STOPPED ) ); tet_infoline( "Test Stop action again" ); DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes ); @@ -305,7 +324,9 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) application.SendNotification(); application.Render(16); - // test + map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::STOPPED ) ); tet_infoline( "Test Play action" ); DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes ); @@ -313,15 +334,20 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) application.SendNotification(); application.Render(16); - // test + map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PLAYING ) ); - dummyControl.SetSize( 100.0f, 100.0f ); + // Change Size + Vector3 newSize( 100.0f, 100.0f, 0.0f ); + dummyControl.SetSize( newSize ); application.SendNotification(); application.Render(16); - // test // Size should be changed + Vector3 naturalSize = dummyControl.GetNaturalSize(); + DALI_TEST_CHECK( naturalSize == newSize ); dummyControl.Unparent(); } @@ -439,7 +465,8 @@ int UtcDaliAnimatedVectorImageVisualLoopCount(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + // Trigger count is 2 - resource ready and animation finished + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION ); // renderer is added to actor DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); @@ -488,3 +515,45 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void) END_TEST; } + +int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal" ); + + Property::Map propertyMap; + propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE ) + .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME ) + .Add( DevelImageVisual::Property::LOOP_COUNT, 3 ); + + Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap ); + DALI_TEST_CHECK( visual ); + + DummyControl actor = DummyControl::New( true ); + DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() ); + dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); + + DevelControl::VisualEventSignal( actor ).Connect( &VisualEventSignal ); + + Vector2 controlSize( 20.f, 30.f ); + actor.SetSize( controlSize ); + + Stage::GetCurrent().Add( actor ); + + Property::Map attributes; + DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes ); + + application.SendNotification(); + application.Render(); + + // Wait for animation finish + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION ); + + Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL ); + Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE ); + DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::STOPPED ) ); + + DALI_TEST_EQUALS( gAnimationFinishedSignalFired, true, TEST_LOCATION ); + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp index 98ff461..29370b7 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp @@ -836,7 +836,8 @@ int UtcDaliImageViewSetImageOnstageN(void) DALI_TEST_CHECK( !value.Get( url ) ); Property::Map map; - DALI_TEST_CHECK( !value.Get( map ) ); + value.Get( map ); + DALI_TEST_CHECK( map.Empty() ); END_TEST; } @@ -931,7 +932,8 @@ int UtcDaliImageViewSetImageOffstageN(void) DALI_TEST_CHECK( !value.Get( url ) ); Property::Map map; - DALI_TEST_CHECK( !value.Get( map ) ); + value.Get( map ); + DALI_TEST_CHECK( map.Empty() ); END_TEST; } @@ -951,7 +953,8 @@ int UtcDaliImageViewSetImageN(void) DALI_TEST_CHECK( !value.Get( url ) ); Property::Map map; - DALI_TEST_CHECK( !value.Get( map ) ); + value.Get( map ); + DALI_TEST_CHECK( map.Empty() ); std::string resource_url; Property::Value val = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) ); @@ -980,7 +983,8 @@ int UtcDaliImageViewSetImageTypeChangesP(void) application.Render( 16 ); DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty - DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty + value.Get( map ); + DALI_TEST_CHECK( map.Empty() ); // Value should be empty DALI_TEST_CHECK( ! visual ); // Visual should be invalid // Set a URL @@ -1006,7 +1010,8 @@ int UtcDaliImageViewSetImageTypeChangesP(void) visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE ); DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty - DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty + value.Get( map ); + DALI_TEST_CHECK( map.Empty() ); // Value should be empty DALI_TEST_CHECK( ! visual ); // Visual should be invalid // Set an Image @@ -1033,7 +1038,8 @@ int UtcDaliImageViewSetImageTypeChangesP(void) visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE ); DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty - DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty + value.Get( map ); + DALI_TEST_CHECK( map.Empty() ); // Value should be empty DALI_TEST_CHECK( ! visual ); // Visual should be invalid // Set a URL in property map diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp index 4623958..4d191a8 100755 --- 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 index 5822102..a073847 100755 --- 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 @@ -1220,7 +1220,7 @@ int UtcDaliKeyboardFocusManagerSignalChangedBySpaceKeyEvent(void) PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified); manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback ); - Integration::KeyEvent spaceEvent( "space", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ); + Integration::KeyEvent spaceEvent( "space", "", "", 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 @@ -1500,7 +1500,7 @@ int UtcDaliKeyboardFocusManagerEnableFocusIndicator(void) // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager // It makes mIsFocusIndicatorEnabled true and add focus indicator to focused actor. - Integration::KeyEvent rightEvent( "Right", "", 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 ); application.ProcessEvent(rightEvent); Actor indicatorActor = manager.GetFocusIndicatorActor(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp index b190b5f..882dfa2 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -174,6 +174,7 @@ struct PopupTestFunctor // Generate a KeyEvent to send to Core. Integration::KeyEvent GenerateKey( const std::string& keyName, + const std::string& logicalKey, const std::string& keyString, int keyCode, int keyModifier, @@ -186,6 +187,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, ) { return Integration::KeyEvent( keyName, + logicalKey, keyString, keyCode, keyModifier, @@ -1434,7 +1436,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 index 49889ff..94cc011 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -214,6 +214,7 @@ Integration::PanGestureEvent GeneratePan( Gesture::State state, // Generate a KeyEvent to send to Core. Integration::KeyEvent GenerateKey( const std::string& keyName, + const std::string& logicalKey, const std::string& keyString, int keyCode, int keyModifier, @@ -225,6 +226,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE ) { return Integration::KeyEvent( keyName, + logicalKey, keyString, keyCode, keyModifier, @@ -1017,7 +1019,7 @@ int utcDaliTextEditorTextChangedP(void) editor.SetKeyInputFocus(); gTextChangedCallBackCalled = false; - 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::Down, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); END_TEST; @@ -1337,7 +1339,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(); @@ -1362,7 +1364,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(); @@ -1378,7 +1380,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(); @@ -1419,7 +1421,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, "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(); @@ -1527,7 +1529,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, "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(); @@ -1544,8 +1546,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, "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 ) ); + 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(); @@ -1576,8 +1578,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, "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 ) ); + 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(); @@ -1633,8 +1635,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, "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 ) ); + 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(); @@ -1658,8 +1660,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(); @@ -1669,8 +1671,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(); @@ -1708,8 +1710,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 @@ -1858,8 +1860,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(); @@ -1867,8 +1869,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(); @@ -1876,7 +1878,7 @@ int utcDaliTextEditorEvent04(void) } // Add a character - 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::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); @@ -1885,8 +1887,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(); @@ -1894,8 +1896,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(); @@ -1903,7 +1905,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(); @@ -1953,8 +1955,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(); @@ -1963,7 +1965,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, "d", 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(); @@ -1975,7 +1977,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(); @@ -1988,7 +1990,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(); @@ -2031,7 +2033,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(); @@ -2041,12 +2043,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 ); @@ -2057,31 +2059,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(); @@ -2122,25 +2124,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, "x", 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(); @@ -2149,34 +2151,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, "c", 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, "v", 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(); @@ -2189,18 +2191,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, "x", 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(); @@ -2210,18 +2212,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, "c", 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(); @@ -2268,54 +2270,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, "d", 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(); @@ -2324,23 +2326,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, "c", 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(); @@ -2349,25 +2351,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, "c", 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(); @@ -2376,24 +2378,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, "x", 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(); @@ -2402,24 +2404,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, "c", 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 6b67b88..8c1eecd 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -305,6 +305,7 @@ Integration::LongPressGestureEvent GenerateLongPress( // Generate a KeyEvent to send to Core. Integration::KeyEvent GenerateKey( const std::string& keyName, + const std::string& logicalKey, const std::string& keyString, int keyCode, int keyModifier, @@ -316,6 +317,7 @@ Integration::KeyEvent GenerateKey( const std::string& keyName, const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE ) { return Integration::KeyEvent( keyName, + logicalKey, keyString, keyCode, keyModifier, @@ -1062,7 +1064,7 @@ int utcDaliTextFieldTextChangedP(void) field.SetKeyInputFocus(); gTextChangedCallBackCalled = false; - 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::Down, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); END_TEST; @@ -1115,8 +1117,8 @@ int utcDaliTextFieldMaxCharactersReachedP(void) gMaxCharactersCallBackCalled = false; - 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 ) ); + 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 ); @@ -1147,13 +1149,13 @@ int utcDaliTextFieldMaxCharactersReachedN(void) gMaxCharactersCallBackCalled = false; - 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 ) ); + 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, "\r", 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 ); @@ -1470,7 +1472,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(); @@ -1495,7 +1497,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(); @@ -1511,7 +1513,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(); @@ -1618,7 +1620,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, "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(); @@ -1635,14 +1637,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, "Delete", 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, "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 ) ); + 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(); @@ -1673,8 +1675,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, "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 ) ); + 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(); @@ -1732,8 +1734,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, "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 ) ); + 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(); @@ -1757,8 +1759,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(); @@ -1768,8 +1770,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(); @@ -1807,8 +1809,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 @@ -2224,14 +2226,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, "d", 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, "d", 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(); @@ -2240,7 +2242,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, "d", 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(); } @@ -2250,7 +2252,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, "d", 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(); } @@ -2258,16 +2260,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, "d", 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, "d", 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(); @@ -2379,7 +2381,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(); @@ -2413,8 +2415,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, "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( "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(); @@ -2431,10 +2433,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, "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 ) ); + 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(); @@ -2443,8 +2445,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(); @@ -2453,8 +2455,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, "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( "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(); @@ -2519,24 +2521,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, "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 ) ); + 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, "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 ) ); + 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, "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 ) ); + 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(); @@ -2582,8 +2584,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(); @@ -2916,8 +2918,8 @@ int utcDaliTextFieldLayoutDirectionCoverage(void) application.Render(); // 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp index f2a4f75..e2ee8e6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp @@ -233,7 +233,7 @@ int UtcDaliWebViewTouchAndKeys(void) // Key event Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( view ); - 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(); DALI_TEST_CHECK( gTouched ); diff --git a/dali-toolkit/devel-api/controls/control-devel.cpp b/dali-toolkit/devel-api/controls/control-devel.cpp index c17b944..01548d1 100755 --- a/dali-toolkit/devel-api/controls/control-devel.cpp +++ b/dali-toolkit/devel-api/controls/control-devel.cpp @@ -166,6 +166,13 @@ bool IsLayoutingRequired( Control control ) return controlDataImpl.IsLayoutingRequired(); } +VisualEventSignalType& VisualEventSignal( Control control ) +{ + Internal::Control& internalControl = Toolkit::Internal::GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl ); + return controlDataImpl.VisualEventSignal(); +} + } // namespace DevelControl } // namespace Toolkit diff --git a/dali-toolkit/devel-api/controls/control-devel.h b/dali-toolkit/devel-api/controls/control-devel.h index 404a9ec..dad426f 100755 --- a/dali-toolkit/devel-api/controls/control-devel.h +++ b/dali-toolkit/devel-api/controls/control-devel.h @@ -270,14 +270,14 @@ DALI_TOOLKIT_API void DoAction( Control& control, Dali::Property::Index visualIn */ DALI_TOOLKIT_API void SetInputMethodContext( Internal::Control& control, InputMethodContext& inputMethodContext ); -/* +/** * @brief Get the layout associated with this control, if any. * * @return A handle to the layout, or empty. */ DALI_TOOLKIT_API Toolkit::LayoutItem GetLayout( Internal::Control& control ); -/* +/** * @brief Get the layout associated with a control, if any. * * @return A handle to the layout, or empty. @@ -328,6 +328,22 @@ DALI_TOOLKIT_API void SetLayoutingRequired( Control control, bool layoutingRequi */ DALI_TOOLKIT_API bool IsLayoutingRequired( Control control ); +/** + * @brief Visual Event signal type + */ +using VisualEventSignalType = Signal< void ( Control, Dali::Property::Index, Dali::Property::Index ) >; + +/** + * @brief This signal is emitted when a visual has an event to notify. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( Control control, Dali::Property::Index visualIndex, Dali::Property::Index signalId ); + * @endcode + * @return The signal to connect to + */ +DALI_TOOLKIT_API VisualEventSignalType& VisualEventSignal( Control control ); + } // namespace DevelControl } // namespace Toolkit diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index ef91d3a..115156e 100755 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -132,6 +132,7 @@ devel_api_visuals_header_files = \ $(devel_api_src_dir)/visuals/animated-gradient-visual-properties-devel.h \ $(devel_api_src_dir)/visuals/animated-image-visual-actions-devel.h \ $(devel_api_src_dir)/visuals/animated-vector-image-visual-actions-devel.h \ + $(devel_api_src_dir)/visuals/animated-vector-image-visual-signals-devel.h \ $(devel_api_src_dir)/visuals/color-visual-properties-devel.h \ $(devel_api_src_dir)/visuals/image-visual-properties-devel.h \ $(devel_api_src_dir)/visuals/image-visual-actions-devel.h \ diff --git a/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h index 6e40c69..1f05bd7 100644 --- a/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h +++ b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h @@ -39,7 +39,6 @@ enum Type { PLAY, ///< Play the animated vector image. PAUSE, ///< Pause the animated vector image. - RESUME, ///< Resume the animated vector image. STOP ///< Stop the animated vector image. This is also Default playback mode. }; diff --git a/dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h new file mode 100644 index 0000000..3ab14e1 --- /dev/null +++ b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h @@ -0,0 +1,51 @@ +#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_SIGNALS_DEVEL_H +#define DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_SIGNALS_DEVEL_H + +/* + * 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. + * + */ + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelAnimatedVectorImageVisual +{ + +/** + * @brief Signal that the animated vector image visual can emit. + */ +namespace Signal +{ +/** + * @brief The available signals for this visual + */ +enum Type +{ + ANIMATION_FINISHED ///< Animation has finished. +}; + +} // namespace Signal + +} // namespace DevelAnimatedVectorImageVisual + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_SIGNALS_DEVEL_H diff --git a/dali-toolkit/devel-api/visuals/image-visual-properties-devel.h b/dali-toolkit/devel-api/visuals/image-visual-properties-devel.h index eb39aa6..2ae2726 100644 --- a/dali-toolkit/devel-api/visuals/image-visual-properties-devel.h +++ b/dali-toolkit/devel-api/visuals/image-visual-properties-devel.h @@ -92,12 +92,29 @@ enum Type * @details Name "playRange", Type Property::VECTOR2, between 0 and 1 * @note Default 0 and 1 */ - PLAY_RANGE = ORIENTATION_CORRECTION + 4 + PLAY_RANGE = ORIENTATION_CORRECTION + 4, + + /** + * @brief The playing state the AnimatedVectorImageVisual will use. + * @details Name "playState", type PlayState (Property::INTEGER) + * @note This property is read-only. + */ + PLAY_STATE = ORIENTATION_CORRECTION + 5 }; } //namespace Property +/** + * @brief Enumeration for what state the animation is in. + */ +enum class PlayState +{ + STOPPED, ///< Animation has stopped + PLAYING, ///< The animation is playing + PAUSED ///< The animation is paused +}; + } // namespace DevelImageVisual } // namespace Toolkit diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp index 5e94e8f..0367037 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -334,6 +334,7 @@ Control::Impl::Impl( Control& controlImpl ) mKeyInputFocusGainedSignal(), mKeyInputFocusLostSignal(), mResourceReadySignal(), + mVisualEventSignal(), mPinchGestureDetector(), mPanGestureDetector(), mTapGestureDetector(), @@ -626,15 +627,15 @@ void Control::Impl::StopObservingVisual( Toolkit::Visual::Base& visual ) Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual ); // Stop observing the visual - visualImpl.RemoveResourceObserver( *this ); + visualImpl.RemoveEventObserver( *this ); } void Control::Impl::StartObservingVisual( Toolkit::Visual::Base& visual) { Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual ); - // start observing the visual for resource ready - visualImpl.AddResourceObserver( *this ); + // start observing the visual for events + visualImpl.AddEventObserver( *this ); } // Called by a Visual when it's resource is ready @@ -680,6 +681,20 @@ void Control::Impl::ResourceReady( Visual::Base& object) } } +void Control::Impl::NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) +{ + for( auto registeredIter = mVisuals.Begin(), end = mVisuals.End(); registeredIter != end; ++registeredIter ) + { + Internal::Visual::Base& registeredVisualImpl = Toolkit::GetImplementation( (*registeredIter)->visual ); + if( &object == ®isteredVisualImpl ) + { + Dali::Toolkit::Control handle( mControlImpl.GetOwner() ); + mVisualEventSignal.Emit( handle, (*registeredIter)->index, signalId ); + break; + } + } +} + bool Control::Impl::IsResourceReady() const { // Iterate through and check all the enabled visuals are ready @@ -1489,6 +1504,11 @@ bool Control::Impl::IsLayoutingRequired() return mControlImpl.mImpl->mIsLayoutingRequired; } +DevelControl::VisualEventSignalType& Control::Impl::VisualEventSignal() +{ + return mVisualEventSignal; +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/controls/control/control-data-impl.h b/dali-toolkit/internal/controls/control/control-data-impl.h index 1afa0a2..634e7f6 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.h +++ b/dali-toolkit/internal/controls/control/control-data-impl.h @@ -24,7 +24,7 @@ #include // INTERNAL INCLUDES -#include +#include #include #include #include @@ -65,7 +65,7 @@ typedef Dali::OwnerContainer< RegisteredVisual* > RegisteredVisualContainer; /** * @brief Holds the Implementation for the internal control class */ -class Control::Impl : public ConnectionTracker, public Visual::ResourceObserver +class Control::Impl : public ConnectionTracker, public Visual::EventObserver { public: @@ -124,9 +124,17 @@ public: /** * @brief Called when a resource is ready. * @param[in] object The visual whose resources are ready - * @note Overriding method in Visual::ResourceObserver. + * @note Overriding method in Visual::EventObserver. */ - virtual void ResourceReady( Visual::Base& object ); + virtual void ResourceReady( Visual::Base& object ) override; + + /** + * @brief Called when an event occurs. + * @param[in] object The visual whose events occur + * @param[in] signalId The signal to emit. See Visual to find supported signals + * @note Overriding method in Visual::EventObserver. + */ + virtual void NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) override; /** * @copydoc Dali::Toolkit::DevelControl::RegisterVisual() @@ -355,6 +363,11 @@ public: */ bool IsLayoutingRequired(); + /** + * @copydoc DevelControl::VisualEventSignal() + */ + DevelControl::VisualEventSignalType& VisualEventSignal(); + private: /** @@ -418,6 +431,7 @@ public: Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal; Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal; Toolkit::Control::ResourceReadySignalType mResourceReadySignal; + DevelControl::VisualEventSignalType mVisualEventSignal; // Gesture Detection PinchGestureDetector mPinchGestureDetector; diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index 890312c..96b1b78 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -463,9 +463,15 @@ Property::Value ImageView::GetProperty( BaseObject* object, Property::Index prop Scripting::CreatePropertyMap( impl.mImage, map ); value = map; } - else if( !impl.mPropertyMap.Empty() ) + else { - value = impl.mPropertyMap; + Property::Map map; + Toolkit::Visual::Base visual = DevelControl::GetVisual( impl, Toolkit::ImageView::Property::IMAGE ); + if( visual ) + { + visual.CreatePropertyMap( map ); + } + value = map; } break; } diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp index 96c7ddd..f4a733b 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +100,15 @@ void AnimatedVectorImageVisual::DoCreatePropertyMap( Property::Map& map ) const } map.Insert( Toolkit::DevelImageVisual::Property::LOOP_COUNT, static_cast< int >( mLoopCount ) ); map.Insert( Toolkit::DevelImageVisual::Property::PLAY_RANGE, static_cast< Vector2 >( mPlayRange ) ); + + if( mVectorRasterizeThread ) + { + map.Insert( Toolkit::DevelImageVisual::Property::PLAY_STATE, static_cast< int >( mVectorRasterizeThread->GetPlayState() ) ); + } + else + { + map.Insert( Toolkit::DevelImageVisual::Property::PLAY_STATE, static_cast< int >( DevelImageVisual::PlayState::STOPPED ) ); + } } void AnimatedVectorImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const @@ -250,6 +260,7 @@ void AnimatedVectorImageVisual::OnSetTransform() mVectorRasterizeThread = std::unique_ptr< VectorRasterizeThread >( new VectorRasterizeThread( mUrl.GetUrl(), mImpl->mRenderer, width, height ) ); mVectorRasterizeThread->SetResourceReadyCallback( new EventThreadCallback( MakeCallback( this, &AnimatedVectorImageVisual::OnResourceReady ) ) ); + mVectorRasterizeThread->SetAnimationFinishedCallback( new EventThreadCallback( MakeCallback( this, &AnimatedVectorImageVisual::OnAnimationFinished ) ) ); mVectorRasterizeThread->SetLoopCount( mLoopCount ); mVectorRasterizeThread->SetPlayRange( mPlayRange ); @@ -279,11 +290,6 @@ void AnimatedVectorImageVisual::OnSetTransform() void AnimatedVectorImageVisual::OnDoAction( const Property::Index actionId, const Property::Value& attributes ) { - if( actionId == mActionStatus ) - { - return; - } - // Check if action is valid for this visual type and perform action if possible switch( actionId ) { @@ -310,22 +316,23 @@ void AnimatedVectorImageVisual::OnDoAction( const Property::Index actionId, cons mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE; break; } - case DevelAnimatedVectorImageVisual::Action::RESUME: - { - if( mVectorRasterizeThread ) - { - mVectorRasterizeThread->ResumeAnimation(); - DevelStage::SetRenderingBehavior( Stage::GetCurrent(), DevelStage::Rendering::CONTINUOUSLY ); - } - mActionStatus = DevelAnimatedVectorImageVisual::Action::RESUME; - break; - } case DevelAnimatedVectorImageVisual::Action::STOP: { if( mVectorRasterizeThread ) { + bool emitSignal = false; + if( mVectorRasterizeThread->GetPlayState() != DevelImageVisual::PlayState::STOPPED ) + { + emitSignal = true; + } + mVectorRasterizeThread->StopAnimation(); DevelStage::SetRenderingBehavior( Stage::GetCurrent(), DevelStage::Rendering::IF_REQUIRED ); + + if( emitSignal ) + { + OnAnimationFinished(); + } } mActionStatus = DevelAnimatedVectorImageVisual::Action::STOP; break; @@ -347,6 +354,14 @@ void AnimatedVectorImageVisual::OnResourceReady() } } +void AnimatedVectorImageVisual::OnAnimationFinished() +{ + if( mImpl->mEventObserver ) + { + mImpl->mEventObserver->NotifyVisualEvent( *this, DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED ); + } +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h index 268cb06..28d79a4 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h @@ -150,6 +150,11 @@ private: */ void OnResourceReady(); + /** + * @brief Event callback from rasterize thread. This is called after the animation is finished. + */ + void OnAnimationFinished(); + // Undefined AnimatedVectorImageVisual( const AnimatedVectorImageVisual& visual ) = delete; diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp index 52c6541..536c208 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp @@ -50,8 +50,10 @@ VectorRasterizeThread::VectorRasterizeThread( const std::string& url, Renderer r mVectorRenderer(), mConditionalWait(), mMutex(), - mResourceReadyTrigger( NULL ), + mResourceReadyTrigger(), + mAnimationFinishedTrigger(), mPlayRange( 0.0f, 1.0f ), + mPlayState( DevelImageVisual::PlayState::STOPPED ), mCurrentFrame( 0 ), mTotalFrame( 0 ), mStartFrame( 0 ), @@ -61,8 +63,6 @@ VectorRasterizeThread::VectorRasterizeThread( const std::string& url, Renderer r mLoopCount( LOOP_FOREVER ), mCurrentLoop( 0 ), mNeedRender( false ), - mPlaying( false ), - mPaused( false ), mDestroyThread( false ), mResourceReady( false ), mLogFactory( Dali::Adaptor::Get().GetLogFactory() ) @@ -85,8 +85,6 @@ VectorRasterizeThread::~VectorRasterizeThread() DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::~VectorRasterizeThread: Join\n" ); Join(); - - delete mResourceReadyTrigger; } void VectorRasterizeThread::Run() @@ -114,10 +112,16 @@ void VectorRasterizeThread::SetSize( uint32_t width, uint32_t height ) void VectorRasterizeThread::StartAnimation() { ConditionalWait::ScopedLock lock( mConditionalWait ); - if( !mPlaying ) + if( mPlayState != DevelImageVisual::PlayState::PLAYING ) { - mPlaying = true; - mPaused = false; + if( mPlayState == DevelImageVisual::PlayState::STOPPED ) + { + // Reset the current frame and the current loop + mCurrentFrame = mStartFrame; + mCurrentLoop = 0; + } + + mPlayState = DevelImageVisual::PlayState::PLAYING; mConditionalWait.Notify( lock ); DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::StartAnimation: Start\n" ); @@ -127,10 +131,9 @@ void VectorRasterizeThread::StartAnimation() void VectorRasterizeThread::StopAnimation() { ConditionalWait::ScopedLock lock( mConditionalWait ); - if( mPlaying ) + if( mPlayState != DevelImageVisual::PlayState::STOPPED ) { - mPlaying = false; - mPaused = false; + mPlayState = DevelImageVisual::PlayState::STOPPED; DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::StopAnimation: Stop\n" ); } @@ -139,26 +142,14 @@ void VectorRasterizeThread::StopAnimation() void VectorRasterizeThread::PauseAnimation() { ConditionalWait::ScopedLock lock( mConditionalWait ); - if( mPlaying && !mPaused ) + if( mPlayState == DevelImageVisual::PlayState::PLAYING ) { - mPaused = true; + mPlayState = DevelImageVisual::PlayState::PAUSED; DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::PauseAnimation: Pause\n" ); } } -void VectorRasterizeThread::ResumeAnimation() -{ - ConditionalWait::ScopedLock lock( mConditionalWait ); - if( mPlaying && mPaused ) - { - mPaused = false; - mConditionalWait.Notify( lock ); - - DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::ResumeAnimation: Resume\n" ); - } -} - void VectorRasterizeThread::RenderFrame() { ConditionalWait::ScopedLock lock( mConditionalWait ); @@ -171,7 +162,13 @@ void VectorRasterizeThread::RenderFrame() void VectorRasterizeThread::SetResourceReadyCallback( EventThreadCallback* callback ) { ConditionalWait::ScopedLock lock( mConditionalWait ); - mResourceReadyTrigger = callback; + mResourceReadyTrigger = std::unique_ptr< EventThreadCallback >( callback ); +} + +void VectorRasterizeThread::SetAnimationFinishedCallback( EventThreadCallback* callback ) +{ + ConditionalWait::ScopedLock lock( mConditionalWait ); + mAnimationFinishedTrigger = std::unique_ptr< EventThreadCallback >( callback ); } void VectorRasterizeThread::SetLoopCount( int16_t count ) @@ -198,20 +195,19 @@ void VectorRasterizeThread::SetPlayRange( Vector2 range ) } } +DevelImageVisual::PlayState VectorRasterizeThread::GetPlayState() +{ + return mPlayState; +} + bool VectorRasterizeThread::IsThreadReady() { ConditionalWait::ScopedLock lock( mConditionalWait ); - if( ( !mPlaying || mPaused ) && !mNeedRender && !mDestroyThread ) + if( mPlayState != DevelImageVisual::PlayState::PLAYING && !mNeedRender && !mDestroyThread ) { DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::IsThreadReady: Wait\n" ); - if( !mPlaying ) - { - mCurrentFrame = mStartFrame; - mCurrentLoop = 0; - } - mConditionalWait.Wait( lock ); } @@ -243,7 +239,7 @@ void VectorRasterizeThread::Rasterize() // Rasterize mVectorRenderer.Render( mCurrentFrame ); - if( mPlaying && !mPaused ) + if( mPlayState == DevelImageVisual::PlayState::PLAYING ) { if( ++mCurrentFrame >= mEndFrame ) { @@ -258,7 +254,11 @@ void VectorRasterizeThread::Rasterize() if( mCurrentLoop >= mLoopCount ) { // Animation is finished - mPlaying = false; + mPlayState = DevelImageVisual::PlayState::STOPPED; + + mAnimationFinishedTrigger->Trigger(); + + DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::Rasterize: Animation is finished\n" ); } else { diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h index f05f8b6..8ee52be 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h @@ -25,6 +25,10 @@ #include #include #include +#include + +// INTERNAL INCLUDES +#include namespace Dali { @@ -81,11 +85,6 @@ public: void PauseAnimation(); /** - * @brief Resume the vector animation. - */ - void ResumeAnimation(); - - /** * @brief Render one frame. The current frame number will be increased. */ void RenderFrame(); @@ -97,6 +96,12 @@ public: void SetResourceReadyCallback( EventThreadCallback* callback ); /** + * @brief This callback is called after the animation is finished. + * @param[in] callback The animation finished callback + */ + void SetAnimationFinishedCallback( EventThreadCallback* callback ); + + /** * @brief Enable looping for 'count' repeats. -1 means to repeat forever. * @param[in] count The number of times to loop */ @@ -109,6 +114,12 @@ public: */ void SetPlayRange( Vector2 range ); + /** + * @brief Get the play state + * @return The play state + */ + DevelImageVisual::PlayState GetPlayState(); + protected: /** @@ -143,25 +154,25 @@ private: private: - std::string mUrl; - VectorAnimationRenderer mVectorRenderer; - ConditionalWait mConditionalWait; - Dali::Mutex mMutex; - EventThreadCallback* mResourceReadyTrigger; - Vector2 mPlayRange; - uint32_t mCurrentFrame; - uint32_t mTotalFrame; - uint32_t mStartFrame; - uint32_t mEndFrame; - uint32_t mWidth; - uint32_t mHeight; - int16_t mLoopCount; - int16_t mCurrentLoop; - bool mNeedRender; - bool mPlaying; - bool mPaused; - bool mDestroyThread; ///< Whether the thread be destroyed - bool mResourceReady; + std::string mUrl; + VectorAnimationRenderer mVectorRenderer; + ConditionalWait mConditionalWait; + Dali::Mutex mMutex; + std::unique_ptr< EventThreadCallback > mResourceReadyTrigger; + std::unique_ptr< EventThreadCallback > mAnimationFinishedTrigger; + Vector2 mPlayRange; + DevelImageVisual::PlayState mPlayState; + uint32_t mCurrentFrame; + uint32_t mTotalFrame; + uint32_t mStartFrame; + uint32_t mEndFrame; + uint32_t mWidth; + uint32_t mHeight; + int16_t mLoopCount; + int16_t mCurrentLoop; + bool mNeedRender; + bool mDestroyThread; ///< Whether the thread be destroyed + bool mResourceReady; const Dali::LogFactoryInterface& mLogFactory; ///< The log factory }; diff --git a/dali-toolkit/internal/visuals/visual-base-data-impl.cpp b/dali-toolkit/internal/visuals/visual-base-data-impl.cpp index 0e7f396..3702aa3 100644 --- a/dali-toolkit/internal/visuals/visual-base-data-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-data-impl.cpp @@ -117,7 +117,7 @@ bool GetPolicyFromValue( const Property::Value& value, Vector2& policy ) Internal::Visual::Base::Impl::Impl(FittingMode fittingMode) : mCustomShader( NULL ), mBlendSlotDelegate( NULL ), - mResourceObserver( NULL ), + mEventObserver( NULL ), mTransform(), mMixColor( Color::WHITE ), mControlSize( Vector2::ZERO ), diff --git a/dali-toolkit/internal/visuals/visual-base-data-impl.h b/dali-toolkit/internal/visuals/visual-base-data-impl.h index 1f59ec0..4adcc5a 100644 --- a/dali-toolkit/internal/visuals/visual-base-data-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-data-impl.h @@ -24,7 +24,7 @@ // INTERNAL INCLUDES #include -#include +#include #include #include #include @@ -119,7 +119,7 @@ struct Base::Impl Renderer mRenderer; CustomShader* mCustomShader; SlotDelegate* mBlendSlotDelegate; ///< Used to own mix color animation connection - ResourceObserver* mResourceObserver; ///< Allows controls to observe when the visual resources are loaded and ready + EventObserver* mEventObserver; ///< Allows controls to observe when the visual has events to notify std::string mName; Transform mTransform; Vector4 mMixColor; diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 1ae6411..d14dcd3 100755 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -435,14 +435,14 @@ const Vector4& Visual::Base::GetMixColor() const return mImpl->mMixColor; } -void Visual::Base::AddResourceObserver( Visual::ResourceObserver& observer) +void Visual::Base::AddEventObserver( Visual::EventObserver& observer) { - mImpl->mResourceObserver = &observer; + mImpl->mEventObserver = &observer; } -void Visual::Base::RemoveResourceObserver( Visual::ResourceObserver& observer ) +void Visual::Base::RemoveEventObserver( Visual::EventObserver& observer ) { - mImpl->mResourceObserver = NULL; + mImpl->mEventObserver = NULL; } void Visual::Base::ResourceReady(Toolkit::Visual::ResourceStatus resourceStatus) @@ -451,10 +451,10 @@ void Visual::Base::ResourceReady(Toolkit::Visual::ResourceStatus resourceStatus) { mImpl->mResourceStatus = resourceStatus; - if( mImpl->mResourceObserver ) + if( mImpl->mEventObserver ) { // observer is currently a control impl - mImpl->mResourceObserver->ResourceReady( *this ); + mImpl->mEventObserver->ResourceReady( *this ); } } } diff --git a/dali-toolkit/internal/visuals/visual-base-impl.h b/dali-toolkit/internal/visuals/visual-base-impl.h index 02419d2..754c838 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-impl.h @@ -47,7 +47,7 @@ namespace Internal namespace Visual { -class ResourceObserver; +class EventObserver; using FittingMode = DevelVisual::FittingMode; @@ -227,16 +227,15 @@ public: Internal::TransitionData::Animator& animator ); /** - * @brief Add an observer to watch for when the Visuals resources are loaded. + * @brief Add an observer to watch for when the Visuals have events to notify * Currently only supports a single observer - * */ - void AddResourceObserver( Visual::ResourceObserver& observer ); + void AddEventObserver( Visual::EventObserver& observer ); /** * @brief Remove an observer */ - void RemoveResourceObserver( Visual::ResourceObserver& observer ); + void RemoveEventObserver( Visual::EventObserver& observer ); /** * @brief Called when the visuals resources are loaded / ready diff --git a/dali-toolkit/internal/visuals/visual-event-observer.h b/dali-toolkit/internal/visuals/visual-event-observer.h new file mode 100644 index 0000000..d816c34 --- /dev/null +++ b/dali-toolkit/internal/visuals/visual-event-observer.h @@ -0,0 +1,82 @@ +#ifndef DALI_INTERNAL_TOOLKIT_VISUAL_EVENT_OBSERVER_H +#define DALI_INTERNAL_TOOLKIT_VISUAL_EVENT_OBSERVER_H + +/* + * 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. + */ + +// EXTERNAL INCLUDES +#include + +namespace Dali +{ +namespace Toolkit +{ +namespace Internal +{ +namespace Visual +{ + +class Base; + +/** + * Observer to be informed when visuals have events. + */ +class EventObserver +{ +public: + + /** + * Inform the observer of the object when a resource is ready. + * @param[in] object The connection owner + */ + virtual void ResourceReady( Visual::Base& object ) = 0; + + /** + * Inform the observer of the object when an event occurs. + * @param[in] object The connection owner + * @param[in] signalId The signal to emit. See Visual to find supported signals + */ + virtual void NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) = 0; + +protected: + + /** + * constructor + */ + EventObserver() + { + } + + /** + * virtual destructor + */ + virtual ~EventObserver() + { + } + + // Undefined copy constructor. + EventObserver( const EventObserver& ) = delete; + + // Undefined assignment operator. + EventObserver& operator=( const EventObserver& ) = delete; +}; + +} // Visual +} // Internal +} // Toolkit +} // Dali + +#endif // DALI_INTERNAL_TOOLKIT_VISUAL_EVENT_OBSERVER_H diff --git a/dali-toolkit/internal/visuals/visual-resource-observer.h b/dali-toolkit/internal/visuals/visual-resource-observer.h deleted file mode 100644 index f671adc..0000000 --- a/dali-toolkit/internal/visuals/visual-resource-observer.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef DALI_INTERNAL_TOOLKIT_VISUAL_RESOURCE_OBSERVER_H -#define DALI_INTERNAL_TOOLKIT_VISUAL_RESOURCE_OBSERVER_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. - */ - - - -namespace Dali -{ -namespace Toolkit -{ -namespace Internal -{ -namespace Visual -{ - -class Base; - - -/** - * Observer to be informed when a visuals resources are ready. - */ -class ResourceObserver -{ - public: - - /** - * Inform the observer of the object that it's connections have changed - * @param[in] object The connection owner - */ - virtual void ResourceReady( Visual::Base& object) = 0; - - protected: - - /** - * constructor - */ - ResourceObserver() - { - }; - - /** - * virtual destructor - */ - virtual ~ResourceObserver() - { - }; - - // Undefined copy constructor. - ResourceObserver( const ResourceObserver& ); - - // Undefined assignment operator. - ResourceObserver& operator=( const ResourceObserver& ); -}; -} // Visual -} // Internal -} // Toolkit -} // Dali - -#endif // DALI_INTERNAL_TOOLKIT_VISUAL_RESOURCE_OBSERVER_H diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index d8b2cb5..ea22350 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit const unsigned int TOOLKIT_MAJOR_VERSION = 1; const unsigned int TOOLKIT_MINOR_VERSION = 4; -const unsigned int TOOLKIT_MICRO_VERSION = 1; +const unsigned int TOOLKIT_MICRO_VERSION = 2; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index b8b2838..ad3021b 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: Dali 3D engine Toolkit -Version: 1.4.1 +Version: 1.4.2 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT