[dali_1.9.25] Merge branch 'devel/master' 95/241095/1
authorgreynaga <g.reynaga@samsung.com>
Fri, 14 Aug 2020 10:39:46 +0000 (11:39 +0100)
committergreynaga <g.reynaga@samsung.com>
Fri, 14 Aug 2020 10:39:46 +0000 (11:39 +0100)
Change-Id: I2357c57e8defdebca2149b9406d6ead1cf9f6760

23 files changed:
README.md
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
build/tizen/CMakeLists.txt
dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h
dali-toolkit/internal/builder/tree-node-manipulator.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/tooltip/tooltip.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 2bd6dd8..e653068 100644 (file)
--- a/README.md
+++ b/README.md
 
 ### Requirements
 
- - Ubuntu 14.04 or later
+ - Ubuntu 16.04 or later
  - Environment created using dali_env script in dali-core repository
- - GCC version 6
+ - GCC version 9
 
-DALi requires a compiler supporting C++11 features.
-Ubuntu 16.04 is the first version to offer this by default (GCC v5.4.0).
-
-GCC version 6 is recommended since it has fixes for issues in version 5
-e.g. it avoids spurious 'defined but not used' warnings in header files.
+DALi requires a compiler supporting C++17 features.
 
 ### Building the Repository
 
index 9f4656c..9f87146 100644 (file)
@@ -232,7 +232,6 @@ Impl::DummyControl::DummyControl()
   childRemoveCalled(false),
   sizeSetCalled(false),
   sizeAnimationCalled(false),
-  touchEventCalled(false),
   hoverEventCalled(false),
   wheelEventCalled(false),
   keyEventCalled(false),
@@ -249,7 +248,7 @@ Impl::DummyControl::~DummyControl()
 
 void Impl::DummyControl::OnInitialize() { initializeCalled = true; }
 bool Impl::DummyControl::OnAccessibilityActivated() { activatedCalled = true; return true; }
-bool Impl::DummyControl::OnAccessibilityTouch(const TouchEvent& touchEvent) { onAccTouchedCalled = true; return true; }
+bool Impl::DummyControl::OnAccessibilityTouch(const TouchData& touchData) { onAccTouchedCalled = true; return true; }
 bool Impl::DummyControl::OnAccessibilityValueChange( bool isIncrease )
 {
   onAccValueChangeCalled = true; return true;
@@ -270,7 +269,6 @@ void Impl::DummyControl::OnChildAdd(Actor& child) { childAddCalled = true; }
 void Impl::DummyControl::OnChildRemove(Actor& child) { childRemoveCalled = true; }
 void Impl::DummyControl::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; }
 void Impl::DummyControl::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; }
-bool Impl::DummyControl::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
 bool Impl::DummyControl::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
 bool Impl::DummyControl::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
 bool Impl::DummyControl::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
index 87b9748..c4b0257 100644 (file)
@@ -154,7 +154,7 @@ private: // From Internal::Control
 
   virtual void OnInitialize();
   virtual bool OnAccessibilityActivated();
-  virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
+  virtual bool OnAccessibilityTouch( const TouchData& touchData );
   virtual bool OnAccessibilityValueChange( bool isIncrease );
 
   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
@@ -172,7 +172,6 @@ private: // From CustomActorImpl
   virtual void OnChildRemove(Actor& child);
   virtual void OnSizeSet(const Vector3& targetSize);
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
-  virtual bool OnTouchEvent(const TouchEvent& event);
   virtual bool OnHoverEvent(const HoverEvent& event);
   virtual bool OnWheelEvent(const WheelEvent& event);
   virtual bool OnKeyEvent(const KeyEvent& event);
@@ -201,7 +200,6 @@ public:
   bool childRemoveCalled;
   bool sizeSetCalled;
   bool sizeAnimationCalled;
