From: Adeel Kazmi Date: Wed, 17 Apr 2019 14:31:22 +0000 (+0000) Subject: Merge "Italic synthesize for circular layout." into devel/master X-Git-Tag: dali_1.4.16~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=b03acd78e2289973171be301c1e04fbb5b778d29;hp=8e590b5d8de9d41a1b95595f97e1d9c6123c8286 Merge "Italic synthesize for circular layout." into devel/master --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp index d37a1db..95f7697 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1002,3 +1003,45 @@ int UtcDaliTextControllerCheckInputFontPointSizeChanged(void) END_TEST; } + +int UtcDaliTextControllerSelectEvent(void) +{ + tet_infoline(" UtcDaliTextControllerSelectEvent"); + ToolkitTestApplication application; + + // Creates a text controller. + ControllerPtr controller = Controller::New(); + + // Configures the text controller similarly to the text-field. + ConfigureTextField( controller ); + + // Set the text + const std::string text("Hello World!"); + controller->SetText( text ); + + // Select the whole text. + controller->SelectEvent( 0.f, 0.f, false ); + + // Perform a relayout + const Size size( Dali::Stage::GetCurrent().GetSize() ); + controller->Relayout(size); + + // Get the implementation of the text controller + Controller::Impl& mImpl = Controller::Impl::GetImplementation( *controller.Get() ); + + // Check if the whole text is selected or not. + std::string retrieved_text; + mImpl.RetrieveSelection( retrieved_text, false ); + DALI_TEST_EQUALS( "Hello", retrieved_text, TEST_LOCATION ); + + // Select the whole text. + controller->SelectEvent( 0.f, 0.f, true ); + + // Perform a relayout + controller->Relayout( size ); + + mImpl.RetrieveSelection( retrieved_text, false ); + DALI_TEST_EQUALS( text, retrieved_text, TEST_LOCATION ); + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp index 02439bc..8372e03 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,6 +104,16 @@ void TestGlAbstraction::PostRender() { } +bool TestGlAbstraction::IsSurfacelessContextSupported() const +{ + return true; +} + +bool TestGlAbstraction::TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const +{ + return ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) ); +} + } // Namespace dali bool BlendEnabled(const Dali::TraceCallStack& callStack) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h index c68573b..6572dbc 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h @@ -2,7 +2,7 @@ #define TEST_GL_ABSTRACTION_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,6 +59,10 @@ public: void PreRender(); void PostRender(); + bool IsSurfacelessContextSupported() const; + + bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const; + /* OpenGL ES 2.0 */ inline void ActiveTexture( GLenum textureUnit ) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 893d26a..4c126be 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -102,6 +102,7 @@ const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis const char* const PROPERTY_NAME_ENABLE_SHIFT_SELECTION = "enableShiftSelection"; const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE = "enableGrabHandle"; const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection"; +const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup"; const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f ); const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color. @@ -539,6 +540,7 @@ int UtcDaliTextFieldGetPropertyP(void) DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextField::Property::ENABLE_SHIFT_SELECTION ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextField::Property::ENABLE_GRAB_HANDLE ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ); + DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP ); END_TEST; } @@ -993,6 +995,11 @@ int UtcDaliTextFieldSetPropertyP(void) field.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); DALI_TEST_EQUALS( field.GetProperty( Actor::Property::LAYOUT_DIRECTION ), static_cast( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); + // Test the ENABLE_GRAB_HANDLE_POPUP property + DALI_TEST_CHECK( field.GetProperty( DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP ) ); + field.SetProperty( DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP, false ); + DALI_TEST_CHECK( !field.GetProperty( DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP ) ); + application.SendNotification(); application.Render(); @@ -2927,7 +2934,6 @@ int utcDaliTextFieldLayoutDirectionCoverage(void) END_TEST; } - int UtcDaliTextFieldGetInputMethodContext(void) { ToolkitTestApplication application; @@ -2939,3 +2945,54 @@ int UtcDaliTextFieldGetInputMethodContext(void) END_TEST; } +int UtcDaliTextFieldSelectWholeText(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextFieldSelectWholeText "); + + TextField textField = TextField::New(); + + Stage::GetCurrent().Add( textField ); + + textField.SetSize( 300.f, 50.f ); + textField.SetParentOrigin( ParentOrigin::TOP_LEFT ); + textField.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( 1u, textField.GetChildCount(), TEST_LOCATION ); + + DevelTextField::SelectWholeText( textField ); + + application.SendNotification(); + application.Render(); + + // Nothing should have been selected. The number of children is still 1 + DALI_TEST_EQUALS( 1u, textField.GetChildCount(), TEST_LOCATION ); + + textField.SetProperty( TextField::Property::TEXT, "Hello world" ); + + application.SendNotification(); + application.Render(); + + DevelTextField::SelectWholeText( textField ); + + application.SendNotification(); + application.Render(); + + // Should be 2 children, the stencil and the layer + DALI_TEST_EQUALS( 2u, textField.GetChildCount(), TEST_LOCATION ); + + // The offscreen root actor should have two actors: the renderer and the highlight actor. + Actor stencil = textField.GetChildAt( 0u ); + + // The highlight actor is drawn first, so is the first actor in the list + Renderer highlight = stencil.GetChildAt( 0u ).GetRendererAt( 0u ); + 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 96fcb63..8328b7e 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -395,8 +395,18 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) label.SetProperty( TextLabel::Property::TEXT, "MarkupText" ); DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::TEXT ), std::string("MarkupText"), TEST_LOCATION ); - application.SendNotification(); - application.Render(); + // Check for incomplete marks. + label.SetProperty( TextLabel::Property::TEXT, "MarkupText" ); + DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::TEXT ), std::string("MarkupText"), TEST_LOCATION ); + try + { + application.SendNotification(); + application.Render(); + } + catch( ... ) + { + tet_result(TET_FAIL); + } // Check autoscroll properties const int SCROLL_SPEED = 80; diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp index f9b739c..a53ef4a 100755 --- a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp @@ -33,6 +33,11 @@ InputMethodContext GetInputMethodContext( TextField textField ) return GetImpl( textField ).GetInputMethodContext(); } +void SelectWholeText( TextField textField ) +{ + GetImpl( textField ).SelectWholeText(); +} + } // namespace DevelText } // namespace Toolkit diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h index cef786a..5e92a92 100755 --- a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h @@ -107,7 +107,14 @@ namespace Property * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write * @note The default value is false */ - MATCH_SYSTEM_LANGUAGE_DIRECTION = ELLIPSIS + 3 + MATCH_SYSTEM_LANGUAGE_DIRECTION = ELLIPSIS + 3, + + /** + * @brief Enables the grab handle popup for text selection. + * @details Name "enableGrabHandlePopup", type Property::BOOLEAN. + * @note The default value is true, which means the grab handle popup is enabled by default. + */ + ENABLE_GRAB_HANDLE_POPUP = ELLIPSIS + 4 }; } // namespace Property @@ -120,6 +127,14 @@ namespace Property */ DALI_TOOLKIT_API InputMethodContext GetInputMethodContext( TextField textField ); +/** + * @brief Select the whole text of TextField. + * + * @param[in] textField The instance of TextField. + * @return InputMethodContext instance. + */ +DALI_TOOLKIT_API void SelectWholeText( TextField textField ); + } // namespace DevelText } // namespace Toolkit diff --git a/dali-toolkit/devel-api/text/bitmap-font.cpp b/dali-toolkit/devel-api/text/bitmap-font.cpp index 6c22e44..77bf3ff 100755 --- a/dali-toolkit/devel-api/text/bitmap-font.cpp +++ b/dali-toolkit/devel-api/text/bitmap-font.cpp @@ -59,7 +59,8 @@ BitmapFontDescription::BitmapFontDescription() : glyphs{}, name{}, underlinePosition{ 0.f }, - underlineThickness{ 1.f } + underlineThickness{ 1.f }, + isColorFont{ false } {} BitmapFontDescription::~BitmapFontDescription() diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 5270ea9..bf953ec 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -133,6 +133,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "ellipsis", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableShiftSelection", BOOLEAN, ENABLE_SHIFT_SELECTION ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandle", BOOLEAN, ENABLE_GRAB_HANDLE ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED ) @@ -764,6 +765,17 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } + case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP: + { + if (impl.mController) + { + const bool grabHandlePopupEnabled = value.Get(); + DALI_LOG_INFO(gLogFilter, Debug::General, "TextField %p ENABLE_GRAB_HANDLE_POPUP %d\n", impl.mController.Get(), grabHandlePopupEnabled); + + impl.mController->SetGrabHandlePopupEnabled(grabHandlePopupEnabled); + break; + } + } } // switch } // textfield } @@ -1171,12 +1183,29 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } break; } + case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP: + { + if (impl.mController) + { + value = impl.mController->IsGrabHandlePopupEnabled(); + } + break; + } } //switch } return value; } +void TextField::SelectWholeText() +{ + if( mController && mController->IsShowingRealText() ) + { + mController->SelectEvent( 0.f, 0.f, true ); + SetKeyInputFocus(); + } +} + InputMethodContext TextField::GetInputMethodContext() { return mInputMethodContext; diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.h b/dali-toolkit/internal/controls/text-controls/text-field-impl.h index 495f789..3b1062e 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -102,6 +102,11 @@ public: */ Toolkit::TextField::InputStyleChangedSignalType& InputStyleChangedSignal(); + /** + * @brief Called to select the whole texts. + */ + void SelectWholeText(); + private: // From Control /** diff --git a/dali-toolkit/internal/text/markup-processor.cpp b/dali-toolkit/internal/text/markup-processor.cpp index 4565b9d..dac4f92 100755 --- a/dali-toolkit/internal/text/markup-processor.cpp +++ b/dali-toolkit/internal/text/markup-processor.cpp @@ -503,6 +503,12 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma StyleStack::RunIndex colorRunIndex = 0u; StyleStack::RunIndex fontRunIndex = 0u; + // check tag reference + int colorTagReference = 0u; + int fontTagReference = 0u; + int iTagReference = 0u; + int bTagReference = 0u; + // Give an initial default value to the model's vectors. markupProcessData.colorRuns.Reserve( DEFAULT_VECTOR_SIZE ); markupProcessData.fontRuns.Reserve( DEFAULT_VECTOR_SIZE ); @@ -542,12 +548,19 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma // Point the next color run. ++colorRunIndex; + + // Increase reference + ++colorTagReference; } else { - // Pop the top of the stack and set the number of characters of the run. - ColorRun& colorRun = *( markupProcessData.colorRuns.Begin() + styleStack.Pop() ); - colorRun.characterRun.numberOfCharacters = characterIndex - colorRun.characterRun.characterIndex; + if( colorTagReference > 0 ) + { + // Pop the top of the stack and set the number of characters of the run. + ColorRun& colorRun = *( markupProcessData.colorRuns.Begin() + styleStack.Pop() ); + colorRun.characterRun.numberOfCharacters = characterIndex - colorRun.characterRun.characterIndex; + --colorTagReference; + } } } // else if( TokenComparison( XHTML_I_TAG, tag.buffer, tag.length ) ) @@ -571,12 +584,19 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma // Point the next free font run. ++fontRunIndex; + + // Increase reference + ++iTagReference; } else { - // Pop the top of the stack and set the number of characters of the run. - FontDescriptionRun& fontRun = *( markupProcessData.fontRuns.Begin() + styleStack.Pop() ); - fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; + if( iTagReference > 0 ) + { + // Pop the top of the stack and set the number of characters of the run. + FontDescriptionRun& fontRun = *( markupProcessData.fontRuns.Begin() + styleStack.Pop() ); + fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; + --iTagReference; + } } } // else if( TokenComparison( XHTML_U_TAG, tag.buffer, tag.length ) ) @@ -611,12 +631,19 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma // Point the next free font run. ++fontRunIndex; + + // Increase reference + ++bTagReference; } else { - // Pop the top of the stack and set the number of characters of the run. - FontDescriptionRun& fontRun = *( markupProcessData.fontRuns.Begin() + styleStack.Pop() ); - fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; + if( bTagReference > 0 ) + { + // Pop the top of the stack and set the number of characters of the run. + FontDescriptionRun& fontRun = *( markupProcessData.fontRuns.Begin() + styleStack.Pop() ); + fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; + --bTagReference; + } } } // else if( TokenComparison( XHTML_FONT_TAG, tag.buffer, tag.length ) ) @@ -640,12 +667,19 @@ void ProcessMarkupString( const std::string& markupString, MarkupProcessData& ma // Point the next free font run. ++fontRunIndex; + + // Increase reference + ++fontTagReference; } else { - // Pop the top of the stack and set the number of characters of the run. - FontDescriptionRun& fontRun = *( markupProcessData.fontRuns.Begin() + styleStack.Pop() ); - fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; + if( fontTagReference > 0 ) + { + // Pop the top of the stack and set the number of characters of the run. + FontDescriptionRun& fontRun = *( markupProcessData.fontRuns.Begin() + styleStack.Pop() ); + fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; + --fontTagReference; + } } } // else if( TokenComparison( XHTML_SHADOW_TAG, tag.buffer, tag.length ) ) diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index acf6291..09395d0 100755 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -1847,15 +1847,13 @@ void Controller::Impl::OnSelectAllEvent() if( mEventData->mSelectionEnabled ) { - ChangeState( EventData::SELECTING ); + // Calculates the logical position from the start. + RepositionSelectionHandles( 0.f - mModel->mScrollPosition.x, + 0.f - mModel->mScrollPosition.y, + Controller::NoTextTap::HIGHLIGHT ); mEventData->mLeftSelectionPosition = 0u; mEventData->mRightSelectionPosition = mModel->mLogicalModel->mText.Count(); - - mEventData->mScrollAfterUpdatePosition = true; - mEventData->mUpdateLeftSelectionPosition = true; - mEventData->mUpdateRightSelectionPosition = true; - mEventData->mUpdateHighlightBox = true; } } diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 58bf52a..e0c63c8 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -435,6 +435,11 @@ void Controller::SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection mImpl->mLayoutDirection = layoutDirection; } +bool Controller::IsShowingRealText() const +{ + return mImpl->IsShowingRealText(); +} + void Controller::SetLineWrapMode( Text::LineWrap::Mode lineWrapMode ) { @@ -522,6 +527,16 @@ bool Controller::IsGrabHandleEnabled() const return mImpl->mEventData->mGrabHandleEnabled; } +void Controller::SetGrabHandlePopupEnabled(bool enabled) +{ + mImpl->mEventData->mGrabHandlePopupEnabled = enabled; +} + +bool Controller::IsGrabHandlePopupEnabled() const +{ + return mImpl->mEventData->mGrabHandlePopupEnabled; +} + // public : Update void Controller::SetText( const std::string& text ) @@ -2814,6 +2829,32 @@ void Controller::LongPressEvent( Gesture::State state, float x, float y ) } } +void Controller::SelectEvent( float x, float y, bool selectAll ) +{ + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SelectEvent\n" ); + + if( NULL != mImpl->mEventData ) + { + if( selectAll ) + { + Event event( Event::SELECT_ALL ); + mImpl->mEventData->mEventQueue.push_back( event ); + } + else + { + Event event( Event::SELECT ); + event.p2.mFloat = x; + event.p3.mFloat = y; + mImpl->mEventData->mEventQueue.push_back( event ); + } + + mImpl->mEventData->mCheckScrollAmount = true; + mImpl->mEventData->mIsLeftHandleSelected = true; + mImpl->mEventData->mIsRightHandleSelected = true; + mImpl->RequestRelayout(); + } +} + InputMethodContext::CallbackData Controller::OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ) { // Whether the text needs to be relaid-out. @@ -3862,32 +3903,6 @@ void Controller::TextDeletedEvent() mImpl->mOperationsPending = ALL_OPERATIONS; } -void Controller::SelectEvent( float x, float y, bool selectAll ) -{ - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SelectEvent\n" ); - - if( NULL != mImpl->mEventData ) - { - if( selectAll ) - { - Event event( Event::SELECT_ALL ); - mImpl->mEventData->mEventQueue.push_back( event ); - } - else - { - Event event( Event::SELECT ); - event.p2.mFloat = x; - event.p3.mFloat = y; - mImpl->mEventData->mEventQueue.push_back( event ); - } - - mImpl->mEventData->mCheckScrollAmount = true; - mImpl->mEventData->mIsLeftHandleSelected = true; - mImpl->mEventData->mIsRightHandleSelected = true; - mImpl->RequestRelayout(); - } -} - bool Controller::DeleteEvent( int keyCode ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p KeyCode : %d \n", this, keyCode ); diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index 592b19d..f105e0c 100755 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -421,6 +421,20 @@ public: // Configure the text controller. bool IsGrabHandleEnabled() const; /** + * @brief Enable or disable the grab handles for text selection. + * + * @param[in] enabled Whether to enable the grab handles + */ + void SetGrabHandlePopupEnabled( bool enabled ); + + /** + * @brief Returns whether the grab handles are enabled. + * + * @return True if the grab handles are enabled + */ + bool IsGrabHandlePopupEnabled() const; + + /** * @brief Sets input type to password * * @note The string is displayed hidden character @@ -1261,6 +1275,11 @@ public: // Queries & retrieves. */ void SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection ); + /** + * @brief Retrieves if showing real text or not. + * @return The value of showing real text. + */ + bool IsShowingRealText() const; public: // Relayout. @@ -1341,6 +1360,17 @@ public: // Text-input Event Queuing. void LongPressEvent( Gesture::State state, float x, float y ); /** + * @brief Creates a selection event. + * + * It could be called from the TapEvent (double tap) or when the text selection popup's sellect all button is pressed. + * + * @param[in] x The x position relative to the top-left of the parent control. + * @param[in] y The y position relative to the top-left of the parent control. + * @param[in] selectAll Whether the whole text is selected. + */ + void SelectEvent( float x, float y, bool selectAll ); + + /** * @brief Event received from input method context * * @param[in] inputMethodContext The input method context. @@ -1475,17 +1505,6 @@ private: // Events. void TextDeletedEvent(); /** - * @brief Creates a selection event. - * - * It could be called from the TapEvent (double tap) or when the text selection popup's sellect all button is pressed. - * - * @param[in] x The x position relative to the top-left of the parent control. - * @param[in] y The y position relative to the top-left of the parent control. - * @param[in] selectAll Whether the whole text is selected. - */ - void SelectEvent( float x, float y, bool selectAll ); - - /** * @brief Helper to KeyEvent() to handle the backspace or delete key case. * * @param[in] keyCode The keycode for the key pressed diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index e34bbe8..bfc95f9 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 = 14; +const unsigned int TOOLKIT_MICRO_VERSION = 15; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/docs/content/shared-javascript-and-cpp-documentation/build-guide.md b/docs/content/shared-javascript-and-cpp-documentation/build-guide.md index d6cd7e1..9a35da8 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/build-guide.md +++ b/docs/content/shared-javascript-and-cpp-documentation/build-guide.md @@ -51,7 +51,7 @@ make install -j8 ~~~{.sh} cd dali-adaptor/build/tizen autoreconf --install -./configure --prefix=$DESKTOP_PREFIX --enable-profile=UBUNTU --enable-gles=20 +./configure --prefix=$DESKTOP_PREFIX --enable-profile=UBUNTU make install -j8 ~~~ diff --git a/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md b/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md index 0fb72c6..a11e875 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md +++ b/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md @@ -44,7 +44,7 @@ Stagehand connects to DALi via network using a TCP/IP connection, to enable this Here is an example dali-adaptor configure line: ~~~ -$ CXXFLAGS="-g -O0 -Wno-unused-local-typedefs" CXX="ccache g++" ./configure --prefix=$DESKTOP_PREFIX --enable-debug=yes --enable-profile=UBUNTU --enable-gles=20 --enable-networklogging +$ CXXFLAGS="-g -O0 -Wno-unused-local-typedefs" CXX="ccache g++" ./configure --prefix=$DESKTOP_PREFIX --enable-debug=yes --enable-profile=UBUNTU --enable-networklogging ~~~ Once this RPM is installed, you can run your DALi application and connect Stagehand to it. diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index c5d488f..fa863fd 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.14 +Version: 1.4.15 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT