diff --git a/com.samsung.dali-demo.xml b/com.samsung.dali-demo.xml
index 84e0678..90fda31 100644
--- a/com.samsung.dali-demo.xml
+++ b/com.samsung.dali-demo.xml
@@ -154,4 +154,7 @@
+
+
+
diff --git a/demo/dali-demo.cpp b/demo/dali-demo.cpp
index c3b628b..3f693a7 100644
--- a/demo/dali-demo.cpp
+++ b/demo/dali-demo.cpp
@@ -58,6 +58,7 @@ int DALI_EXPORT_API main(int argc, char **argv)
demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE));
demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT));
demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING));
+ demo.AddExample(Example("text-editor.example", DALI_DEMO_STR_TITLE_TEXT_EDITOR));
demo.AddExample(Example("size-negotiation.example", DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE));
demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP));
demo.AddExample(Example("buttons.example", DALI_DEMO_STR_TITLE_BUTTONS));
diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp
index 00e1c7f..04cfaa3 100644
--- a/demo/dali-table-view.cpp
+++ b/demo/dali-table-view.cpp
@@ -241,7 +241,7 @@ void DaliTableView::Initialize( Application& application )
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();
@@ -476,7 +476,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
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;
@@ -496,12 +496,16 @@ Toolkit::ImageView DaliTableView::NewStencilImage()
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;
@@ -509,7 +513,7 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
// 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.
@@ -581,10 +585,9 @@ void DaliTableView::OnScrollComplete( const Dali::Vector2& position )
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;
}
@@ -901,9 +904,7 @@ void DaliTableView::OnFocusedActorActivated( Dali::Actor activatedActor )
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 );
}
}
diff --git a/demo/dali-table-view.h b/demo/dali-table-view.h
index aa2a469..d4b0946 100644
--- a/demo/dali-table-view.h
+++ b/demo/dali-table-view.h
@@ -163,7 +163,17 @@ private: // Application callbacks & implementation
*
* @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
@@ -214,7 +224,7 @@ private: // Application callbacks & implementation
*
* @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
diff --git a/examples/benchmark/benchmark.cpp b/examples/benchmark/benchmark.cpp
index 3824de8..e9fed0e 100644
--- a/examples/benchmark/benchmark.cpp
+++ b/examples/benchmark/benchmark.cpp
@@ -285,7 +285,7 @@ public:
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 )
{
@@ -303,7 +303,7 @@ public:
ShowAnimation();
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
diff --git a/examples/blocks/blocks-example.cpp b/examples/blocks/blocks-example.cpp
index 61aed74..a308be3 100644
--- a/examples/blocks/blocks-example.cpp
+++ b/examples/blocks/blocks-example.cpp
@@ -289,8 +289,8 @@ private:
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);
@@ -579,15 +579,15 @@ private:
* @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;
@@ -605,17 +605,16 @@ private:
* @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);
diff --git a/examples/bubble-effect/bubble-effect-example.cpp b/examples/bubble-effect/bubble-effect-example.cpp
index 7127ba4..fbd83db 100644
--- a/examples/bubble-effect/bubble-effect-example.cpp
+++ b/examples/bubble-effect/bubble-effect-example.cpp
@@ -150,7 +150,7 @@ private:
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 );
}
@@ -205,24 +205,22 @@ private:
}
// 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( static_cast( 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.
diff --git a/examples/compressed-texture-formats/compressed-texture-formats-example.cpp b/examples/compressed-texture-formats/compressed-texture-formats-example.cpp
index 7fed128..a55f69a 100644
--- a/examples/compressed-texture-formats/compressed-texture-formats-example.cpp
+++ b/examples/compressed-texture-formats/compressed-texture-formats-example.cpp
@@ -108,10 +108,10 @@ public:
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();
diff --git a/examples/hello-world/hello-world-example.cpp b/examples/hello-world/hello-world-example.cpp
index 2c5763a..89670a1 100644
--- a/examples/hello-world/hello-world-example.cpp
+++ b/examples/hello-world/hello-world-example.cpp
@@ -51,10 +51,10 @@ public:
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();
diff --git a/examples/homescreen-benchmark/homescreen-benchmark.cpp b/examples/homescreen-benchmark/homescreen-benchmark.cpp
index a35919a..da33200 100644
--- a/examples/homescreen-benchmark/homescreen-benchmark.cpp
+++ b/examples/homescreen-benchmark/homescreen-benchmark.cpp
@@ -438,10 +438,10 @@ public:
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();
diff --git a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
index a5782ef..042ce7a 100644
--- a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
+++ b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
@@ -295,7 +295,7 @@ public:
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 );
@@ -305,7 +305,7 @@ public:
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:
@@ -535,14 +535,13 @@ public:
}
}
- 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 )
diff --git a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
index dc982f8..51482d4 100644
--- a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
+++ b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
@@ -461,7 +461,7 @@ public:
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;
@@ -477,12 +477,11 @@ public:
* @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);
diff --git a/examples/image-view-pixel-area/image-view-pixel-area-example.cpp b/examples/image-view-pixel-area/image-view-pixel-area-example.cpp
index 69a8c54..55ac6b6 100644
--- a/examples/image-view-pixel-area/image-view-pixel-area-example.cpp
+++ b/examples/image-view-pixel-area/image-view-pixel-area-example.cpp
@@ -74,13 +74,12 @@ private:
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++ )
diff --git a/examples/logging/logging-example.cpp b/examples/logging/logging-example.cpp
index 9abef21..31af882 100644
--- a/examples/logging/logging-example.cpp
+++ b/examples/logging/logging-example.cpp
@@ -174,7 +174,6 @@ class LoggingController: public ConnectionTracker
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 )
{
@@ -639,35 +638,7 @@ class LoggingController: public ConnectionTracker
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( static_cast( 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
{
diff --git a/examples/magnifier/magnifier-example.cpp b/examples/magnifier/magnifier-example.cpp
index 279713d..fb461b5 100644
--- a/examples/magnifier/magnifier-example.cpp
+++ b/examples/magnifier/magnifier-example.cpp
@@ -213,7 +213,7 @@ public:
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();
@@ -300,33 +300,32 @@ public:
* @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);
}
diff --git a/examples/mesh-sorting/mesh-sorting-example.cpp b/examples/mesh-sorting/mesh-sorting-example.cpp
index 28d7f9f..b521708 100644
--- a/examples/mesh-sorting/mesh-sorting-example.cpp
+++ b/examples/mesh-sorting/mesh-sorting-example.cpp
@@ -187,7 +187,7 @@ public:
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());
@@ -196,7 +196,7 @@ public:
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()
@@ -227,9 +227,9 @@ public:
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(actor.GetPropertyIndex("index"));
@@ -244,9 +244,9 @@ public:
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 )
{
diff --git a/examples/metaball-explosion/metaball-explosion-example.cpp b/examples/metaball-explosion/metaball-explosion-example.cpp
index 231d778..166f8e2 100644
--- a/examples/metaball-explosion/metaball-explosion-example.cpp
+++ b/examples/metaball-explosion/metaball-explosion-example.cpp
@@ -192,7 +192,7 @@ public:
/**
* Touch event function
*/
- bool OnTouch( Actor actor, const TouchEvent& touch );
+ bool OnTouch( Actor actor, const TouchData& touch );
/**
* Key event function
@@ -344,7 +344,7 @@ void MetaballExplosionController::Create( Application& app )
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()
@@ -681,31 +681,32 @@ void MetaballExplosionController::SetPositionToMetaballs(Vector2 & metaballCente
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;
diff --git a/examples/metaball-refrac/metaball-refrac-example.cpp b/examples/metaball-refrac/metaball-refrac-example.cpp
index a1382b3..b55515a 100644
--- a/examples/metaball-refrac/metaball-refrac-example.cpp
+++ b/examples/metaball-refrac/metaball-refrac-example.cpp
@@ -164,7 +164,7 @@ public:
~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);
@@ -283,7 +283,7 @@ void MetaballRefracController::Create( Application& app )
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 );
}
/**
@@ -759,13 +759,12 @@ void MetaballRefracController::SetPositionToMetaballs(Vector2 & metaballCenter)
}
}
-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++)
@@ -776,17 +775,18 @@ bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
//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;
@@ -803,13 +803,13 @@ bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
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();
diff --git a/examples/perf-scroll/perf-scroll.cpp b/examples/perf-scroll/perf-scroll.cpp
index 78ca137..bdf2195 100644
--- a/examples/perf-scroll/perf-scroll.cpp
+++ b/examples/perf-scroll/perf-scroll.cpp
@@ -284,7 +284,7 @@ public:
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 );
@@ -302,7 +302,7 @@ public:
ShowAnimation();
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
diff --git a/examples/refraction-effect/refraction-effect-example.cpp b/examples/refraction-effect/refraction-effect-example.cpp
index ea8bb6b..189a7c7 100644
--- a/examples/refraction-effect/refraction-effect-example.cpp
+++ b/examples/refraction-effect/refraction-effect-example.cpp
@@ -294,7 +294,7 @@ private:
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 );
@@ -348,16 +348,15 @@ private:
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();
@@ -372,15 +371,15 @@ private:
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();
@@ -394,9 +393,7 @@ private:
mStrenghAnimation.Play();
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
- default:
+ case PointState::STATIONARY:
{
break;
}
diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp
index 259024b..1a8d12a 100644
--- a/examples/scroll-view/scroll-view-example.cpp
+++ b/examples/scroll-view/scroll-view-example.cpp
@@ -459,7 +459,7 @@ private:
actor.SetParentOrigin(ParentOrigin::CENTER);
actor.SetAnchorPoint(AnchorPoint::CENTER);
- actor.TouchedSignal().Connect( this, &ExampleController::OnTouchImage );
+ actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage );
return actor;
}
@@ -489,12 +489,11 @@ private:
* @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);
diff --git a/examples/super-blur-bloom/super-blur-bloom-example.cpp b/examples/super-blur-bloom/super-blur-bloom-example.cpp
index 7c4ed43..3196a3b 100644
--- a/examples/super-blur-bloom/super-blur-bloom-example.cpp
+++ b/examples/super-blur-bloom/super-blur-bloom-example.cpp
@@ -130,17 +130,16 @@ private:
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 )
{
@@ -159,9 +158,9 @@ private:
mAnimation.Play();
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
if( mAnimation )
{
@@ -180,10 +179,8 @@ private:
mAnimation.Play();
break;
}
- case TouchPoint::Motion:
- case TouchPoint::Stationary:
- case TouchPoint::Last:
- default:
+ case PointState::MOTION:
+ case PointState::STATIONARY:
{
break;
}
diff --git a/examples/text-editor/text-editor-example.cpp b/examples/text-editor/text-editor-example.cpp
new file mode 100644
index 0000000..5ec61b7
--- /dev/null
+++ b/examples/text-editor/text-editor-example.cpp
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2016 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.
+ *
+ */
+
+/**
+ * @file simple-text-editor-example.cpp
+ * @brief Very basic usage of TextEditor control
+ */
+
+// EXTERNAL INCLUDES
+#include
+#include
+#include
+
+// INTERNAL INCLUDES
+#include "shared/view.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+const Vector4 BACKGROUND_COLOR( 0.04f, 0.345f, 0.392f, 1.0f ); ///< The background color.
+const char* TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png"; ///< The tool-bar image.
+const float TOOLBAR_BUTTON_PERCENTAGE = 0.1f; ///< The button's space width as a percentage of the toolbar's width.
+const float TOOLBAR_TITLE_PERCENTAGE = 0.7f; ///< The title's width as a percentage of the toolbar's width.
+const float TOOLBAR_HEIGHT_PERCENTAGE = 0.05f; ///< The toolbar's height as a percentage of the stage's height.
+const float TOOLBAR_PADDING = 4.f; ///< The padding in pixels.
+const Vector3 BUTTON_PERCENTAGE( 0.8f, 0.8f, 1.f ); ///< The button's width as a percentage of the space for the buttons in the toolbar.
+const Vector3 TEXT_EDITOR_RELATIVE_SIZE( 1.f, 0.45f, 1.0f ); ///< The size of the text editor as a percentage of the stage's size.
+const Vector4 TEXT_EDITOR_BACKGROUND_COLOR( 1.f, 1.f, 1.f, 0.15f ); ///< The background color of the text editor.
+
+const Vector4 COLORS[] = { Color::RED,
+ Color::GREEN,
+ Color::BLUE,
+ Color::YELLOW,
+ Color::CYAN,
+ Color::MAGENTA,
+ Color::WHITE,
+ Color::BLACK };
+const unsigned int NUMBER_OF_COLORS = sizeof( COLORS ) / sizeof( Vector4 );
+
+} // Unnamed namespace
+
+/**
+ * @brief The main class of the demo.
+ */
+class TextEditorExample : public ConnectionTracker
+{
+public:
+
+ TextEditorExample( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &TextEditorExample::Create );
+ }
+
+ ~TextEditorExample()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * One-time setup in response to Application InitSignal.
+ */
+ void Create( Application& application )
+ {
+ Stage stage = Stage::GetCurrent();
+
+ // Respond to key events
+ stage.KeyEventSignal().Connect(this, &TextEditorExample::OnKeyEvent);
+
+ // Set a background color.
+ stage.SetBackgroundColor( BACKGROUND_COLOR );
+
+ // The stage size.
+ const Vector2 stageSize = stage.GetSize();
+
+ // Creates a default view with a default tool bar.
+ // The view is added to the stage.
+
+ // Set the toolbar style
+ const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height;
+ const DemoHelper::ViewStyle viewStyle( TOOLBAR_BUTTON_PERCENTAGE,
+ TOOLBAR_TITLE_PERCENTAGE,
+ toolBarHeight,
+ TOOLBAR_PADDING );
+
+ Layer contents = DemoHelper::CreateView( mApplication,
+ mView,
+ mToolBar,
+ "",
+ TOOLBAR_IMAGE,
+ "",
+ viewStyle );
+
+ // Create a 'select color' button.
+ mColorButtonOption = Toolkit::PushButton::New();
+ mColorButtonOption.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mColorButtonOption.SetSizeModeFactor( BUTTON_PERCENTAGE );
+
+ mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, Color::BLACK );
+ mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, Color::BLACK );
+
+ mColorButtonOption.ClickedSignal().Connect( this, &TextEditorExample::OnChangeColorButtonClicked );
+
+ mToolBar.AddControl( mColorButtonOption, viewStyle.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
+
+ // Create the text editor.
+ mEditor = TextEditor::New();
+ mEditor.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ mEditor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mEditor.SetPosition( 0.f, toolBarHeight, 0.f );
+ mEditor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mEditor.SetSizeModeFactor( TEXT_EDITOR_RELATIVE_SIZE );
+
+ mEditor.SetBackgroundColor( TEXT_EDITOR_BACKGROUND_COLOR );
+
+ mEditor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK );
+ mEditor.SetProperty( TextEditor::Property::TEXT,
+ "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"
+ "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n"
+ "Ne nec nulla regione albucius, mea doctus delenit ad!\n"
+ "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n"
+ "Quidam corpora at duo. An eos possim scripserit?\n\n"
+ "Aťqui dicant sěnťenťíae aň vel!\n"
+ "Vis viris médiocrem elaboraret ét, verear civibus moderatius ex duo!\n"
+ "Án veri laborě iňtěgré quó, mei aď poššit lobortis, mei prompťa čonsťitůťó eů.\n"
+ "Aliquip sanctůs delicáta quí ěá, et natum aliquam est?\n"
+ "Asšúm sapěret usu ůť.\n"
+ "Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n" );
+
+ contents.Add( mEditor );
+ }
+
+ void CreateButtonContainer()
+ {
+ mButtonContainer = Toolkit::TableView::New( NUMBER_OF_COLORS, 1u );
+ mButtonContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mButtonContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+ Stage stage = Stage::GetCurrent();
+ const Vector2 stageSize = stage.GetSize();
+ const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height;
+ mButtonContainer.SetPosition( TOOLBAR_PADDING, 2.f * TOOLBAR_PADDING + toolBarHeight, 0.f );
+
+ mButtonContainer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+ const Vector3 containerPercentage( 0.8f * TOOLBAR_BUTTON_PERCENTAGE, NUMBER_OF_COLORS, 1.f );
+ mButtonContainer.SetSizeModeFactor( containerPercentage );
+
+ Layer toolbarLayer = mToolBar.GetLayer();
+ toolbarLayer.Add( mButtonContainer );
+
+ const Vector3 buttonPercentage( 1.f, 0.8f / static_cast( NUMBER_OF_COLORS ), 1.f );
+ for( unsigned int index = 0u; index < NUMBER_OF_COLORS; ++index )
+ {
+ Toolkit::PushButton button = Toolkit::PushButton::New();
+ button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ button.SetSizeModeFactor( buttonPercentage );
+
+ std::ostringstream s;
+ s << "color" << index;
+ button.SetName( s.str() );
+
+ button.SetProperty( Button::Property::UNSELECTED_COLOR, COLORS[index] );
+ button.SetProperty( Button::Property::SELECTED_COLOR, COLORS[index] );
+
+ button.ClickedSignal().Connect( this, &TextEditorExample::OnColorButtonClicked );
+
+ mButtonContainer.Add( button );
+ }
+ }
+
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ // Exit application when click back or escape.
+ mApplication.Quit();
+ }
+ }
+ }
+
+ bool OnChangeColorButtonClicked( Button button )
+ {
+ if( !mButtonContainer )
+ {
+ CreateButtonContainer();
+ }
+
+ mButtonContainer.SetVisible( true );
+ mButtonContainer.SetSensitive( true );
+ return true;
+ }
+
+ bool OnColorButtonClicked( Button button )
+ {
+ const std::string& name = button.GetName();
+
+ if( "color" == name.substr( 0u, 5u ) )
+ {
+ const unsigned int index = strtoul( name.substr( 5u, 1u ).c_str(), NULL, 10u );
+ mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, COLORS[index] );
+ }
+
+ mButtonContainer.SetVisible( false );
+ mButtonContainer.SetSensitive( false );
+
+ return true;
+ }
+
+private:
+
+ Application& mApplication;
+
+ Toolkit::Control mView;
+ Toolkit::ToolBar mToolBar;
+ Toolkit::TextEditor mEditor;
+ Toolkit::PushButton mColorButtonOption;
+ Toolkit::TableView mButtonContainer;
+};
+
+void RunTest( Application& application )
+{
+ TextEditorExample test( application );
+
+ application.MainLoop();
+}
+
+/** Entry point for Linux & Tizen applications */
+int main( int argc, char **argv )
+{
+ // DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet.
+ Application application = Application::New( &argc, &argv );
+
+ RunTest( application );
+
+ return 0;
+}
diff --git a/examples/text-field/text-field-example.cpp b/examples/text-field/text-field-example.cpp
index 8b611b2..2a60569 100644
--- a/examples/text-field/text-field-example.cpp
+++ b/examples/text-field/text-field-example.cpp
@@ -136,7 +136,7 @@ public:
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;
}
@@ -159,15 +159,14 @@ public:
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 )
diff --git a/examples/text-label-emojis/text-label-emojis.cpp b/examples/text-label-emojis/text-label-emojis.cpp
index f2af26d..f5415b2 100644
--- a/examples/text-label-emojis/text-label-emojis.cpp
+++ b/examples/text-label-emojis/text-label-emojis.cpp
@@ -63,7 +63,7 @@ public:
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 )
@@ -81,21 +81,21 @@ public:
}
}
- 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( static_cast( event.GetPoint( 0 ).local.y ) );
+ const float localPoint = static_cast( static_cast( 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 )
{
diff --git a/examples/text-label-multi-language/text-label-multi-language-example.cpp b/examples/text-label-multi-language/text-label-multi-language-example.cpp
index 95ebacf..8005b58 100644
--- a/examples/text-label-multi-language/text-label-multi-language-example.cpp
+++ b/examples/text-label-multi-language/text-label-multi-language-example.cpp
@@ -66,7 +66,7 @@ public:
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 )
@@ -84,21 +84,21 @@ public:
}
}
- 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( static_cast( event.GetPoint( 0 ).local.y ) );
+ const float localPoint = static_cast( static_cast( 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 )
{
diff --git a/examples/tilt/tilt-example.cpp b/examples/tilt/tilt-example.cpp
index 08d6fd6..0adc72e 100644
--- a/examples/tilt/tilt-example.cpp
+++ b/examples/tilt/tilt-example.cpp
@@ -56,7 +56,7 @@ public:
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();
}
@@ -71,7 +71,7 @@ public:
}
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec
index d9c89f4..0267f4e 100755
--- a/packaging/com.samsung.dali-demo.spec
+++ b/packaging/com.samsung.dali-demo.spec
@@ -2,7 +2,7 @@
Name: com.samsung.dali-demo
Summary: The OpenGLES Canvas Core Demo
-Version: 1.1.36
+Version: 1.1.37
Release: 1
Group: System/Libraries
License: Apache-2.0
diff --git a/shared/dali-demo-strings.h b/shared/dali-demo-strings.h
index 0a62147..0262c7c 100644
--- a/shared/dali-demo-strings.h
+++ b/shared/dali-demo-strings.h
@@ -88,6 +88,7 @@ extern "C"
#define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts"
#define DALI_DEMO_STR_TITLE_EMOJI_TEXT "Emoji Text"
#define DALI_DEMO_STR_TITLE_TEXT_SCROLLING "Text Scrolling"
+#define DALI_DEMO_STR_TITLE_TEXT_EDITOR "Text Editor"
#define DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE "Negotiate Size"
#define DALI_DEMO_STR_TITLE_POPUP "Popup"
#define DALI_DEMO_STR_TITLE_BUTTONS "Buttons"
diff --git a/shared/view.h b/shared/view.h
index 6af3324..5d7f8be 100644
--- a/shared/view.h
+++ b/shared/view.h
@@ -85,7 +85,7 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar,
toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
- // Add the tool bar to the too bar layer.
+ // Add the tool bar to the tool bar layer.
toolBarLayer.Add( toolBar );
// Tool bar text.