From: Victor Cebollada Date: Mon, 22 Jun 2015 16:07:21 +0000 (+0100) Subject: TET cases for Text. X-Git-Tag: dali_1.0.46~3^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=ddc5e140b9152111a0bfd172c2c14a9025b926c5 TET cases for Text. Test the status of the text-field actors after sending some events. Removes some unused code. Change-Id: I5ded4718bc9a1969c43b6b1e91689524561c2588 Signed-off-by: Victor Cebollada --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp index e907bfb..4b89f25 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp @@ -217,27 +217,6 @@ int UtcDaliTextMultiLanguageSetScripts(void) END_TEST; } -int UtcDaliTextMultiLanguageReplaceScripts(void) -{ - ToolkitTestApplication application; - tet_infoline(" UtcDaliTextMultiLanguageReplaceScripts"); - - MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get(); - - LogicalModelPtr model = LogicalModel::New(); - CharacterIndex characterIndex = 0u; - Length numberOfCharactersToRemove = 0u; - Length numberOfCharactersToInsert = 0u; - - multilanguageSupport.ReplaceScripts( *model, - characterIndex, - numberOfCharactersToRemove, - numberOfCharactersToInsert ); - - tet_result(TET_PASS); - END_TEST; -} - int UtcDaliTextMultiLanguageValidateFonts01(void) { ToolkitTestApplication application; @@ -267,24 +246,3 @@ int UtcDaliTextMultiLanguageValidateFonts01(void) tet_result(TET_PASS); END_TEST; } - -int UtcDaliTextMultiLanguageValidateFonts02(void) -{ - ToolkitTestApplication application; - tet_infoline(" UtcDaliTextMultiLanguageValidateFonts"); - - MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get(); - - LogicalModelPtr model = LogicalModel::New(); - CharacterIndex characterIndex = 0u; - Length numberOfCharactersToRemove = 0u; - Length numberOfCharactersToInsert = 0u; - - multilanguageSupport.ValidateFonts( *model, - characterIndex, - numberOfCharactersToRemove, - numberOfCharactersToInsert ); - - tet_result(TET_PASS); - END_TEST; -} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 3b98639..2d8a983 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include #include @@ -99,6 +101,38 @@ static void TestMaxLengthReachedCallback( TextField control ) gMaxCharactersCallBackCalled = true; } +// Generate a TapGestureEvent to send to Core. +Integration::TapGestureEvent GenerateTap( + Gesture::State state, + unsigned int numberOfTaps, + unsigned int numberOfTouches, + Vector2 point) +{ + Integration::TapGestureEvent tap( state ); + + tap.numberOfTaps = numberOfTaps; + tap.numberOfTouches = numberOfTouches; + tap.point = point; + + return tap; +} + +// Generate a KeyEvent to send to Core. +Integration::KeyEvent GenerateKey( const std::string& keyName, + const std::string& keyString, + int keyCode, + int keyModifier, + unsigned long timeStamp, + const Integration::KeyEvent::State& keyState ) +{ + return Integration::KeyEvent( keyName, + keyString, + keyCode, + keyModifier, + timeStamp, + keyState ); +} + } // namespace int UtcDaliToolkitTextFieldConstructorP(void) @@ -363,6 +397,10 @@ int utcDaliTextFieldBasicRenderP(void) field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + Stage::GetCurrent().Add( field ); + try { // Render some text with the basic backend @@ -388,6 +426,11 @@ int utcDaliTextFieldAtlasRenderP(void) DALI_TEST_CHECK( field ); field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + Stage::GetCurrent().Add( field ); + try { // Render some text with the shared atlas backend @@ -422,16 +465,8 @@ int utcDaliTextFieldTextChangedP(void) field.SetKeyInputFocus(); - Dali::Integration::KeyEvent keyevent; - keyevent.keyName = "D"; - keyevent.keyString = "D"; - keyevent.keyCode = 0; - keyevent.keyModifier = 0; - keyevent.time = 0; - keyevent.state = Integration::KeyEvent::Down; - gTextChangedCallBackCalled = false; - application.ProcessEvent( keyevent ); + application.ProcessEvent( GenerateKey( "D", "D", 0, 0, 0, Integration::KeyEvent::Down ) ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); END_TEST; @@ -474,17 +509,8 @@ int utcDaliTextFieldMaxCharactersReachedP(void) gMaxCharactersCallBackCalled = false; field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback); - Dali::Integration::KeyEvent keyevent; - keyevent.keyName = "a"; - keyevent.keyString = "a"; - keyevent.keyCode = 0; - keyevent.keyModifier = 0; - keyevent.time = 0; - keyevent.state = Integration::KeyEvent::Down; - - application.ProcessEvent( keyevent ); - - application.ProcessEvent( keyevent ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); DALI_TEST_CHECK( gMaxCharactersCallBackCalled ); @@ -509,18 +535,294 @@ int utcDaliTextFieldMaxCharactersReachedN(void) gMaxCharactersCallBackCalled = false; field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback); - Dali::Integration::KeyEvent keyevent; - keyevent.keyName = "a"; - keyevent.keyString = "a"; - keyevent.keyCode = 0; - keyevent.keyModifier = 0; - keyevent.time = 0; - keyevent.state = Integration::KeyEvent::Down; - - application.ProcessEvent( keyevent ); - application.ProcessEvent( keyevent ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); DALI_TEST_CHECK( !gMaxCharactersCallBackCalled ); END_TEST; } + +int utcDaliTextFieldEvent01(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldEvent01"); + + // Creates a tap event. After creating a tap event the text field should + // have the focus and add text with key events should be possible. + + TextField field = TextField::New(); + DALI_TEST_CHECK( field ); + + Stage::GetCurrent().Add( field ); + + field.SetSize( 300.f, 50.f ); + field.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Add a key event but as the text field has not the focus it should do nothing. + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( field.GetProperty( TextField::Property::TEXT ), std::string(""), TEST_LOCATION ); + + // Create a tap event to touch the text field. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); + + // 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", 0, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( field.GetProperty( TextField::Property::TEXT ), std::string("aa"), TEST_LOCATION ); + + // Create a second text field and send key events to it. + TextField field2 = TextField::New(); + + field2.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field2.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + field2.SetSize( 100.f, 100.f ); + field2.SetPosition( 100.f, 100.f ); + + Stage::GetCurrent().Add( field2 ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Create a tap event on the second text field. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 125.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 125.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // The second text field has the focus. It should handle the key events. + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Check the text has been added to the second text field. + DALI_TEST_EQUALS( field2.GetProperty( TextField::Property::TEXT ), std::string("aa"), TEST_LOCATION ); + + END_TEST; +} + +int utcDaliTextFieldEvent02(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldEvent02"); + + // Checks if the right number of actors are created. + + TextField field = TextField::New(); + DALI_TEST_CHECK( field ); + + Stage::GetCurrent().Add( field ); + + field.SetSize( 300.f, 50.f ); + field.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Check there are the expected number of children ( active layer, offscreen root actor, and the offscreen image actor + DALI_TEST_EQUALS( field.GetChildCount(), 3u, TEST_LOCATION ); + + Actor layer = field.GetChildAt( 0u ); + DALI_TEST_CHECK( layer.IsLayer() ); + + Actor offscreenRoot = field.GetChildAt( 1u ); + DALI_TEST_CHECK( offscreenRoot.IsLayer() ); + DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor. + + Actor offscreenImage = field.GetChildAt( 2u ); + ImageActor imageActor = ImageActor::DownCast( offscreenImage ); + DALI_TEST_CHECK( imageActor ); + + // Create a tap event to touch the text field. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor. + DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor. + + // Now the text field has the focus, so it can handle the key events. + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Checks the cursor and the renderer have been created. + DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor. + DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 2u, TEST_LOCATION ); // The camera actor and the renderer + + ImageActor cursor = ImageActor::DownCast( layer.GetChildAt( 0u ) ); + DALI_TEST_CHECK( cursor ); + + CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) ); + DALI_TEST_CHECK( camera ); + + RenderableActor renderer = RenderableActor::DownCast( offscreenRoot.GetChildAt( 1u ) ); + DALI_TEST_CHECK( renderer ); + + // Move the cursor and check the position changes. + Vector3 position1 = cursor.GetCurrentPosition(); + + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + Vector3 position2 = cursor.GetCurrentPosition(); + + DALI_TEST_CHECK( position2.x < position1.x ); + + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + Vector3 position3 = cursor.GetCurrentPosition(); + + DALI_TEST_EQUALS( position1, position3, TEST_LOCATION ); // Should be in the same position1. + + // Send some taps and check the cursor positions. + + // Try to tap at the beginning. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Cursor position should be the same than position1. + Vector3 position4 = cursor.GetCurrentPosition(); + + DALI_TEST_EQUALS( position2, position4, TEST_LOCATION ); // Should be in the same position2. + + // Try to tap at the end. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 13.f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 13.0f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Cursor position should be the same than position1. + Vector3 position5 = cursor.GetCurrentPosition(); + + DALI_TEST_EQUALS( position1, position5, TEST_LOCATION ); // Should be in the same position1. + + // Remove some text. + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) ); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Cursor position should be the same than position2. + Vector3 position6 = cursor.GetCurrentPosition(); + + DALI_TEST_EQUALS( Vector3( 0.f, position2.y, position2.z ), position6, TEST_LOCATION ); // TODO Should be in the same position2. + + // Should not be renderer. + DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor only. + + END_TEST; +} + +int utcDaliTextFieldEvent03(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldEvent03"); + + // Checks if the highlight actor is created. + + TextField field = TextField::New(); + DALI_TEST_CHECK( field ); + + Stage::GetCurrent().Add( field ); + + field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." ); + field.SetSize( 30.f, 50.f ); + field.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Tap first to get the focus. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Double tap to select a word. + application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 3.f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 3.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // The offscreen root actor should have three actors: the camera, a renderer and the highlight actor. + Actor offscreenRoot = field.GetChildAt( 1u ); + DALI_TEST_CHECK( offscreenRoot.IsLayer() ); + + CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) ); + DALI_TEST_CHECK( camera ); + + RenderableActor renderer = RenderableActor::DownCast( offscreenRoot.GetChildAt( 1u ) ); + DALI_TEST_CHECK( renderer ); + + MeshActor highlight = MeshActor::DownCast( offscreenRoot.GetChildAt( 2u ) ); + DALI_TEST_CHECK( highlight ); + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index d3a3b60..dd5d091 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -236,6 +236,9 @@ int UtcDaliToolkitTextlabelBasicRenderP(void) TextLabel label = TextLabel::New("Test Text"); DALI_TEST_CHECK( label ); + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + Stage::GetCurrent().Add( label ); label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); @@ -262,6 +265,11 @@ int UtcDaliToolkitTextlabelAtlasRenderP(void) TextLabel label = TextLabel::New("Test Text"); DALI_TEST_CHECK( label ); + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + Stage::GetCurrent().Add( label ); + // Turn on all the effects label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); label.SetProperty( TextLabel::Property::MULTI_LINE, true ); @@ -297,7 +305,8 @@ int UtcDaliToolkitTextLabelLanguagesP(void) "բարեւ աշխարհը, მსოფლიოში, 안녕하세요, 你好世界, ひらがな, カタカナ, " "ওহে বিশ্ব, မင်္ဂလာပါကမ္ဘာလောက, हैलो वर्ल्ड, હેલો વર્લ્ડ, ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ ਦੁਨਿਆ, ಹಲೋ ವರ್ಲ್ಡ್, " "ഹലോ വേൾഡ്, ଓଡ଼ିଆ, හෙලෝ වර්ල්ඩ්, ஹலோ உலகம், హలో వరల్డ్, " - "ສະບາຍດີໂລກ, สวัสดีโลก, ជំរាបសួរពិភពលោក." ); + "ສະບາຍດີໂລກ, สวัสดีโลก, ជំរាបសួរពិភពលោក, " + "\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84." ); // these characters on the last line are emojis. label.SetProperty( TextLabel::Property::TEXT, scripts ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::TEXT ), scripts, TEST_LOCATION ); diff --git a/dali-toolkit/internal/text/bidirectional-support.cpp b/dali-toolkit/internal/text/bidirectional-support.cpp index 135f71b..cf9ec63 100644 --- a/dali-toolkit/internal/text/bidirectional-support.cpp +++ b/dali-toolkit/internal/text/bidirectional-support.cpp @@ -162,13 +162,6 @@ void SetBidirectionalInfo( const Vector& text, } } -void ReplaceBidirectionalInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - void ReorderLines( const Vector& bidirectionalInfo, Vector& lineRuns, Vector& lineInfoRuns ) @@ -234,14 +227,6 @@ void ReorderLines( const Vector& bidirectionalInf } } -void ReorderLines( LogicalModel& logicalModel, - const VisualModel& visualModel, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - bool GetMirroredText( const Vector& text, Vector& mirroredText ) { diff --git a/dali-toolkit/internal/text/bidirectional-support.h b/dali-toolkit/internal/text/bidirectional-support.h index f51e5e7..2f3b251 100644 --- a/dali-toolkit/internal/text/bidirectional-support.h +++ b/dali-toolkit/internal/text/bidirectional-support.h @@ -53,25 +53,6 @@ void SetBidirectionalInfo( const Vector& text, Vector& bidirectionalInfo ); /** - * Replaces the bidirectional info from the logical model. - * - * @pre The @p model needs to have a text set. - * @pre The @p model needs to have the line break info set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] model The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ -void ReplaceBidirectionalInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - -/** * Sets the visual to logical map tables. * * Any map tables previously set are removed. @@ -90,28 +71,6 @@ void ReorderLines( const Vector& bidirectionalInf Vector& lineInfoRuns ); /** - * Replaces the visual to logical and logical to visual map tables. - * - * @pre The @p logicalModel needs to have a text set. - * @pre The @p logicalModel needs to have the line break info set. - * @pre The @p visualModel needs to have the laid-out lines info set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] logicalModel The text's logical model. - * @param[in] visualModel The text's visual model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ -void ReorderLines( LogicalModel& logicalModel, - const VisualModel& visualModel, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - -/** * @brief Replaces any character which could be mirrored. * * @param[in] text The text. diff --git a/dali-toolkit/internal/text/multi-language-support-impl.cpp b/dali-toolkit/internal/text/multi-language-support-impl.cpp index f137b4d..3fa8f6f 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.cpp +++ b/dali-toolkit/internal/text/multi-language-support-impl.cpp @@ -345,13 +345,6 @@ void MultilanguageSupport::SetScripts( const Vector& text, scripts.PushBack( currentScriptRun ); } -void MultilanguageSupport::ReplaceScripts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - void MultilanguageSupport::ValidateFonts( const Vector& text, const Vector& scripts, Vector& fonts ) @@ -593,13 +586,6 @@ void MultilanguageSupport::ValidateFonts( const Vector& text, DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--MultilanguageSupport::ValidateFonts\n" ); } -void MultilanguageSupport::ValidateFonts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - } // namespace Internal } // namespace Text diff --git a/dali-toolkit/internal/text/multi-language-support-impl.h b/dali-toolkit/internal/text/multi-language-support-impl.h index 0f7e177..ee91aae 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.h +++ b/dali-toolkit/internal/text/multi-language-support-impl.h @@ -98,27 +98,12 @@ public: Vector& scripts ); /** - * @copydoc Dali::MultilanguageSupport::ReplaceScripts() - */ - void ReplaceScripts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - - /** * @copydoc Dali::MultilanguageSupport::ValidateFonts( const Vector& text, const Vector& scripts, Vector& fonts ) */ void ValidateFonts( const Vector& text, const Vector& scripts, Vector& fonts ); - /** - * @copydoc Dali::MultilanguageSupport::ValidateFonts( LogicalModel& model, CharacterIndex characterIndex, Length numberOfCharactersToRemove, Length numberOfCharactersToInsert ) - */ - void ValidateFonts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); private: Vector mDefaultFontPerScriptCache; ///< Caches the default font for a script. Vector mValidFontsPerScriptCache; ///< Caches valid fonts for a script. diff --git a/dali-toolkit/internal/text/multi-language-support.cpp b/dali-toolkit/internal/text/multi-language-support.cpp index 4416dba..8c28dd5 100644 --- a/dali-toolkit/internal/text/multi-language-support.cpp +++ b/dali-toolkit/internal/text/multi-language-support.cpp @@ -57,17 +57,6 @@ void MultilanguageSupport::SetScripts( const Vector& text, scripts ); } -void MultilanguageSupport::ReplaceScripts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ - GetImplementation( *this ).ReplaceScripts( model, - characterIndex, - numberOfCharactersToRemove, - numberOfCharactersToInsert ); -} - void MultilanguageSupport::ValidateFonts( const Vector& text, const Vector& scripts, Vector& fonts ) @@ -77,17 +66,6 @@ void MultilanguageSupport::ValidateFonts( const Vector& text, fonts ); } -void MultilanguageSupport::ValidateFonts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ - GetImplementation( *this ).ValidateFonts( model, - characterIndex, - numberOfCharactersToRemove, - numberOfCharactersToInsert ); -} - } // namespace Text } // namespace Toolkit diff --git a/dali-toolkit/internal/text/multi-language-support.h b/dali-toolkit/internal/text/multi-language-support.h index b70f672..a22676c 100644 --- a/dali-toolkit/internal/text/multi-language-support.h +++ b/dali-toolkit/internal/text/multi-language-support.h @@ -99,24 +99,6 @@ public: Vector& scripts ); /** - * Replaces the scrips of the given range of characters. - * - * @pre The @p model needs to have a text set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] model The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ - void ReplaceScripts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - - /** * @brief Validates the character's font of the whole text. * * It may update fonts set by application developers. @@ -136,28 +118,6 @@ public: void ValidateFonts( const Vector& text, const Vector& scripts, Vector& fonts ); - - /** - * Validates the character's font of the given range of characters. - * - * It may update fonts set by the mark-up processor. - * It sets default fonts based on the script to those characters without a font set. - * - * @pre The @p model needs to have a text set. - * @pre The @p model needs to have the scripts set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] model The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ - void ValidateFonts( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); }; } // namespace Text diff --git a/dali-toolkit/internal/text/segmentation.cpp b/dali-toolkit/internal/text/segmentation.cpp index 3889793..466991b 100644 --- a/dali-toolkit/internal/text/segmentation.cpp +++ b/dali-toolkit/internal/text/segmentation.cpp @@ -84,13 +84,6 @@ void SetLineBreakInfo( const Vector& text, #endif } -void ReplaceLineBreakInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - void SetWordBreakInfo( const Vector& text, Vector& wordBreakInfo ) { @@ -126,13 +119,6 @@ void SetWordBreakInfo( const Vector& text, #endif } -void ReplaceWordBreakInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - } // namespace Text } // namespace Toolkit diff --git a/dali-toolkit/internal/text/segmentation.h b/dali-toolkit/internal/text/segmentation.h index 949b1c9..4bbe5d5 100644 --- a/dali-toolkit/internal/text/segmentation.h +++ b/dali-toolkit/internal/text/segmentation.h @@ -51,24 +51,6 @@ void SetLineBreakInfo( const Vector& text, Vector& lineBreakInfo ); /** - * Replaces line break info. - * - * @pre The @p model needs to have a text set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] model The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ -void ReplaceLineBreakInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - -/** * Sets word break info. * * - 0 is a WORD_BREAK. Text can be broken into a new word. @@ -80,24 +62,6 @@ void ReplaceLineBreakInfo( LogicalModel& model, void SetWordBreakInfo( const Vector& text, Vector& wordBreakInfo ); -/** - * Replaces word break info. - * - * @pre The @p model needs to have a text set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] model The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ -void ReplaceWordBreakInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - } // namespace Text } // namespace Toolkit diff --git a/dali-toolkit/internal/text/shaper.cpp b/dali-toolkit/internal/text/shaper.cpp index c236d28..9ca8e9f 100644 --- a/dali-toolkit/internal/text/shaper.cpp +++ b/dali-toolkit/internal/text/shaper.cpp @@ -225,14 +225,6 @@ void ShapeText( const Vector& text, glyphToCharacterMap.Resize( totalNumberOfGlyphs ); } -void ShapeText( const LogicalModel& logicalModel, - VisualModel& visualModel, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ) -{ -} - } // namespace Text } // namespace Toolkit diff --git a/dali-toolkit/internal/text/shaper.h b/dali-toolkit/internal/text/shaper.h index d423cc5..f07cf49 100644 --- a/dali-toolkit/internal/text/shaper.h +++ b/dali-toolkit/internal/text/shaper.h @@ -56,29 +56,6 @@ void ShapeText( const Vector& text, Vector& glyphToCharacterMap, Vector& charactersPerGlyph ); -/** - * Replaces the shape info of the given range of characters. - * - * @pre The @p model needs to have a text set. - * @pre The @p model needs to have the scripts set. - * @pre The @p model needs to have the fonts set. - * @pre The @p model needs to have the bidirectional info set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in] logicalModel The text's logical model. - * @param[in,out] visualModel The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ -void ShapeText( const LogicalModel& logicalModel, - VisualModel& visualModel, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - } // namespace Text } // namespace Toolkit