dali.node
dali.doxy
install_manifest.txt
-libdali-toolkit.so*
+libdali2-toolkit.so*
*~
*.o
*.o.d
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- dali-core
- dali-adaptor
- dali-toolkit
+ dali2-core
+ dali2-adaptor
+ dali2-toolkit
)
ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror -DDEBUG_ENABLED )
controller->SetText( text );
// Select the whole text.
- controller->SelectEvent( 0.f, 0.f, false );
+ controller->SelectEvent( 0.f, 0.f, SelectionType::INTERACTIVE );
// Perform a relayout
const Size size( Dali::Stage::GetCurrent().GetSize() );
DALI_TEST_EQUALS( "Hello", retrieved_text, TEST_LOCATION );
// Select the whole text.
- controller->SelectEvent( 0.f, 0.f, true );
+ controller->SelectEvent( 0.f, 0.f, SelectionType::ALL );
// Perform a relayout
controller->Relayout( size );
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- dali-core
- dali-toolkit
+ dali2-core
+ dali2-toolkit
)
ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- dali-core
- dali-adaptor
- dali-toolkit
+ dali2-core
+ dali2-adaptor
+ dali2-toolkit
)
# Locate GTest
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- dali-core
- dali-adaptor
- dali-toolkit
+ dali2-core
+ dali2-adaptor
+ dali2-toolkit
)
ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror -DDEBUG_ENABLED)
END_TEST;
}
+
+int UtcDaliTextFieldSelectNone(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();
+
+ textField.SetProperty( TextField::Property::TEXT, "Hello world" );
+
+ application.SendNotification();
+ application.Render();
+
+ // Nothing is selected
+ std::string selectedText = textField.GetProperty( DevelTextField::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "", selectedText, TEST_LOCATION );
+
+ DevelTextField::SelectWholeText( textField );
+
+ application.SendNotification();
+ application.Render();
+
+ // whole text is selected
+ selectedText = textField.GetProperty( DevelTextField::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "Hello world", selectedText, TEST_LOCATION );
+
+ DevelTextField::SelectNone( textField );
+
+ application.SendNotification();
+ application.Render();
+
+ // Nothing is selected
+ selectedText = textField.GetProperty( DevelTextField::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "", selectedText, TEST_LOCATION );
+
+ END_TEST;
+}
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_POLICY(SET CMP0012 NEW) # Prevent dereferencing of OFF/ON as variables
-SET(name "dali-toolkit")
+SET(name "dali2-toolkit")
PROJECT(${name})
SET(PKG_NAME ${name})
endif()
# API VERSION (Not DALi release version)
-SET(${name}_VERSION_MAJOR 0)
+SET(${name}_VERSION_MAJOR 2)
SET(${name}_VERSION_MINOR 0)
SET(${name}_VERSION_PATCH 0)
SET(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_VERSION_PATCH} )
IF( ENABLE_PKG_CONFIGURE )
FIND_PACKAGE( PkgConfig REQUIRED )
- PKG_CHECK_MODULES(DALICORE REQUIRED dali-core)
- PKG_CHECK_MODULES(DALIADAPTOR REQUIRED dali-adaptor)
+ PKG_CHECK_MODULES(DALICORE REQUIRED dali2-core)
+ PKG_CHECK_MODULES(DALIADAPTOR REQUIRED dali2-adaptor)
ENDIF()
IF( INSTALL_DOXYGEN_DOC )
IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
FIND_PACKAGE( dali-windows-dependencies REQUIRED)
- FIND_PACKAGE( dali-core REQUIRED)
- FIND_PACKAGE( dali-adaptor REQUIRED)
+ FIND_PACKAGE( dali2-core REQUIRED)
+ FIND_PACKAGE( dali2-adaptor REQUIRED)
ENDIF()
SET( VCPKG_INCLUDE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
# Requires the following variables to be setup:
# @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@
SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} )
- SET( CORE_PKG_CFG_FILE dali-toolkit.pc )
+ SET( CORE_PKG_CFG_FILE dali2-toolkit.pc )
CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY )
ENDIF()
IF( WIN32 )
SET( DALICORE_LDFLAGS
"${DALICORE_LDFLAGS}"
- dali-core::dali-core )
+ dali2-core::dali2-core )
FIND_PACKAGE( pthreads REQUIRED )
FIND_PACKAGE( curl REQUIRED )
SET( DALIADAPTOR_LDFLAGS
"${DALIADAPTOR_LDFLAGS}"
- dali-adaptor::dali-adaptor )
+ dali2-adaptor::dali2-adaptor )
ENDIF()
Name: Dali 3D Engine Toolkit
Description: Cross platform 3D Engine Toolkit
Version: ${apiversion}
-Requires: dali-core
-Libs: -L${libdir} -ldali-toolkit
+Requires: dali2-core
+Libs: -L${libdir} -ldali2-toolkit
Cflags: -I${includedir}
GetImpl( textField ).SelectWholeText();
}
+void SelectNone( TextField textField )
+{
+ GetImpl( textField ).SelectNone();
+}
+
} // namespace DevelText
} // namespace Toolkit
* @note Use "textBackground" as property name to avoid conflict with Control's "background" property.
* @note The default value is Color::TRANSPARENT.
*/
- BACKGROUND = ELLIPSIS + 5
+ BACKGROUND = ELLIPSIS + 5,
+
+
+ /**
+ * @brief The selected text in UTF-8 format.
+ * @details Name "selectedText", type Property::STRING.
+ * @note This property is read-only.
+ */
+ SELECTED_TEXT = ELLIPSIS + 6
};
} // namespace Property
* @brief Select the whole text of TextField.
*
* @param[in] textField The instance of TextField.
- * @return InputMethodContext instance.
*/
DALI_TOOLKIT_API void SelectWholeText( TextField textField );
+/**
+ * @brief Unselect the whole text of TextField.
+ *
+ * @param[in] textField The instance of TextField.
+ */
+DALI_TOOLKIT_API void SelectNone( TextField textField );
+
+/**
+ * @brief Get the selected text of TextField.
+ *
+ * @param[in] textField The instance of TextField.
+ * @return Selected text in the TextField.
+ */
+DALI_TOOLKIT_API std::string SelectedText( TextField textField );
+
} // namespace DevelText
} // namespace Toolkit
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "textBackground", VECTOR4, BACKGROUND )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextField, "selectedText", STRING, SELECTED_TEXT )
DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
}
break;
}
+ case Toolkit::DevelTextField::Property::SELECTED_TEXT:
+ {
+ if( impl.mController )
+ {
+ value = impl.mController->GetSelectedText( );
+ }
+ break;
+ }
} //switch
}
{
if( mController && mController->IsShowingRealText() )
{
- mController->SelectEvent( 0.f, 0.f, true );
+ mController->SelectEvent( 0.f, 0.f, SelectionType::ALL );
+ SetKeyInputFocus();
+ }
+}
+
+void TextField::SelectNone()
+{
+ if( mController && mController->IsShowingRealText() )
+ {
+ mController->SelectEvent( 0.f, 0.f, SelectionType::NONE );
SetKeyInputFocus();
}
}
*/
void SelectWholeText();
+ /**
+ * @brief Called to unselect the whole texts.
+ */
+ void SelectNone();
+
+ /**
+ * @brief Called to get selected text.
+ * @return Selected text in the TextField.
+ */
+ std::string SelectedText();
+
private: // From Control
/**
OnSelectAllEvent();
break;
}
+ case Event::SELECT_NONE:
+ {
+ OnSelectNoneEvent();
+ break;
+ }
}
}
}
}
}
+void Controller::Impl::OnSelectNoneEvent()
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "OnSelectNoneEvent mEventData->mSelectionEnabled%s \n", mEventData->mSelectionEnabled?"true":"false");
+
+ if( NULL == mEventData )
+ {
+ // Nothing to do if there is no text.
+ return;
+ }
+
+ if( mEventData->mSelectionEnabled && mEventData->mState == EventData::SELECTING)
+ {
+ mEventData->mPrimaryCursorPosition = 0u;
+ mEventData->mLeftSelectionPosition = mEventData->mRightSelectionPosition = mEventData->mPrimaryCursorPosition;
+ ChangeState( EventData::INACTIVE );
+ mEventData->mUpdateCursorPosition = true;
+ mEventData->mUpdateInputStyle = true;
+ mEventData->mScrollAfterUpdatePosition = true;
+ }
+}
+
void Controller::Impl::RetrieveSelection( std::string& selectedText, bool deleteAfterRetrieval )
{
if( mEventData->mLeftSelectionPosition == mEventData->mRightSelectionPosition )
LEFT_SELECTION_HANDLE_EVENT,
RIGHT_SELECTION_HANDLE_EVENT,
SELECT,
- SELECT_ALL
+ SELECT_ALL,
+ SELECT_NONE,
};
union Param
void OnSelectAllEvent();
+ void OnSelectNoneEvent();
+
/**
* @brief Retrieves the selected text. It removes the text if the @p deleteAfterRetrieval parameter is @e true.
*
}
}
-void Controller::SelectEvent( float x, float y, bool selectAll )
+void Controller::SelectEvent( float x, float y, SelectionType selectType )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SelectEvent\n" );
if( NULL != mImpl->mEventData )
{
- if( selectAll )
+ if( selectType == SelectionType::ALL )
{
Event event( Event::SELECT_ALL );
mImpl->mEventData->mEventQueue.push_back( event );
}
+ else if( selectType == SelectionType::NONE )
+ {
+ Event event( Event::SELECT_NONE );
+ mImpl->mEventData->mEventQueue.push_back( event );
+ }
else
{
Event event( Event::SELECT );
if( mImpl->mEventData->mSelectionEnabled )
{
// Creates a SELECT event.
- SelectEvent( currentCursorPosition.x, currentCursorPosition.y, false );
+ SelectEvent( currentCursorPosition.x, currentCursorPosition.y, SelectionType::INTERACTIVE );
}
break;
}
case Toolkit::TextSelectionPopup::SELECT_ALL:
{
// Creates a SELECT_ALL event
- SelectEvent( 0.f, 0.f, true );
+ SelectEvent( 0.f, 0.f, SelectionType::ALL );
break;
}
case Toolkit::TextSelectionPopup::CLIPBOARD:
return textRemoved;
}
+std::string Controller::GetSelectedText()
+{
+ std::string text;
+ if( EventData::SELECTING == mImpl->mEventData->mState )
+ {
+ mImpl->RetrieveSelection( text, false );
+ }
+ return text;
+}
+
// private : Relayout.
bool Controller::DoRelayout( const Size& size,
class View;
class RenderingController;
+ /**
+ * @brief Text selection operations .
+ */
+ enum SelectionType
+ {
+ INTERACTIVE = 0x0000,
+ ALL = 0x0001,
+ NONE = 0x0002
+ };
+
typedef IntrusivePtr<Controller> ControllerPtr;
/**
*
* @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.
+ * @param[in] selection type like the whole text is selected or unselected.
*/
- void SelectEvent( float x, float y, bool selectAll );
+ void SelectEvent( float x, float y, SelectionType selection );
/**
* @brief Event received from input method context
*/
Actor CreateBackgroundActor();
+ /**
+ * @brief Retrive Selected text.
+ *
+ * @return The seleced text.
+ */
+ std::string GetSelectedText();
+
protected: // Inherit from Text::Decorator::ControllerInterface.
/**
* @SINCE_1_2.60
* @note PLACEHOLDER map is used to add ellipsis to placeholder text.
*/
- ELLIPSIS,
+ ELLIPSIS
};
};
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 9;
-const unsigned int TOOLKIT_MICRO_VERSION = 10;
+const unsigned int TOOLKIT_MICRO_VERSION = 11;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
-Name: dali-toolkit
+Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.9.10
+Version: 1.9.11
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
BuildRequires: cmake
BuildRequires: pkgconfig
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(dali-core)
-BuildRequires: pkgconfig(dali-adaptor)
+BuildRequires: pkgconfig(dali2-core)
+BuildRequires: pkgconfig(dali2-adaptor)
BuildRequires: gettext
BuildRequires: pkgconfig(libtzplatform-config)
-Provides: libdali-toolkit-cxx11.so
-Provides: libdali-toolkit-cxx11.so.0
-Provides: libdali-toolkit-cxx11.so.0.0.0
#############################
# profile setup
# PO
{
-cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
+cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
for language in *.po
do
language=${language%.po}
%endif
libtoolize --force
-cd %{_builddir}/dali-toolkit-%{version}/build/tizen
+cd %{_builddir}/dali2-toolkit-%{version}/build/tizen
DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
# PO
{
-cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
+cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
for language in *.mo
do
language=${language%.mo}
} &> /dev/null
popd
-# Create links to ensure linking with cxx11 library is preserved
-pushd %{buildroot}%{_libdir}
-ln -sf libdali-toolkit.so libdali-toolkit-cxx11.so
-ln -sf libdali-toolkit.so libdali-toolkit-cxx11.so.0
-ln -sf libdali-toolkit.so libdali-toolkit-cxx11.so.0.0.0
-popd
-
# Remove default style and style images which are for Linux build
rm -rf %{buildroot}%{dali_toolkit_style_files}/*
%manifest dali-toolkit.manifest
%endif
%defattr(-,root,root,-)
-%{_libdir}/libdali-toolkit-cxx11.so*
-%{_libdir}/libdali-toolkit.so*
+%{_libdir}/libdali2-toolkit.so*
%license LICENSE
%files devel
%defattr(-,root,root,-)
%{dev_include_path}/dali-toolkit/*
-%{_libdir}/pkgconfig/dali-toolkit.pc
+%{_libdir}/pkgconfig/dali2-toolkit.pc
%files resources_360x360
%manifest dali-toolkit-resources.manifest