-  bool touchEventCalled;
   bool hoverEventCalled;
   bool wheelEventCalled;
   bool keyEventCalled;
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h
deleted file mode 100644 (file)
index 3a623cb..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef TEST_TOUCH_UTILS_H
-#define TEST_TOUCH_UTILS_H
-
-/*
- * 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.
- * 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.
- *
- */
-
-#include <dali/public-api/actors/actor.h>
-
-namespace Dali
-{
-
-// Data for touch events
-struct TouchEventData
-{
-  TouchEventData()
-  : functorCalled(false),
-    receivedTouch(),
-    touchActor()
-  {
-  }
-
-  void Reset()
-  {
-    functorCalled = false;
-
-    receivedTouch.points.clear();
-    receivedTouch.time = 0;
-
-    touchActor.Reset();
-  }
-
-  bool functorCalled;
-  TouchEvent receivedTouch;
-  Actor touchActor;
-};
-
-// Functor that sets the data when called
-struct TouchEventDataFunctor
-{
-  TouchEventDataFunctor(TouchEventData& data) : touchEventData(data) { }
-
-  bool operator()(Actor actor, const TouchEvent& touch)
-  {
-    touchEventData.functorCalled = true;
-    touchEventData.touchActor = actor;
-    touchEventData.receivedTouch = touch;
-    return false;
-  }
-
-  // Generate a touch-event
-  Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition ) const
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::Point point;
-    point.SetState( state );
-    point.SetScreenPosition( screenPosition );
-    touchEvent.points.push_back( point );
-    return touchEvent;
-  }
-
-  TouchEventData& touchEventData;
-};
-
-
-} // namespace Dali
-
-#endif // TEST_TOUCH_UTILS_H
index df3e5d5..8c37474 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
 #include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
 #include <dali/devel-api/adaptor-framework/accessibility-gesture-event.h>
+#include <dali/integration-api/events/touch-data-integ.h>
 
 namespace Dali
 {
@@ -240,9 +241,8 @@ bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsi
 {
   if( mActionHandler )
   {
-    Dali::TouchEvent touchEvent;
-    touchEvent.points.push_back( point );
-    return mActionHandler->AccessibilityActionScroll( touchEvent );
+    Dali::TouchData touchData = Integration::NewTouchData(timeStamp, point);
+    return mActionHandler->AccessibilityActionScroll( touchData );
   }
   return false;
 }
@@ -251,9 +251,8 @@ bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, unsig
 {
   if( mActionHandler )
   {
-    Dali::TouchEvent touchEvent;
-    touchEvent.points.push_back( point );
-    return mActionHandler->AccessibilityActionTouch( touchEvent );
+    Dali::TouchData touchData = Integration::NewTouchData(timeStamp, point);
+    return mActionHandler->AccessibilityActionTouch( touchData );
   }
   return false;
 }
index 964a2c9..06cc50f 100644 (file)
@@ -2218,10 +2218,11 @@ public:
   {
   }
 
-  bool Callback( AccessibilityManager& accessibilityManager, const Dali::TouchEvent& touchEvent )
+  bool Callback( AccessibilityManager& accessibilityManager, const Dali::TouchData& touchEvent )
   {
     mCalls++;
-    mTouchEvent = touchEvent;
+    Dali::TouchData handle(touchEvent); // Ensure it's ref-counted
+    mTouchData = handle;
     tet_infoline( "Signal called" );
     return true;
   }
@@ -2231,14 +2232,14 @@ public:
     return mCalls;
   }
 
-  const Dali::TouchEvent& GetTouchEvent() const
+  const Dali::TouchData& GetTouchData() const
   {
-    return mTouchEvent;
+    return mTouchData;
   }
 
 private:
   unsigned int mCalls;         ///< Keeps track of how many times the signal has been called.
-  Dali::TouchEvent mTouchEvent; ///< Stores the last touch event received.
+  Dali::TouchData mTouchData ; ///< Stores the last touch event received.
 };
 
 int UtcDaliAccessibilityManagerActionScrollSignalP(void)
@@ -2260,14 +2261,13 @@ int UtcDaliAccessibilityManagerActionScrollSignalP(void)
 
   DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION );
 
