mScrollView.SetAxisAutoLock( true );
mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete );
mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart );
- mScrollView.TouchedSignal().Connect( this, &DaliTableView::OnScrollTouched );
+ mScrollView.TouchSignal().Connect( this, &DaliTableView::OnScrollTouched );
mScrollViewLayer = Layer::New();
content.SetKeyboardFocusable(true);
// connect to the touch events
- content.TouchedSignal().Connect( this, &DaliTableView::OnTilePressed );
+ content.TouchSignal().Connect( this, &DaliTableView::OnTilePressed );
content.HoveredSignal().Connect( this, &DaliTableView::OnTileHovered );
return content;
return stencil;
}
-bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
+bool DaliTableView::OnTilePressed( Actor actor, const TouchData& event )
+{
+ return DoTilePress( actor, event.GetState( 0 ) );
+}
+
+bool DaliTableView::DoTilePress( Actor actor, PointState::Type pointState )
{
bool consumed = false;
- const TouchPoint& point = event.GetPoint( 0 );
- if( TouchPoint::Down == point.state )
+ if( PointState::DOWN == pointState )
{
mPressedActor = actor;
consumed = true;
// A button press is only valid if the Down & Up events
// both occurred within the button.
- if( ( TouchPoint::Up == point.state ) &&
+ if( ( PointState::UP == pointState ) &&
( mPressedActor == actor ) )
{
// ignore Example button presses when scrolling or button animating.
accessibilityManager.SetCurrentFocusActor(mPages[mScrollView.GetCurrentPage()].GetChildAt(0) );
}
-bool DaliTableView::OnScrollTouched( Actor actor, const TouchEvent& event )
+bool DaliTableView::OnScrollTouched( Actor actor, const TouchData& event )
{
- const TouchPoint& point = event.GetPoint( 0 );
- if( TouchPoint::Down == point.state )
+ if( PointState::DOWN == event.GetState( 0 ) )
{
mPressedActor = actor;
}
mPressedActor = activatedActor;
// Activate the current focused actor;
- TouchEvent touchEventUp;
- touchEventUp.points.push_back( TouchPoint ( 0, TouchPoint::Up, 0.0f, 0.0f ) );
- OnTilePressed(mPressedActor, touchEventUp);
+ DoTilePress( mPressedActor, PointState::UP );
}
}
*
* @return Consume flag
*/
- bool OnTilePressed( Dali::Actor actor, const Dali::TouchEvent& event );
+ bool OnTilePressed( Dali::Actor actor, const Dali::TouchData& event );
+
+ /**
+ * Called by OnTilePressed & Accessibility to do the appropriate action.
+ *
+ * @param[in] actor The Actor representing this tile.
+ * @param[in] state The Touch state
+ *
+ * @return Consume flag
+ */
+ bool DoTilePress( Dali::Actor actor, Dali::PointState::Type state );
/**
* Signal emitted when any tile has been hovered
*
* @return Consume flag
*/
- bool OnScrollTouched( Dali::Actor actor, const Dali::TouchEvent& event );
+ bool OnScrollTouched( Dali::Actor actor, const Dali::TouchData& event );
/**
* Setup the effect on the scroll view
mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &Benchmark::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &Benchmark::OnTouch );
if( gUseMesh )
{
ShowAnimation();
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
mPaddle.SetPosition( stageSize * Vector3( PADDLE_START_POSITION ) );
mContentLayer.Add(mPaddle);
- mPaddle.TouchedSignal().Connect(this, &ExampleController::OnTouchPaddle);
- mContentLayer.TouchedSignal().Connect(this, &ExampleController::OnTouchLayer);
+ mPaddle.TouchSignal().Connect(this, &ExampleController::OnTouchPaddle);
+ mContentLayer.TouchSignal().Connect(this, &ExampleController::OnTouchLayer);
const float margin(BALL_SIZE.width * stageSize.width * 0.5f);
* @param[in] actor The actor touched
* @param[in] event The touch event
*/
- bool OnTouchPaddle(Actor actor, const TouchEvent& event)
+ bool OnTouchPaddle(Actor actor, const TouchData& event)
{
if(event.GetPointCount()>0)
{
- const TouchPoint& point = event.GetPoint(0);
- if(point.state==TouchPoint::Down) // Commence dragging
+ if( event.GetState( 0 ) == PointState::DOWN ) // Commence dragging
{
// Get point where user touched paddle (relative to paddle's center)
- mRelativeDragPoint = Vector3(point.screen.x, point.screen.y, 0.0f);
+ Vector2 screenPoint = event.GetScreenPosition( 0 );
+ mRelativeDragPoint = screenPoint;
mRelativeDragPoint -= actor.GetCurrentPosition();
mDragActor = actor;
* @param[in] actor The actor touched
* @param[in] event The touch event
*/
- bool OnTouchLayer(Actor actor, const TouchEvent& event)
+ bool OnTouchLayer(Actor actor, const TouchData& event)
{
if(event.GetPointCount()>0)
{
- const TouchPoint& point = event.GetPoint(0);
if(mDragActor)
{
- Vector3 position(point.screen.x, point.screen.y, 0.0f);
+ Vector3 position( event.GetScreenPosition( 0 ) );
mPaddle.SetPosition( position - mRelativeDragPoint );
- if(point.state==TouchPoint::Up) // Stop dragging
+ if( event.GetState( 0 ) == PointState::UP ) // Stop dragging
{
mDragAnimation = Animation::New(0.25f);
mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunction::EASE_IN);
mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick);
// Connect the callback to the touch signal on the background
- mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch );
+ mBackground.TouchSignal().Connect( this, &BubbleEffectExample::OnTouch );
}
}
// Callback function of the touch signal on the background
- bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+ bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
- mCurrentTouchPosition = point.screen;
- mEmitPosition = point.screen;
+ mCurrentTouchPosition = mEmitPosition = event.GetScreenPosition( 0 );
mTimerForBubbleEmission.Start();
mNonMovementCount = 0;
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 displacement = point.screen - mCurrentTouchPosition;
- mCurrentTouchPosition = point.screen;
+ Vector2 displacement = event.GetScreenPosition( 0 ) - mCurrentTouchPosition;
+ mCurrentTouchPosition = event.GetScreenPosition( 0 );
//emit multiple bubbles along the moving direction when the finger moves quickly
float step = std::min(5.f, displacement.Length());
for( float i=0.25f; i<step; i=i+1.f)
}
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mTimerForBubbleEmission.Stop();
mEmitAnimation.Play();
mAnimateComponentCount = 0;
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
+ case PointState::STATIONARY:
default:
{
break;
contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-// contentTable.TouchedSignal().Connect( this, &ButtonsController::OnTouchEvent );
for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
{
return true;
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
- {
- if( 1u == event.GetPointCount() )
- {
- const TouchPoint::State state = event.GetPoint(0u).state;
-
- // Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
-
- if( TouchPoint::Down == state )
- {
- mLastPoint = localPoint;
- mAnimation = Animation::New( 0.25f );
- }
- else if( TouchPoint::Motion == state )
- {
- if( mAnimation )
- {
- mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
- mAnimation.Play();
- mLastPoint = localPoint;
- }
- }
- }
-
- return true;
- }
-
- private:
+private:
Application& mApplication;
Toolkit::Control mView; ///< The View instance.
stage.Add( table );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
stage.Add( textLabel );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
stage.Add(mScrollParent);
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &HomescreenBenchmark::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &HomescreenBenchmark::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
imagePrevious.SetOpacity( 0.6f );
controlsLayer.Add( imagePrevious );
imagePrevious.SetName( PREVIOUS_BUTTON_ID );
- imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
+ imagePrevious.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
// Next image button:
Toolkit::ImageView imageNext = Toolkit::ImageView::New( playImage );
imageNext.SetOpacity( 0.6f );
controlsLayer.Add( imageNext );
imageNext.SetName( NEXT_BUTTON_ID );
- imageNext.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
+ imageNext.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
// Buttons to popup selectors for fitting and sampling modes:
}
}
- bool OnControlTouched( Actor actor, const TouchEvent& event )
+ bool OnControlTouched( Actor actor, const TouchData& event )
{
if(event.GetPointCount() > 0)
{
- const TouchPoint& point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Up:
+ case PointState::UP:
{
const std::string & name = actor.GetName();
if( name == NEXT_BUTTON_ID )
ImageView image = CreateImageView( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode );
image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) );
image.SetSize( imageSize );
- image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
+ image.TouchSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
mFittingModes[image.GetId()] = fittingMode;
mResourceUrls[image.GetId()] = imageSource.configuration.path;
mSizes[image.GetId()] = imageSize;
* @param[in] actor The actor touched
* @param[in] event The TouchEvent.
*/
- bool OnTouchImage( Actor actor, const TouchEvent& event )
+ bool OnTouchImage( Actor actor, const TouchData& event )
{
- if( (event.points.size() > 0) && (!mScrolling) )
+ if( ( event.GetPointCount() > 0 ) && ( !mScrolling ) )
{
- TouchPoint point = event.points[0];
- if(point.state == TouchPoint::Up)
+ if( event.GetState( 0 ) == PointState::UP )
{
// Spin the image a few times:
Animation animation = Animation::New(SPIN_DURATION);
animation.Play();
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
- const TouchPoint &point = touch.GetPoint(0);
- if(point.state == TouchPoint::Down)
+ if( touch.GetState( 0 ) == PointState::DOWN )
{
mIndex++;
for( int i=0; i<3;i++ )
contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-// contentTable.TouchedSignal().Connect( this, &LoggingController::OnTouchEvent );
for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
{
return true;
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
- {
- if( 1u == event.GetPointCount() )
- {
- const TouchPoint::State state = event.GetPoint(0u).state;
-
- // Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
-
- if( TouchPoint::Down == state )
- {
- mLastPoint = localPoint;
- mAnimation = Animation::New( 0.25f );
- }
- else if( TouchPoint::Motion == state )
- {
- if( mAnimation )
- {
- mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
- mAnimation.Play();
- mLastPoint = localPoint;
- }
- }
- }
-
- return true;
- }
-
- private:
+private:
struct LoggerState
{
APPLICATION_TITLE );
mContent.SetLeaveRequired(true);
- mContent.TouchedSignal().Connect( this, &ExampleController::OnTouched );
+ mContent.TouchSignal().Connect( this, &ExampleController::OnTouched );
// Create magnifier (controlled by human touch)
Layer overlay = Layer::New();
* @param[in] actor The actor that received the touch
* @param[in] event The touch-event information
*/
- bool OnTouched( Actor actor, const TouchEvent& event )
+ bool OnTouched( Actor actor, const TouchData& event )
{
if(event.GetPointCount() > 0)
{
- const TouchPoint& point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
- case TouchPoint::Motion:
+ case PointState::DOWN:
+ case PointState::MOTION:
{
ShowMagnifier();
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
HideMagnifier();
break;
}
- default:
+ case PointState::STATIONARY:
{
break;
}
} // end switch
- Vector3 touchPoint(point.screen);
+ Vector3 touchPoint( event.GetScreenPosition( 0 ) );
SetMagnifierPosition(touchPoint - mStageSize * 0.5f);
}
meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES);
- meshActor.TouchedSignal().Connect(this, &ExampleController::OnTouched);
+ meshActor.TouchSignal().Connect(this, &ExampleController::OnTouched);
std::ostringstream oss;
oss << "Mesh Actor " << i;
meshActor.SetName(oss.str());
mActors[NUMBER_OF_SAMPLES-2].GetRendererAt(0).SetTextures( firstTextureSet );
- stage.GetRootLayer().TouchedSignal().Connect(this, &ExampleController::OnStageTouched);
+ stage.GetRootLayer().TouchSignal().Connect(this, &ExampleController::OnStageTouched);
}
void PrintDepths()
printf("\n");
}
- bool OnTouched( Actor actor, const TouchEvent& event )
+ bool OnTouched( Actor actor, const TouchData& event )
{
- if( event.GetPoint(0).state == TouchPoint::Finished )
+ if( event.GetState( 0 ) == PointState::UP )
{
int index = actor.GetProperty<int>(actor.GetPropertyIndex("index"));
return true;
}
- bool OnStageTouched( Actor rootLayer, const TouchEvent& event )
+ bool OnStageTouched( Actor rootLayer, const TouchData& event )
{
- if( event.GetPoint(0).state == TouchPoint::Finished )
+ if( event.GetState( 0 ) == PointState::UP )
{
switch( mZMode )
{
/**
* Touch event function
*/
- bool OnTouch( Actor actor, const TouchEvent& touch );
+ bool OnTouch( Actor actor, const TouchData& touch );
/**
* Key event function
mTimerDispersion.TickSignal().Connect(this, &MetaballExplosionController::OnTimerDispersionTick);
// Connect the callback to the touch signal on the mesh actor
- stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballExplosionController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &MetaballExplosionController::OnTouch );
}
Geometry MetaballExplosionController::CreateGeometry()
mCompositionActor.SetProperty( mPositionIndex, metaballCenter );
}
-bool MetaballExplosionController::OnTouch( Actor actor, const TouchEvent& touch )
+bool MetaballExplosionController::OnTouch( Actor actor, const TouchData& touch )
{
- const TouchPoint &point = touch.GetPoint(0);
float aspectR = mScreenSize.y / mScreenSize.x;
- switch( point.state )
+ switch( touch.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
ResetMetaballs(true);
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ const Vector2 screen = touch.GetScreenPosition( 0 );
+ Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ const Vector2 screen = touch.GetScreenPosition( 0 );
+ Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mTimerDispersion.Start();
break;
~MetaballRefracController();
void Create( Application& app );
- bool OnTouch( Actor actor, const TouchEvent& touch );
+ bool OnTouch( Actor actor, const TouchData& touch );
void OnKeyEvent(const KeyEvent& event);
void SetGravity(const Vector2 & gravity);
CreateAnimations();
// Connect the callback to the touch signal on the mesh actor
- stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballRefracController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &MetaballRefracController::OnTouch );
}
/**
}
}
-bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
+bool MetaballRefracController::OnTouch( Actor actor, const TouchData& touch )
{
- const TouchPoint &point = touch.GetPoint(0);
float aspectR = mScreenSize.y / mScreenSize.x;
- switch(point.state)
+ switch( touch.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
StopAfterClickAnimations();
for (int i = 0 ; i < METABALL_NUMBER ; i++)
//We draw with the refraction-composition shader
mRendererRefraction.SetTextures(mTextureSetRefraction);
mRendererRefraction.SetShader( mShaderRefraction );
- mCurrentTouchPosition = point.screen;
+ mCurrentTouchPosition = touch.GetScreenPosition( 0 );
//we use the click position for the metaballs
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ Vector2 metaballCenter = Vector2((mCurrentTouchPosition.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - mCurrentTouchPosition.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 displacement = point.screen - mCurrentTouchPosition;
- mCurrentTouchPosition = point.screen;
+ Vector2 screen = touch.GetScreenPosition( 0 );
+ Vector2 displacement = screen - mCurrentTouchPosition;
+ mCurrentTouchPosition = screen;
mMetaballPosVariationTo.x += (displacement.x / mScreenSize.x) * 2.2;
mMetaballPosVariationTo.y += (- displacement.y / mScreenSize.y) * 2.2;
mPositionVarAnimation[1].Play();
//we use the click position for the metaballs
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
//Stop click animations
StopClickAnimations();
mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &PerfScroll::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch );
mParent = Actor::New();
mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
ShowAnimation();
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
mContent.Add( mMeshActor );
// Connect the callback to the touch signal on the mesh actor
- mContent.TouchedSignal().Connect( this, &RefractionEffectExample::OnTouch );
+ mContent.TouchSignal().Connect( this, &RefractionEffectExample::OnTouch );
// shader used when the finger is touching the screen. render refraction effect
mShaderRefraction = Shader::New( VERTEX_SHADER_REFRACTION, FRAGMENT_SHADER_REFRACTION );
return true;
}
- bool OnTouch( Actor actor , const TouchEvent& event )
+ bool OnTouch( Actor actor, const TouchData& event )
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
mRenderer.SetShader( mShaderRefraction );
- SetLightXYOffset( point.screen );
+ SetLightXYOffset( event.GetScreenPosition( 0 ) );
mLightAnimation.Play();
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
// make the light position following the finger movement
- SetLightXYOffset( point.screen );
+ SetLightXYOffset( event.GetScreenPosition( 0 ) );
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mLightAnimation.Pause();
mStrenghAnimation.Play();
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
- default:
+ case PointState::STATIONARY:
{
break;
}
actor.SetParentOrigin(ParentOrigin::CENTER);
actor.SetAnchorPoint(AnchorPoint::CENTER);
- actor.TouchedSignal().Connect( this, &ExampleController::OnTouchImage );
+ actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage );
return actor;
}
* @param[in] actor The actor touched
* @param[in] event The TouchEvent.
*/
- bool OnTouchImage( Actor actor, const TouchEvent& event )
+ bool OnTouchImage( Actor actor, const TouchData& event )
{
- if( (event.points.size() > 0) && (!mScrolling) )
+ if( (event.GetPointCount() > 0) && (!mScrolling) )
{
- TouchPoint point = event.points[0];
- if(point.state == TouchPoint::Up)
+ if( event.GetState( 0 ) == PointState::UP )
{
// Spin the Image a few times.
Animation animation = Animation::New(SPIN_DURATION);
mBloomView.Add( mBloomActor );
// Connect the callback to the touch signal on the background
- mSuperBlurView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
- mBloomView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
+ mSuperBlurView.TouchSignal().Connect( this, &BlurExample::OnTouch );
+ mBloomView.TouchSignal().Connect( this, &BlurExample::OnTouch );
}
// Callback function of the touch signal on the background
- bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+ bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
if( mAnimation )
{
mAnimation.Play();
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
if( mAnimation )
{
mAnimation.Play();
break;
}
- case TouchPoint::Motion:
- case TouchPoint::Stationary:
- case TouchPoint::Last:
- default:
+ case PointState::MOTION:
+ case PointState::STATIONARY:
{
break;
}
popup.SetSize( width, 0.0f );
popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT );
- popup.TouchedSignal().Connect( this, &TextFieldExample::OnPopupTouched );
+ popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched );
return popup;
}
mField.Reset();
}
- bool OnPopupTouched( Actor actor, const TouchEvent& event )
+ bool OnPopupTouched( Actor actor, const TouchData& event )
{
// End edit mode for TextField if parent Popup touched.
if(event.GetPointCount() > 0)
{
- const TouchPoint& point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
// Update the folder text and lose focus for Key events
if( mButton && mField )
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mTableView.TouchedSignal().Connect( this, &EmojiExample::OnTouchEvent );
+ mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch );
stage.Add( mTableView );
for( unsigned int index = 0u; index < NUMBER_OF_EMOJIS; ++index )
}
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ bool OnTouch( Actor actor, const TouchData& event )
{
if( 1u == event.GetPointCount() )
{
- const TouchPoint::State state = event.GetPoint(0u).state;
+ const PointState::Type state = event.GetState( 0 );
// Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) );
- if( TouchPoint::Down == state )
+ if( PointState::DOWN == state )
{
mLastPoint = localPoint;
mAnimation = Animation::New( 0.25f );
}
- else if( TouchPoint::Motion == state )
+ else if( PointState::MOTION == state )
{
if( mAnimation )
{
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mTableView.TouchedSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouchEvent );
+ mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch );
stage.Add( mTableView );
for( unsigned int index = 0u; index < NUMBER_OF_LANGUAGES; ++index )
}
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ bool OnTouch( Actor actor, const TouchData& event )
{
if( 1u == event.GetPointCount() )
{
- const TouchPoint::State state = event.GetPoint(0u).state;
+ const PointState::Type state = event.GetState( 0 );
// Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) );
- if( TouchPoint::Down == state )
+ if( PointState::DOWN == state )
{
mLastPoint = localPoint;
mAnimation = Animation::New( 0.25f );
}
- else if( TouchPoint::Motion == state )
+ else if( PointState::MOTION == state )
{
if( mAnimation )
{
stage.Add( mTextLabel );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &TiltController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &TiltController::OnTouch );
CreateSensor();
}
}
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();