/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
childRemoveCalled(false),
sizeSetCalled(false),
sizeAnimationCalled(false),
- touchEventCalled(false),
hoverEventCalled(false),
wheelEventCalled(false),
keyEventCalled(false),
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 TouchEvent& touch) { onAccTouchedCalled = true; return true; }
bool Impl::DummyControl::OnAccessibilityValueChange( bool isIncrease )
{
onAccValueChangeCalled = true; return 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;}
#define DALI_TOOLKIT_TEST_DUMMY_CONTROL_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
virtual void OnInitialize();
virtual bool OnAccessibilityActivated();
- virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
+ virtual bool OnAccessibilityTouch( const TouchEvent& touch );
virtual bool OnAccessibilityValueChange( bool isIncrease );
virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
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);
bool childRemoveCalled;
bool sizeSetCalled;
bool sizeAnimationCalled;
- bool touchEventCalled;
bool hoverEventCalled;
bool wheelEventCalled;
bool keyEventCalled;
+++ /dev/null
-#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
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#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-integ.h>
namespace Dali
{
{
if( mActionHandler )
{
- Dali::TouchEvent touchEvent;
- touchEvent.points.push_back( point );
- return mActionHandler->AccessibilityActionScroll( touchEvent );
+ Dali::TouchEvent touch = Integration::NewTouchEvent(timeStamp, point);
+ return mActionHandler->AccessibilityActionScroll( touch );
}
return false;
}
{
if( mActionHandler )
{
- Dali::TouchEvent touchEvent;
- touchEvent.points.push_back( point );
- return mActionHandler->AccessibilityActionTouch( touchEvent );
+ Dali::TouchEvent touch = Integration::NewTouchEvent(timeStamp, point);
+ return mActionHandler->AccessibilityActionTouch( touch );
}
return false;
}
{
}
-bool WebEngine::SendTouchEvent( const TouchData& touch )
+bool WebEngine::SendTouchEvent( const TouchEvent& touch )
{
return true;
}
class Layer;
class RenderSurfaceInterface;
struct KeyEvent;
-class TouchData;
+class TouchEvent;
struct WheelEvent;
typedef Dali::Rect<int> PositionSize;
{
public:
using KeyEventSignalType = Signal< void (const KeyEvent&) >;
- using TouchSignalType = Signal< void (const TouchData&) >;
+ using TouchSignalType = Signal< void (const TouchEvent&) >;
static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
bool Callback( AccessibilityManager& accessibilityManager, const Dali::TouchEvent& touchEvent )
{
mCalls++;
- mTouchEvent = touchEvent;
+ Dali::TouchEvent handle(touchEvent); // Ensure it's ref-counted
+ mTouchEvent = handle;
tet_infoline( "Signal called" );
return true;
}
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::TouchEvent mTouchEvent ; ///< Stores the last touch event received.
};
int UtcDaliAccessibilityManagerActionScrollSignalP(void)
const TouchEvent& signalTouchEvent = callback.GetTouchEvent();
DALI_TEST_EQUALS( signalTouchEvent.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( signalTouchEvent.GetState(0), PointState::STARTED, TEST_LOCATION );
+ DALI_TEST_EQUALS( signalTouchEvent.GetScreenPosition(0).x, 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( signalTouchEvent.GetScreenPosition(0).y, 200.0f, TEST_LOCATION );
END_TEST;
}
}
///////////////////////////////////////////////////////////////////////////////
-static bool TouchCallback(Actor actor, const TouchData& event)
+static bool TouchCallback(Actor actor, const TouchEvent& event)
{
return false;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
-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;
mTargetSize = targetSize;
Control::OnSizeAnimation( animation, targetSize );
}
- virtual bool OnTouchEvent( const TouchEvent& event )
- {
- return true;
- }
virtual bool OnHoverEvent( const HoverEvent& event )
{
return true;
const int KEY_CONTROL_MODIFIER = 258;
const char* HANDLE_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insertpoint-icon.png";
+const char* HANDLE_LEFT_SELECTION_FILE_NAME = TEST_RESOURCE_DIR "/selection_handle_drop_left.png";
+const char* HANDLE_RIGHT_SELECTION_FILE_NAME = TEST_RESOURCE_DIR "/selection_handle_drop_right.png";
const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
editor.SetProperty( TextEditor::Property::GRAB_HANDLE_IMAGE, HANDLE_IMAGE_FILE_NAME );
editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL, true );
- Property::Map imagePropertyMap;
- imagePropertyMap["type"] = "BufferImage";
- imagePropertyMap["width"] = 40;
- imagePropertyMap["height"] = 40;
-
- editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT, imagePropertyMap );
- editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT, imagePropertyMap );
- editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, imagePropertyMap );
- editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, imagePropertyMap );
+ editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT, Property::Map{ {"filename", HANDLE_LEFT_SELECTION_FILE_NAME } } );
+ editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT, Property::Map{ {"filename", HANDLE_LEFT_SELECTION_FILE_NAME } } );
+ editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, Property::Map{ {"filename", HANDLE_RIGHT_SELECTION_FILE_NAME } } );
+ editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, Property::Map{ {"filename", HANDLE_RIGHT_SELECTION_FILE_NAME } } );
editor.SetProperty( Actor::Property::SIZE, Vector2( 30.f, 500.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
gEvaluateJavaScriptCallbackCalled++;
}
-static bool OnTouched( Actor actor, const Dali::TouchData& touch )
+static bool OnTouched( Actor actor, const Dali::TouchEvent& touch )
{
gTouched = true;
return true;
}
}
-bool AccessibilityManager::AccessibilityActionScroll( Dali::TouchEvent& touchEvent )
+bool AccessibilityManager::AccessibilityActionScroll( Dali::TouchEvent& touch )
{
Dali::Toolkit::AccessibilityManager handle( this );
if( !mActionScrollSignal.Empty() )
{
- mActionScrollSignal.Emit( handle, touchEvent );
+ mActionScrollSignal.Emit( handle, touch );
}
return true;
return mIsAccessibilityTtsEnabled;
}
-bool AccessibilityManager::AccessibilityActionTouch(const TouchEvent& touchEvent)
+bool AccessibilityManager::AccessibilityActionTouch(const TouchEvent& touch)
{
bool handled = false;
Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(GetCurrentFocusActor());
if(control)
{
- handled = GetImplementation( control ).OnAccessibilityTouch(touchEvent);
+ handled = GetImplementation( control ).OnAccessibilityTouch(touch);
}
return handled;
/**
* Perform the accessibility action associated with a scroll event.
- * @param touchEvent The touch point (and time) of the event.
+ * @param touch 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::TouchEvent& touch );
/**
* Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
/**
* Perform the accessibility action to mouse move (by one finger tap & hold and move).
- * @param touchEvent touch event structure
+ * @param touch 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 TouchEvent& touch);
/**
* This function is connected to the TtsPlayer StateChangeSignal.
#include <cstring> // for strcmp
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/integration-api/debug.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
return OnKeyboardEnter();
}
-bool Button::OnTouch( Actor actor, const TouchData& touch )
+bool Button::OnTouch( Actor actor, const TouchEvent& touch )
{
if( !IsDisabled() && (actor == touch.GetHitActor(0)) )
{
#define DALI_TOOLKIT_INTERNAL_BUTTON_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] touch The touch info.
* @return true, if consumed, false otherwise.
*/
- bool OnTouch( Actor actor, const TouchData& touch );
+ bool OnTouch( Actor actor, const TouchEvent& touch );
/**
* Handler for tap events.
#include <dali/public-api/animation/constraints.h>
#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/key-event.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/devel-api/actors/actor-devel.h>
return connected;
}
-bool Popup::OnBackingTouched( Actor actor, const TouchData& touch )
+bool Popup::OnBackingTouched( Actor actor, const TouchEvent& touch )
{
// Allow events to pass through if the backing isn't the hit-actor
if( (touch.GetHitActor(0) == actor) &&
return true;
}
-bool Popup::OnDialogTouched( Actor actor, const TouchData& touch )
+bool Popup::OnDialogTouched( Actor actor, const TouchEvent& touch )
{
// Only connecting this so the backing does not become the default hit-actor and inadvertently closes the popup
return false;
* @param[in] touch The Touch Data.
* @return Whether to consume event or not.
*/
- bool OnBackingTouched(Actor actor, const TouchData& touch);
+ bool OnBackingTouched(Actor actor, const TouchEvent& touch);
/**
* Signal occurs when a mouse wheel event occurs on the dimmed backing.
* @param[in] touch The Touch Data.
* @return Whether to consume event or not.
*/
- bool OnDialogTouched( Actor actor, const TouchData& touch );
+ bool OnDialogTouched( Actor actor, const TouchEvent& touch );
/**
* @copydoc Toolkit::Control::OnInitialize()
#include <dali/public-api/animation/constraints.h>
#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/object/property-helper-devel.h>
return clamppedPosition;
}
-bool ItemView::OnTouch( Actor actor, const TouchData& touch )
+bool ItemView::OnTouch( Actor actor, const TouchEvent& touch )
{
// Ignore events with multiple-touch points
if (touch.GetPointCount() != 1)
#define DALI_TOOLKIT_INTERNAL_ITEM_VIEW_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] touch The touch information.
* @return True if the event should be consumed.
*/
- bool OnTouch( Actor actor, const TouchData& touch );
+ bool OnTouch( Actor actor, const TouchEvent& touch );
/**
* Called upon pan gesture event.
#include <dali/public-api/animation/constraints.h>
#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/object/property-map.h>
return false;
}
-bool ScrollView::OnTouch( Actor actor, const TouchData& touch )
+bool ScrollView::OnTouch( Actor actor, const TouchEvent& touch )
{
if(!mSensitive)
{
#define DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] touch The touch information.
* @return True if the event should be consumed.
*/
- bool OnTouch( Actor actor, const TouchData& touch );
+ bool OnTouch( Actor actor, const TouchEvent& touch );
/**
* Start a timer which calls OnTouchDownTimeout()
#include <cstring> // for strcmp
#include <sstream>
#include <limits>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
Control::OnRelayout( size, container );
}
-bool Slider::OnTouch(Actor actor, const TouchData& touch)
+bool Slider::OnTouch(Actor actor, const TouchEvent& touch)
{
if( mState != DISABLED )
{
#define DALI_TOOLKIT_INTERNAL_SLIDER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] touch The touch info
* @return If touch is handled or not
*/
- bool OnTouch( Actor actor, const TouchData& touch );
+ bool OnTouch( Actor actor, const TouchEvent& touch );
/**
* Pan gesture event
Control::OnSceneConnection( depth );
}
-bool TextEditor::OnTouched( Actor actor, const TouchData& touch )
+bool TextEditor::OnTouched( Actor actor, const TouchEvent& touch )
{
return false;
}
#define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] actor TextEditor touched
* @param[in] touch Touch information
*/
- bool OnTouched( Actor actor, const TouchData& touch );
+ bool OnTouched( Actor actor, const TouchEvent& touch );
/**
* @brief Callbacks called on idle.
Control::OnSceneConnection( depth );
}
-bool TextField::OnTouched( Actor actor, const TouchData& touch )
+bool TextField::OnTouched( Actor actor, const TouchEvent& touch )
{
return false;
}
#define DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] actor TextField touched
* @param[in] touch Touch information
*/
- bool OnTouched( Actor actor, const TouchData& touch );
+ bool OnTouched( Actor actor, const TouchEvent& touch );
/**
* @brief Callbacks called on idle.
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();
{
// 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.
}
break;
}
- case TouchPoint::Finished:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::FINISHED:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
if( mTooltipTimer )
{
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
+ case PointState::STATIONARY:
{
break;
}
return value;
}
-bool WebView::OnTouchEvent( Actor actor, const Dali::TouchData& touch )
+bool WebView::OnTouchEvent( Actor actor, const Dali::TouchEvent& touch )
{
bool result = false;
#define DALI_TOOLKIT_INTERNAL_WEB_VIEW_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
class KeyEvent;
-class TouchData;
+class TouchEvent;
class WebView;
namespace Internal
* @param[in] touch The Touch Data.
* @return Whether to consume event or not.
*/
- bool OnTouchEvent( Actor actor, const Dali::TouchData& touch );
+ bool OnTouchEvent( Actor actor, const Dali::TouchEvent& touch );
/**
* @copydoc Toolkit::Control::OnKeyEvent()
#include <dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.h>
#include <dali/public-api/events/point-state.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
namespace Dali
{
}
}
-bool DragAndDropDetector::OnDrag(Dali::Actor actor, const Dali::TouchData& data)
+bool DragAndDropDetector::OnDrag(Dali::Actor actor, const Dali::TouchEvent& data)
{
Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
PointState::Type type = data.GetState(0);
#define DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
}
public:
- bool OnDrag(Dali::Actor actor, const Dali::TouchData& data);
+ bool OnDrag(Dali::Actor actor, const Dali::TouchEvent& data);
void OnPan(Dali::Actor actor, const PanGesture& gesture);
private:
#include <dali/devel-api/adaptor-framework/lifecycle-controller.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/events/key-event.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/object/property-map.h>
}
}
-void KeyboardFocusManager::OnTouch(const TouchData& touch)
+void KeyboardFocusManager::OnTouch(const TouchEvent& touch)
{
// if mIsFocusIndicatorShown is UNKNOWN, it means Configuration is not loaded.
// Try to load configuration.
#define DALI_TOOLKIT_INTERNAL_KEYBOARD_FOCUS_MANAGER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* (i.e. the down & up touch events only).
* @param[in] touch The touch information
*/
- void OnTouch( const TouchData& touch );
+ void OnTouch( const TouchEvent& touch );
/**
* Called when the window focus is changed.
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/devel-api/common/stage.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/pan-gesture.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/public-api/rendering/geometry.h>
}
}
- bool OnGrabHandleTouched( Actor actor, const TouchData& touch )
+ bool OnGrabHandleTouched( Actor actor, const TouchEvent& touch )
{
HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
return false;
}
- bool OnHandleOneTouched( Actor actor, const TouchData& touch )
+ bool OnHandleOneTouched( Actor actor, const TouchEvent& touch )
{
HandleImpl& primarySelectionHandle = mHandle[LEFT_SELECTION_HANDLE];
return false;
}
- bool OnHandleTwoTouched( Actor actor, const TouchData& touch )
+ bool OnHandleTwoTouched( Actor actor, const TouchEvent& touch )
{
HandleImpl& secondarySelectionHandle = mHandle[RIGHT_SELECTION_HANDLE];
return false; // Accessibility pan gesture is not handled by default
}
-bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
+bool Control::OnAccessibilityTouch(const TouchEvent& touch)
{
return false; // Accessibility touch event is not handled by default
}
// @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
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;
* touch event.
*
* @SINCE_1_0.0
- * @param[in] touchEvent The touch event
+ * @param[in] touch 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 TouchEvent& touch );
/**
* @brief This method should be overridden by deriving classes when they wish to respond
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
* param[in] touch The touch-event
* return Set to true if the signal was consumed correctly
*/
- bool OnTouched( Actor actor, const TouchData& touch )
+ bool OnTouched( Actor actor, const TouchEvent& touch )
{
int touchedCount = 0;
This signal will be emitted by DALi whenever the touch occurs within the connected actor's bounds.
Each point on the screen that is currently being touched or where touch has stopped is represented by a point.
-Dali::TouchData stores information about the state of each point (down, up, motion etc.) and the co-ordinates of the touch.
+Dali::TouchEvent stores information about the state of each point (down, up, motion etc.) and the co-ordinates of the touch.
When a multi-touch event occurs, each point represents the points that are currently being touched or the points where touch has stopped.
The following example shows how a connection to a touch event signal can be established:
@code
-bool OnTouch( Dali::Actor actor, const Dali::TouchData& touch )
+bool OnTouch( Dali::Actor actor, const Dali::TouchEvent& touch )
{
bool handled = false;
stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
}
- bool OnTouch( Actor actor, const TouchData& touch )
+ bool OnTouch( Actor actor, const TouchEvent& touch )
{
// quit the application
mApplication.Quit();
IF ( TOUCH-SIGNAL-NOT-EMPTY )
{
// Only do the emission if touch signal of actor has connections.
- CONSUMED = TOUCH-SIGNAL( TOUCH-DATA )
+ CONSUMED = TOUCH-SIGNAL( TOUCH-EVENT )
}
IF ( NOT-CONSUMED )
actor.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
Dali::Stage::GetCurrent().Add( actor );
...
-bool OnPressed( Dali::Actor, const TouchData& touch )
+bool OnPressed( Dali::Actor, const TouchEvent& touch )
{
Dali::Animation anim = Dali::Animation::New( 1.5f );
anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 200, -100, 0 ), AlphaFunctions::Bounce );
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