-  const TouchEvent& signalTouchEvent = callback.GetTouchEvent();
-  DALI_TEST_EQUALS( signalTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
+  const TouchData& signalTouchData = callback.GetTouchData();
+  DALI_TEST_EQUALS( signalTouchData.GetPointCount(), 1u, TEST_LOCATION );
 
-  const TouchPoint& signalTouchPoint = signalTouchEvent.GetPoint( 0u );
 
-  DALI_TEST_EQUALS( signalTouchPoint.state, TouchPoint::Started, TEST_LOCATION );
-  DALI_TEST_EQUALS( signalTouchPoint.screen.x, 100.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( signalTouchPoint.screen.y, 200.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( signalTouchData.GetState(0), PointState::STARTED, TEST_LOCATION );
+  DALI_TEST_EQUALS( signalTouchData.GetScreenPosition(0).x, 100.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( signalTouchData.GetScreenPosition(0).y, 200.0f, TEST_LOCATION );
 
   END_TEST;
 }
index bdd74f9..b1bbe19 100644 (file)
@@ -465,62 +465,6 @@ int UtcDaliControlImplSizeAnimation(void)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-int UtcDaliControlImplTouchEvent(void)
-{
-  ToolkitTestApplication application;
-
-  {
-    DummyControl dummy = DummyControl::New( true );
-    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
-
-    dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-    dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-    application.GetScene().Add(dummy);
-
-    application.Render();
-    application.SendNotification();
-    application.Render();
-    application.SendNotification();
-
-    DALI_TEST_EQUALS( dummyImpl.touchEventCalled, false, TEST_LOCATION );
-    Integration::TouchEvent touchEvent(1);
-    Integration::Point point;
-    point.SetDeviceId( 1 );
-    point.SetState( PointState::DOWN );
-    point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
-    touchEvent.AddPoint(point);
-    application.ProcessEvent(touchEvent);
-    DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION );
-
-    application.GetScene().Remove(dummy);
-  }
-
-  // Ensure full code coverage
-  {
-    DummyControl dummy = DummyControl::New();
-
-    dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-    dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-    application.GetScene().Add(dummy);
-
-    application.Render();
-    application.SendNotification();
-    application.Render();
-    application.SendNotification();
-
-    Integration::TouchEvent touchEvent(1);
-    Integration::Point point;
-    point.SetDeviceId( 1 );
-    point.SetState( PointState::DOWN );
-    point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
-    touchEvent.AddPoint(point);
-    application.ProcessEvent(touchEvent);
-
-    application.GetScene().Remove(dummy);
-  }
-  END_TEST;
-}
-
 int UtcDaliControlImplHoverEvent(void)
 {
   ToolkitTestApplication application;
@@ -826,7 +770,7 @@ int UtcDaliControlImplOnAccessibilityTouchP(void)
   ToolkitTestApplication application;
   Control dummy = Control::New();
   Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
-  TouchEvent touch;
+  TouchData touch;
   DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
 
   END_TEST;
index 1d82bd6..5390b5c 100644 (file)
@@ -141,10 +141,6 @@ struct TestCustomControl : public Toolkit::Internal::ControlWrapper
     mTargetSize = targetSize;
     Control::OnSizeAnimation( animation, targetSize );
   }
-  virtual bool OnTouchEvent( const TouchEvent& event )
-  {
-    return true;
-  }
   virtual bool OnHoverEvent( const HoverEvent& event )
   {
     return true;
index f86d8aa..f4a05e7 100644 (file)
@@ -101,6 +101,7 @@ const char* const PROPERTY_NAME_PLACEHOLDER                          = "placehol
 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_MAX_LENGTH                           = "maxLength";
 
 
 const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
@@ -127,6 +128,7 @@ const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
 
 static bool gTextChangedCallBackCalled;
 static bool gInputStyleChangedCallbackCalled;
+static bool gMaxCharactersCallBackCalled;
 static Dali::Toolkit::TextEditor::InputStyle::Mask gInputStyleMask;
 
 struct CallbackFunctor
@@ -158,6 +160,13 @@ static void TestInputStyleChangedCallback( TextEditor control, TextEditor::Input
   gInputStyleMask = mask;
 }
 
+static void TestMaxLengthReachedCallback( TextEditor control )
+{
+  tet_infoline(" TestMaxLengthReachedCallback");
+
+  gMaxCharactersCallBackCalled = true;
+}
+
 // Generate a KeyEvent to send to Core.
 Integration::KeyEvent GenerateKey( const std::string& keyName,
                                    const std::string& logicalKey,
@@ -481,6 +490,7 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextEditor::Property::ENABLE_SHIFT_SELECTION );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MAX_LENGTH ) == DevelTextEditor::Property::MAX_LENGTH );
 
   END_TEST;
 }
@@ -2789,3 +2799,36 @@ int UtcDaliTextEditorGetInputMethodContext(void)
 
   END_TEST;
 }
+
+int utcDaliTextEditorMaxCharactersReached(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("utcDaliTextEditorMaxCharactersReached");
+
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+
+  application.GetScene().Add( editor );
+
+  const int maxNumberOfCharacters = 1;
+  editor.SetProperty( DevelTextEditor::Property::MAX_LENGTH, maxNumberOfCharacters );
+  DALI_TEST_EQUALS( editor.GetProperty<int>( DevelTextEditor::Property::MAX_LENGTH ), maxNumberOfCharacters, TEST_LOCATION );
+
+  editor.SetKeyInputFocus();
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextEditor::MaxLengthReachedSignal( editor ).Connect(&TestMaxLengthReachedCallback);
+  bool maxLengthReachedSignal = false;
+  editor.ConnectSignal( testTracker, "maxLengthReached", CallbackFunctor(&maxLengthReachedSignal) );
+
+  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 ) );
+
+  DALI_TEST_CHECK( gMaxCharactersCallBackCalled );
+  DALI_TEST_CHECK( maxLengthReachedSignal );
+
+  END_TEST;
+}
index e465353..3bedbd1 100644 (file)
@@ -3,6 +3,7 @@ CMAKE_POLICY(SET CMP0012 NEW) # Prevent dereferencing of OFF/ON as variables
 
 SET(name "dali2-toolkit")
 
+SET(CMAKE_C_STANDARD 99)
 PROJECT(${name})
 SET(PKG_NAME ${name})
 
@@ -200,10 +201,11 @@ ENDIF()
 IF( WIN32 )
   ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions.
   ADD_COMPILE_OPTIONS( /vmg )                           # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
+  ADD_COMPILE_OPTIONS( /std:c++17 )                     # c++17 support
   ADD_COMPILE_OPTIONS( /wd4251 )                        # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'"
 ELSE()
   # Set up compiler flags and warnings
-  ADD_COMPILE_OPTIONS( -std=c++11 )
+  ADD_COMPILE_OPTIONS( -std=c++17 )
   ADD_COMPILE_OPTIONS( -Wno-ignored-qualifiers )
 
   # TODO: Clang is a lot more strict with warnings, we should address
index 87c5c5f..878e4a6 100755 (executable)
@@ -71,7 +71,7 @@ public:
    * @SINCE_1_0.0
    */
   typedef Signal< bool ( AccessibilityManager& ) > AccessibilityActionSignalType; ///< Generic signal type @SINCE_1_0.0
-  typedef Signal< bool ( AccessibilityManager&, const Dali::TouchEvent& )> AccessibilityActionScrollSignalType; ///< Scroll signal type @SINCE_1_0.0
+  typedef Signal< bool ( AccessibilityManager&, const Dali::TouchData& )> AccessibilityActionScrollSignalType; ///< Scroll signal type @SINCE_1_0.0
 
   /**
    * @brief Enumeration for accessibility that needs four information which will be read by screen-reader.
@@ -794,7 +794,7 @@ public:
    *
    * A callback of the following type may be connected:
    * @code
-   *   bool YourCallback( AccessibilityManager& manager, const TouchEvent& event );
+   *   bool YourCallback( AccessibilityManager& manager, const TouchData& event );
    * @endcode
    * @SINCE_1_0.0
    * @return The signal to connect to
index 97ee0fa..b0b248b 100755 (executable)
@@ -33,8 +33,13 @@ InputMethodContext GetInputMethodContext( TextEditor textEditor )
   return GetImpl( textEditor ).GetInputMethodContext();
 }
 
+MaxLengthReachedSignalType& MaxLengthReachedSignal( TextEditor textEditor )
+{
+  return GetImpl( textEditor ).MaxLengthReachedSignal();
+}
+
 } // namespace DevelTextEditor
 
 } // namespace Toolkit
 
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali
index 23f21e8..fe8bc2e 100755 (executable)
@@ -123,6 +123,12 @@ namespace Property
        * @details Name "renderingBackend", type Property::INTEGER.
        */
       RENDERING_BACKEND,
+
+      /**
+       * @brief The maximum number of characters that can be inserted.
+       * @details Name "maxLength", type Property::INTEGER.
+       */
+      MAX_LENGTH,
   };
 
 } // namespace Property
@@ -135,6 +141,23 @@ namespace Property
  */
 DALI_TOOLKIT_API InputMethodContext GetInputMethodContext( TextEditor textEditor );
 
+/**
+ * @brief Max Characters Exceed signal type.
+  */
+using MaxLengthReachedSignalType = Signal< void ( TextEditor ) >;
+
+/**
+ * @brief This signal is emitted when inserted text exceeds the maximum character limit.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( TextEditor textEditor );
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API MaxLengthReachedSignalType& MaxLengthReachedSignal( TextEditor textEditor );
+
 } // namespace DevelTextEditor
 
 } // namespace Toolkit
index 6b4433d..e67cb27 100644 (file)
@@ -963,12 +963,12 @@ bool AccessibilityManager::ClearAccessibilityFocus()
   }
 }
 
-bool AccessibilityManager::AccessibilityActionScroll( Dali::TouchEvent& touchEvent )
+bool AccessibilityManager::AccessibilityActionScroll( Dali::TouchData& touchData )
 {
   Dali::Toolkit::AccessibilityManager handle( this );
   if( !mActionScrollSignal.Empty() )
   {
-    mActionScrollSignal.Emit( handle, touchEvent );
+    mActionScrollSignal.Emit( handle, touchData );
   }
 
   return true;
@@ -1302,7 +1302,7 @@ bool AccessibilityManager::AccessibilityActionStartStop()
   return mIsAccessibilityTtsEnabled;
 }
 
-bool AccessibilityManager::AccessibilityActionTouch(const TouchEvent& touchEvent)
+bool AccessibilityManager::AccessibilityActionTouch(const TouchData& touchData)
 {
   bool handled = false;
 
@@ -1311,7 +1311,7 @@ bool AccessibilityManager::AccessibilityActionTouch(const TouchEvent& touchEvent
   Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(GetCurrentFocusActor());
   if(control)
   {
-    handled = GetImplementation( control ).OnAccessibilityTouch(touchEvent);
+    handled = GetImplementation( control ).OnAccessibilityTouch(touchData);
   }
 
   return handled;
index ac7a379..76b34b3 100644 (file)
@@ -506,10 +506,10 @@ private:
 
   /**
    * Perform the accessibility action associated with a scroll event.
-   * @param touchEvent The touch point (and time) of the event.
+   * @param touchData The touch point (and time) of the event.
    * @return whether the focus is cleared or not.
    */
-  virtual bool AccessibilityActionScroll( Dali::TouchEvent& touchEvent );
+  virtual bool AccessibilityActionScroll( Dali::TouchData& touchData );
 
   /**
    * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
@@ -659,10 +659,10 @@ private:
 
   /**
    * Perform the accessibility action to mouse move (by one finger tap & hold and move).
-   * @param touchEvent touch event structure
+   * @param touchData touch point and time of the event
    * @return whether the accessibility action is performed or not.
    */
-  virtual bool AccessibilityActionTouch(const TouchEvent& touchEvent);
+  virtual bool AccessibilityActionTouch(const TouchData& touchData);
 
   /**
    * This function is connected to the TtsPlayer StateChangeSignal.
index 267c69e..eaea13e 100644 (file)
@@ -198,14 +198,14 @@ private:
 /*
  * Collect nodes
  */
-struct CollectNodes : public std::unary_function<TreeNode*, void>
+struct CollectNodes
 {
   CollectNodes() {};
 
   /*
    * Call operator to add nodes to the list
    */
-  result_type operator()(argument_type& n)
+  void operator()(TreeNode*& n)
   {
     DALI_ASSERT_DEBUG(n && "Operation on NULL JSON node");
     nodes.push_back(n);
index 0442a47..efcfe2c 100644 (file)
@@ -35,7 +35,6 @@
 #include <dali-toolkit/devel-api/text/rendering-backend.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
-#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/internal/text/text-enumerations-impl.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
@@ -138,9 +137,11 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableShiftSelection",
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableGrabHandle",               BOOLEAN,   ENABLE_GRAB_HANDLE                   )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "matchSystemLanguageDirection",   BOOLEAN,   MATCH_SYSTEM_LANGUAGE_DIRECTION      )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "renderingBackend",               INTEGER,   RENDERING_BACKEND                    )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "maxLength",                      INTEGER,   MAX_LENGTH                           )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
+DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -771,6 +772,17 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
+      {
+        if( impl.mController )
+        {
+          const int max = value.Get< int >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p MAX_LENGTH %d\n", impl.mController.Get(), max );
+
+          impl.mController->SetMaximumNumberOfCharacters( max );
+        }
+        break;
+      }
     } // switch
   } // texteditor
 }
@@ -1171,6 +1183,14 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
+      {
+        if( impl.mController )
+        {
+          value = impl.mController->GetMaximumNumberOfCharacters();
+        }
+        break;
+      }
     } //switch
   }
 
@@ -1182,6 +1202,11 @@ InputMethodContext TextEditor::GetInputMethodContext()
   return mInputMethodContext;
 }
 
+DevelTextEditor::MaxLengthReachedSignalType& TextEditor::MaxLengthReachedSignal()
+{
+  return mMaxLengthReachedSignal;
+}
+
 bool TextEditor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   Dali::BaseHandle handle( object );
@@ -1197,6 +1222,14 @@ bool TextEditor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface
   {
     editor.InputStyleChangedSignal().Connect( tracker, functor );
   }
+  else if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_LENGTH_REACHED ) )
+  {
+    if( editor )
+    {
+      Internal::TextEditor& editorImpl( GetImpl( editor ) );
+      editorImpl.MaxLengthReachedSignal().Connect( tracker, functor );
+    }
+  }
   else
   {
     // signalName does not match any signal
@@ -1588,7 +1621,8 @@ void TextEditor::TextChanged()
 
 void TextEditor::MaxLengthReached()
 {
-  // Nothing to do as TextEditor doesn't emit a max length reached signal.
+  Dali::Toolkit::TextEditor handle( GetOwner() );
+  mMaxLengthReachedSignal.Emit( handle );
 }
 
 void TextEditor::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
index 1c3c9b8..c8bae9c 100755 (executable)
@@ -27,6 +27,7 @@
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/text-control-interface.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
@@ -80,6 +81,11 @@ public:
   InputMethodContext GetInputMethodContext();
 
   /**
+   * @copydoc Dali::Toollkit::TextEditor::MaxLengthReachedSignal()
+   */
+  DevelTextEditor::MaxLengthReachedSignalType&  MaxLengthReachedSignal();
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -287,6 +293,7 @@ private: // Data
   Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal;
   Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal;
   Toolkit::TextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal;
+  Toolkit::DevelTextEditor::MaxLengthReachedSignalType mMaxLengthReachedSignal;
 
   InputMethodContext mInputMethodContext;
   Text::ControllerPtr mController;
index 012db24..80a558e 100644 (file)
@@ -385,30 +385,30 @@ void Tooltip::SetTail( const Property::Value& value )
 
 bool Tooltip::OnHovered( Actor /* actor */, const HoverEvent& hover )
 {
-  const TouchPoint::State state = hover.points[0].state;
+  const PointState::Type state = hover.GetState( 0 );
   switch( state )
   {
-    case TouchPoint::Started:
-    case TouchPoint::Motion:
+    case PointState::STARTED:
+    case PointState::MOTION:
     {
       if( ! mPopup )
       {
         if( ! mTooltipTimer )
         {
-          mHoverPoint = hover.points[ 0 ].screen;
+          mHoverPoint = hover.GetScreenPosition( 0 );
           mTooltipTimer = Timer::New( mWaitTime );
           mTooltipTimer.TickSignal().Connect( this, &Tooltip::OnTimeout );
           mTooltipTimer.Start();
         }
         else
         {
-          Vector2 movement = mHoverPoint - hover.points[ 0 ].screen;
+          Vector2 movement = mHoverPoint - hover.GetScreenPosition( 0 );
           if( std::abs( movement.Length() ) > mMovementThreshold )
           {
             mTooltipTimer.Stop();
             mTooltipTimer.Reset();
 
-            mHoverPoint = hover.points[ 0 ].screen;
+            mHoverPoint = hover.GetScreenPosition( 0 );
             mTooltipTimer = Timer::New( mWaitTime );
             mTooltipTimer.TickSignal().Connect( this, &Tooltip::OnTimeout );
             mTooltipTimer.Start();
@@ -419,7 +419,7 @@ bool Tooltip::OnHovered( Actor /* actor */, const HoverEvent& hover )
       {
         // Popup is showing, and we're set to disappear on excessive movement so make sure we're still within the threshold.
 
-        Vector2 movement = mHoverPoint - hover.points[ 0 ].screen;
+        Vector2 movement = mHoverPoint - hover.GetScreenPosition( 0 );
         if( std::abs( movement.Length() ) > mMovementThreshold )
         {
           // Exceeding the threshold, hide the popup.
@@ -438,9 +438,9 @@ bool Tooltip::OnHovered( Actor /* actor */, const HoverEvent& hover )
       }
       break;
     }
-    case TouchPoint::Finished:
-    case TouchPoint::Leave:
-    case TouchPoint::Interrupted:
+    case PointState::FINISHED:
+    case PointState::LEAVE:
+    case PointState::INTERRUPTED:
     {
       if( mTooltipTimer )
       {
@@ -455,8 +455,7 @@ bool Tooltip::OnHovered( Actor /* actor */, const HoverEvent& hover )
       break;
     }
 
-    case TouchPoint::Stationary:
-    case TouchPoint::Last:
+    case PointState::STATIONARY:
     {
       break;
     }
index eec35fb..372cfdb 100644 (file)
@@ -386,7 +386,7 @@ bool Control::OnAccessibilityPan(PanGesture gesture)
   return false; // Accessibility pan gesture is not handled by default
 }
 
-bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
+bool Control::OnAccessibilityTouch(const TouchData& touchData)
 {
   return false; // Accessibility touch event is not handled by default
 }
@@ -627,11 +627,6 @@ void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   // @todo size negotiate background to new size, animate as well?
 }
 
-bool Control::OnTouchEvent(const TouchEvent& event)
-{
-  return false; // Do not consume
-}
-
 bool Control::OnHoverEvent(const HoverEvent& event)
 {
   return false; // Do not consume
index f127317..114f223 100644 (file)
@@ -339,11 +339,6 @@ protected: // From CustomActorImpl
   virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize ) override;
 
   /**
-   * @copydoc CustomActorImpl::OnTouchEvent()
-   */
-  virtual bool OnTouchEvent( const TouchEvent& event ) override;
-
-  /**
    * @copydoc CustomActorImpl::OnHoverEvent()
    */
   virtual bool OnHoverEvent( const HoverEvent& event ) override;
@@ -487,10 +482,10 @@ public: // API for derived classes to override
    * touch event.
    *
    * @SINCE_1_0.0
-   * @param[in] touchEvent The touch event
+   * @param[in] touchData The touch event
    * @return true if the touch event has been consumed by this control
    */
-  virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
+  virtual bool OnAccessibilityTouch( const TouchData& touchData );
 
   /**
    * @brief This method should be overridden by deriving classes when they wish to respond
index dbb0f02..ca07989 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 9;
-const unsigned int TOOLKIT_MICRO_VERSION = 24;
+const unsigned int TOOLKIT_MICRO_VERSION = 25;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 28c3d6f..047f9d0 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.9.24
+Version:    1.9.25
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT