Commit 661bf429a56def085e118b5c7a48ae48ee41c86e
[dali_1.1.37] Merge branch 'devel/master'
Change-Id: If92872f458358103be0a553d7f88089db9454862
Showing
31 changed files
with
421 additions
and
221 deletions
com.samsung.dali-demo.xml
| ... | ... | @@ -154,4 +154,7 @@ |
| 154 | 154 | <ui-application appid="flex-container.example" exec="/usr/apps/com.samsung.dali-demo/bin/flex-container.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 155 | 155 | <label>Flex Container</label> |
| 156 | 156 | </ui-application> |
| 157 | + <ui-application appid="text-editor.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-editor.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> | |
| 158 | + <label>Text Editor</label> | |
| 159 | + </ui-application> | |
| 157 | 160 | </manifest> | ... | ... |
demo/dali-demo.cpp
| ... | ... | @@ -58,6 +58,7 @@ int DALI_EXPORT_API main(int argc, char **argv) |
| 58 | 58 | demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE)); |
| 59 | 59 | demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT)); |
| 60 | 60 | demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING)); |
| 61 | + demo.AddExample(Example("text-editor.example", DALI_DEMO_STR_TITLE_TEXT_EDITOR)); | |
| 61 | 62 | demo.AddExample(Example("size-negotiation.example", DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE)); |
| 62 | 63 | demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP)); |
| 63 | 64 | demo.AddExample(Example("buttons.example", DALI_DEMO_STR_TITLE_BUTTONS)); | ... | ... |
demo/dali-table-view.cpp
| ... | ... | @@ -241,7 +241,7 @@ void DaliTableView::Initialize( Application& application ) |
| 241 | 241 | mScrollView.SetAxisAutoLock( true ); |
| 242 | 242 | mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete ); |
| 243 | 243 | mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart ); |
| 244 | - mScrollView.TouchedSignal().Connect( this, &DaliTableView::OnScrollTouched ); | |
| 244 | + mScrollView.TouchSignal().Connect( this, &DaliTableView::OnScrollTouched ); | |
| 245 | 245 | |
| 246 | 246 | mScrollViewLayer = Layer::New(); |
| 247 | 247 | |
| ... | ... | @@ -476,7 +476,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 476 | 476 | content.SetKeyboardFocusable(true); |
| 477 | 477 | |
| 478 | 478 | // connect to the touch events |
| 479 | - content.TouchedSignal().Connect( this, &DaliTableView::OnTilePressed ); | |
| 479 | + content.TouchSignal().Connect( this, &DaliTableView::OnTilePressed ); | |
| 480 | 480 | content.HoveredSignal().Connect( this, &DaliTableView::OnTileHovered ); |
| 481 | 481 | |
| 482 | 482 | return content; |
| ... | ... | @@ -496,12 +496,16 @@ Toolkit::ImageView DaliTableView::NewStencilImage() |
| 496 | 496 | return stencil; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | -bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event ) | |
| 499 | +bool DaliTableView::OnTilePressed( Actor actor, const TouchData& event ) | |
| 500 | +{ | |
| 501 | + return DoTilePress( actor, event.GetState( 0 ) ); | |
| 502 | +} | |
| 503 | + | |
| 504 | +bool DaliTableView::DoTilePress( Actor actor, PointState::Type pointState ) | |
| 500 | 505 | { |
| 501 | 506 | bool consumed = false; |
| 502 | 507 | |
| 503 | - const TouchPoint& point = event.GetPoint( 0 ); | |
| 504 | - if( TouchPoint::Down == point.state ) | |
| 508 | + if( PointState::DOWN == pointState ) | |
| 505 | 509 | { |
| 506 | 510 | mPressedActor = actor; |
| 507 | 511 | consumed = true; |
| ... | ... | @@ -509,7 +513,7 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event ) |
| 509 | 513 | |
| 510 | 514 | // A button press is only valid if the Down & Up events |
| 511 | 515 | // both occurred within the button. |
| 512 | - if( ( TouchPoint::Up == point.state ) && | |
| 516 | + if( ( PointState::UP == pointState ) && | |
| 513 | 517 | ( mPressedActor == actor ) ) |
| 514 | 518 | { |
| 515 | 519 | // ignore Example button presses when scrolling or button animating. |
| ... | ... | @@ -581,10 +585,9 @@ void DaliTableView::OnScrollComplete( const Dali::Vector2& position ) |
| 581 | 585 | accessibilityManager.SetCurrentFocusActor(mPages[mScrollView.GetCurrentPage()].GetChildAt(0) ); |
| 582 | 586 | } |
| 583 | 587 | |
| 584 | -bool DaliTableView::OnScrollTouched( Actor actor, const TouchEvent& event ) | |
| 588 | +bool DaliTableView::OnScrollTouched( Actor actor, const TouchData& event ) | |
| 585 | 589 | { |
| 586 | - const TouchPoint& point = event.GetPoint( 0 ); | |
| 587 | - if( TouchPoint::Down == point.state ) | |
| 590 | + if( PointState::DOWN == event.GetState( 0 ) ) | |
| 588 | 591 | { |
| 589 | 592 | mPressedActor = actor; |
| 590 | 593 | } |
| ... | ... | @@ -901,9 +904,7 @@ void DaliTableView::OnFocusedActorActivated( Dali::Actor activatedActor ) |
| 901 | 904 | mPressedActor = activatedActor; |
| 902 | 905 | |
| 903 | 906 | // Activate the current focused actor; |
| 904 | - TouchEvent touchEventUp; | |
| 905 | - touchEventUp.points.push_back( TouchPoint ( 0, TouchPoint::Up, 0.0f, 0.0f ) ); | |
| 906 | - OnTilePressed(mPressedActor, touchEventUp); | |
| 907 | + DoTilePress( mPressedActor, PointState::UP ); | |
| 907 | 908 | } |
| 908 | 909 | } |
| 909 | 910 | ... | ... |
demo/dali-table-view.h
| ... | ... | @@ -163,7 +163,17 @@ private: // Application callbacks & implementation |
| 163 | 163 | * |
| 164 | 164 | * @return Consume flag |
| 165 | 165 | */ |
| 166 | - bool OnTilePressed( Dali::Actor actor, const Dali::TouchEvent& event ); | |
| 166 | + bool OnTilePressed( Dali::Actor actor, const Dali::TouchData& event ); | |
| 167 | + | |
| 168 | + /** | |
| 169 | + * Called by OnTilePressed & Accessibility to do the appropriate action. | |
| 170 | + * | |
| 171 | + * @param[in] actor The Actor representing this tile. | |
| 172 | + * @param[in] state The Touch state | |
| 173 | + * | |
| 174 | + * @return Consume flag | |
| 175 | + */ | |
| 176 | + bool DoTilePress( Dali::Actor actor, Dali::PointState::Type state ); | |
| 167 | 177 | |
| 168 | 178 | /** |
| 169 | 179 | * Signal emitted when any tile has been hovered |
| ... | ... | @@ -214,7 +224,7 @@ private: // Application callbacks & implementation |
| 214 | 224 | * |
| 215 | 225 | * @return Consume flag |
| 216 | 226 | */ |
| 217 | - bool OnScrollTouched( Dali::Actor actor, const Dali::TouchEvent& event ); | |
| 227 | + bool OnScrollTouched( Dali::Actor actor, const Dali::TouchData& event ); | |
| 218 | 228 | |
| 219 | 229 | /** |
| 220 | 230 | * Setup the effect on the scroll view | ... | ... |
examples/benchmark/benchmark.cpp
| ... | ... | @@ -285,7 +285,7 @@ public: |
| 285 | 285 | mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f ); |
| 286 | 286 | |
| 287 | 287 | // Respond to a click anywhere on the stage |
| 288 | - stage.GetRootLayer().TouchedSignal().Connect( this, &Benchmark::OnTouch ); | |
| 288 | + stage.GetRootLayer().TouchSignal().Connect( this, &Benchmark::OnTouch ); | |
| 289 | 289 | |
| 290 | 290 | if( gUseMesh ) |
| 291 | 291 | { |
| ... | ... | @@ -303,7 +303,7 @@ public: |
| 303 | 303 | ShowAnimation(); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 306 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 307 | 307 | { |
| 308 | 308 | // quit the application |
| 309 | 309 | mApplication.Quit(); | ... | ... |
examples/blocks/blocks-example.cpp
| ... | ... | @@ -289,8 +289,8 @@ private: |
| 289 | 289 | |
| 290 | 290 | mPaddle.SetPosition( stageSize * Vector3( PADDLE_START_POSITION ) ); |
| 291 | 291 | mContentLayer.Add(mPaddle); |
| 292 | - mPaddle.TouchedSignal().Connect(this, &ExampleController::OnTouchPaddle); | |
| 293 | - mContentLayer.TouchedSignal().Connect(this, &ExampleController::OnTouchLayer); | |
| 292 | + mPaddle.TouchSignal().Connect(this, &ExampleController::OnTouchPaddle); | |
| 293 | + mContentLayer.TouchSignal().Connect(this, &ExampleController::OnTouchLayer); | |
| 294 | 294 | |
| 295 | 295 | const float margin(BALL_SIZE.width * stageSize.width * 0.5f); |
| 296 | 296 | |
| ... | ... | @@ -579,15 +579,15 @@ private: |
| 579 | 579 | * @param[in] actor The actor touched |
| 580 | 580 | * @param[in] event The touch event |
| 581 | 581 | */ |
| 582 | - bool OnTouchPaddle(Actor actor, const TouchEvent& event) | |
| 582 | + bool OnTouchPaddle(Actor actor, const TouchData& event) | |
| 583 | 583 | { |
| 584 | 584 | if(event.GetPointCount()>0) |
| 585 | 585 | { |
| 586 | - const TouchPoint& point = event.GetPoint(0); | |
| 587 | - if(point.state==TouchPoint::Down) // Commence dragging | |
| 586 | + if( event.GetState( 0 ) == PointState::DOWN ) // Commence dragging | |
| 588 | 587 | { |
| 589 | 588 | // Get point where user touched paddle (relative to paddle's center) |
| 590 | - mRelativeDragPoint = Vector3(point.screen.x, point.screen.y, 0.0f); | |
| 589 | + Vector2 screenPoint = event.GetScreenPosition( 0 ); | |
| 590 | + mRelativeDragPoint = screenPoint; | |
| 591 | 591 | mRelativeDragPoint -= actor.GetCurrentPosition(); |
| 592 | 592 | |
| 593 | 593 | mDragActor = actor; |
| ... | ... | @@ -605,17 +605,16 @@ private: |
| 605 | 605 | * @param[in] actor The actor touched |
| 606 | 606 | * @param[in] event The touch event |
| 607 | 607 | */ |
| 608 | - bool OnTouchLayer(Actor actor, const TouchEvent& event) | |
| 608 | + bool OnTouchLayer(Actor actor, const TouchData& event) | |
| 609 | 609 | { |
| 610 | 610 | if(event.GetPointCount()>0) |
| 611 | 611 | { |
| 612 | - const TouchPoint& point = event.GetPoint(0); | |
| 613 | 612 | if(mDragActor) |
| 614 | 613 | { |
| 615 | - Vector3 position(point.screen.x, point.screen.y, 0.0f); | |
| 614 | + Vector3 position( event.GetScreenPosition( 0 ) ); | |
| 616 | 615 | mPaddle.SetPosition( position - mRelativeDragPoint ); |
| 617 | 616 | |
| 618 | - if(point.state==TouchPoint::Up) // Stop dragging | |
| 617 | + if( event.GetState( 0 ) == PointState::UP ) // Stop dragging | |
| 619 | 618 | { |
| 620 | 619 | mDragAnimation = Animation::New(0.25f); |
| 621 | 620 | mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunction::EASE_IN); | ... | ... |
examples/bubble-effect/bubble-effect-example.cpp
| ... | ... | @@ -150,7 +150,7 @@ private: |
| 150 | 150 | mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick); |
| 151 | 151 | |
| 152 | 152 | // Connect the callback to the touch signal on the background |
| 153 | - mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch ); | |
| 153 | + mBackground.TouchSignal().Connect( this, &BubbleEffectExample::OnTouch ); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| ... | ... | @@ -205,24 +205,22 @@ private: |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // Callback function of the touch signal on the background |
| 208 | - bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event) | |
| 208 | + bool OnTouch(Dali::Actor actor, const Dali::TouchData& event) | |
| 209 | 209 | { |
| 210 | - const TouchPoint &point = event.GetPoint(0); | |
| 211 | - switch(point.state) | |
| 210 | + switch( event.GetState( 0 ) ) | |
| 212 | 211 | { |
| 213 | - case TouchPoint::Down: | |
| 212 | + case PointState::DOWN: | |
| 214 | 213 | { |
| 215 | - mCurrentTouchPosition = point.screen; | |
| 216 | - mEmitPosition = point.screen; | |
| 214 | + mCurrentTouchPosition = mEmitPosition = event.GetScreenPosition( 0 ); | |
| 217 | 215 | mTimerForBubbleEmission.Start(); |
| 218 | 216 | mNonMovementCount = 0; |
| 219 | 217 | |
| 220 | 218 | break; |
| 221 | 219 | } |
| 222 | - case TouchPoint::Motion: | |
| 220 | + case PointState::MOTION: | |
| 223 | 221 | { |
| 224 | - Vector2 displacement = point.screen - mCurrentTouchPosition; | |
| 225 | - mCurrentTouchPosition = point.screen; | |
| 222 | + Vector2 displacement = event.GetScreenPosition( 0 ) - mCurrentTouchPosition; | |
| 223 | + mCurrentTouchPosition = event.GetScreenPosition( 0 ); | |
| 226 | 224 | //emit multiple bubbles along the moving direction when the finger moves quickly |
| 227 | 225 | float step = std::min(5.f, displacement.Length()); |
| 228 | 226 | for( float i=0.25f; i<step; i=i+1.f) |
| ... | ... | @@ -231,9 +229,9 @@ private: |
| 231 | 229 | } |
| 232 | 230 | break; |
| 233 | 231 | } |
| 234 | - case TouchPoint::Up: | |
| 235 | - case TouchPoint::Leave: | |
| 236 | - case TouchPoint::Interrupted: | |
| 232 | + case PointState::UP: | |
| 233 | + case PointState::LEAVE: | |
| 234 | + case PointState::INTERRUPTED: | |
| 237 | 235 | { |
| 238 | 236 | mTimerForBubbleEmission.Stop(); |
| 239 | 237 | mEmitAnimation.Play(); |
| ... | ... | @@ -241,8 +239,7 @@ private: |
| 241 | 239 | mAnimateComponentCount = 0; |
| 242 | 240 | break; |
| 243 | 241 | } |
| 244 | - case TouchPoint::Stationary: | |
| 245 | - case TouchPoint::Last: | |
| 242 | + case PointState::STATIONARY: | |
| 246 | 243 | default: |
| 247 | 244 | { |
| 248 | 245 | break; | ... | ... |
examples/buttons/buttons-example.cpp
| ... | ... | @@ -108,7 +108,6 @@ class ButtonsController: public ConnectionTracker |
| 108 | 108 | contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 109 | 109 | contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| 110 | 110 | contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) ); |
| 111 | -// contentTable.TouchedSignal().Connect( this, &ButtonsController::OnTouchEvent ); | |
| 112 | 111 | |
| 113 | 112 | for( unsigned int i = 0; i < contentTable.GetRows(); ++i ) |
| 114 | 113 | { |
| ... | ... | @@ -480,35 +479,7 @@ class ButtonsController: public ConnectionTracker |
| 480 | 479 | return true; |
| 481 | 480 | } |
| 482 | 481 | |
| 483 | - bool OnTouchEvent( Actor actor, const TouchEvent& event ) | |
| 484 | - { | |
| 485 | - if( 1u == event.GetPointCount() ) | |
| 486 | - { | |
| 487 | - const TouchPoint::State state = event.GetPoint(0u).state; | |
| 488 | - | |
| 489 | - // Clamp to integer values; this is to reduce flicking due to pixel misalignment | |
| 490 | - const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) ); | |
| 491 | - | |
| 492 | - if( TouchPoint::Down == state ) | |
| 493 | - { | |
| 494 | - mLastPoint = localPoint; | |
| 495 | - mAnimation = Animation::New( 0.25f ); | |
| 496 | - } | |
| 497 | - else if( TouchPoint::Motion == state ) | |
| 498 | - { | |
| 499 | - if( mAnimation ) | |
| 500 | - { | |
| 501 | - mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR ); | |
| 502 | - mAnimation.Play(); | |
| 503 | - mLastPoint = localPoint; | |
| 504 | - } | |
| 505 | - } | |
| 506 | - } | |
| 507 | - | |
| 508 | - return true; | |
| 509 | - } | |
| 510 | - | |
| 511 | - private: | |
| 482 | +private: | |
| 512 | 483 | |
| 513 | 484 | Application& mApplication; |
| 514 | 485 | Toolkit::Control mView; ///< The View instance. | ... | ... |
examples/compressed-texture-formats/compressed-texture-formats-example.cpp
| ... | ... | @@ -108,10 +108,10 @@ public: |
| 108 | 108 | stage.Add( table ); |
| 109 | 109 | |
| 110 | 110 | // Respond to a click anywhere on the stage |
| 111 | - stage.GetRootLayer().TouchedSignal().Connect( this, &CompressedTextureFormatsController::OnTouch ); | |
| 111 | + stage.GetRootLayer().TouchSignal().Connect( this, &CompressedTextureFormatsController::OnTouch ); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 114 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 115 | 115 | { |
| 116 | 116 | // quit the application |
| 117 | 117 | mApplication.Quit(); | ... | ... |
examples/hello-world/hello-world-example.cpp
| ... | ... | @@ -51,10 +51,10 @@ public: |
| 51 | 51 | stage.Add( textLabel ); |
| 52 | 52 | |
| 53 | 53 | // Respond to a click anywhere on the stage |
| 54 | - stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch ); | |
| 54 | + stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch ); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 57 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 58 | 58 | { |
| 59 | 59 | // quit the application |
| 60 | 60 | mApplication.Quit(); | ... | ... |
examples/homescreen-benchmark/homescreen-benchmark.cpp
| ... | ... | @@ -438,10 +438,10 @@ public: |
| 438 | 438 | stage.Add(mScrollParent); |
| 439 | 439 | |
| 440 | 440 | // Respond to a click anywhere on the stage |
| 441 | - stage.GetRootLayer().TouchedSignal().Connect( this, &HomescreenBenchmark::OnTouch ); | |
| 441 | + stage.GetRootLayer().TouchSignal().Connect( this, &HomescreenBenchmark::OnTouch ); | |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 444 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 445 | 445 | { |
| 446 | 446 | // quit the application |
| 447 | 447 | mApplication.Quit(); | ... | ... |
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
| ... | ... | @@ -295,7 +295,7 @@ public: |
| 295 | 295 | imagePrevious.SetOpacity( 0.6f ); |
| 296 | 296 | controlsLayer.Add( imagePrevious ); |
| 297 | 297 | imagePrevious.SetName( PREVIOUS_BUTTON_ID ); |
| 298 | - imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); | |
| 298 | + imagePrevious.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); | |
| 299 | 299 | |
| 300 | 300 | // Next image button: |
| 301 | 301 | Toolkit::ImageView imageNext = Toolkit::ImageView::New( playImage ); |
| ... | ... | @@ -305,7 +305,7 @@ public: |
| 305 | 305 | imageNext.SetOpacity( 0.6f ); |
| 306 | 306 | controlsLayer.Add( imageNext ); |
| 307 | 307 | imageNext.SetName( NEXT_BUTTON_ID ); |
| 308 | - imageNext.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); | |
| 308 | + imageNext.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched ); | |
| 309 | 309 | |
| 310 | 310 | // Buttons to popup selectors for fitting and sampling modes: |
| 311 | 311 | |
| ... | ... | @@ -535,14 +535,13 @@ public: |
| 535 | 535 | } |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | - bool OnControlTouched( Actor actor, const TouchEvent& event ) | |
| 538 | + bool OnControlTouched( Actor actor, const TouchData& event ) | |
| 539 | 539 | { |
| 540 | 540 | if(event.GetPointCount() > 0) |
| 541 | 541 | { |
| 542 | - const TouchPoint& point = event.GetPoint(0); | |
| 543 | - switch(point.state) | |
| 542 | + switch( event.GetState( 0 ) ) | |
| 544 | 543 | { |
| 545 | - case TouchPoint::Up: | |
| 544 | + case PointState::UP: | |
| 546 | 545 | { |
| 547 | 546 | const std::string & name = actor.GetName(); |
| 548 | 547 | if( name == NEXT_BUTTON_ID ) | ... | ... |
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
| ... | ... | @@ -461,7 +461,7 @@ public: |
| 461 | 461 | ImageView image = CreateImageView( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode ); |
| 462 | 462 | image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) ); |
| 463 | 463 | image.SetSize( imageSize ); |
| 464 | - image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage ); | |
| 464 | + image.TouchSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage ); | |
| 465 | 465 | mFittingModes[image.GetId()] = fittingMode; |
| 466 | 466 | mResourceUrls[image.GetId()] = imageSource.configuration.path; |
| 467 | 467 | mSizes[image.GetId()] = imageSize; |
| ... | ... | @@ -477,12 +477,11 @@ public: |
| 477 | 477 | * @param[in] actor The actor touched |
| 478 | 478 | * @param[in] event The TouchEvent. |
| 479 | 479 | */ |
| 480 | - bool OnTouchImage( Actor actor, const TouchEvent& event ) | |
| 480 | + bool OnTouchImage( Actor actor, const TouchData& event ) | |
| 481 | 481 | { |
| 482 | - if( (event.points.size() > 0) && (!mScrolling) ) | |
| 482 | + if( ( event.GetPointCount() > 0 ) && ( !mScrolling ) ) | |
| 483 | 483 | { |
| 484 | - TouchPoint point = event.points[0]; | |
| 485 | - if(point.state == TouchPoint::Up) | |
| 484 | + if( event.GetState( 0 ) == PointState::UP ) | |
| 486 | 485 | { |
| 487 | 486 | // Spin the image a few times: |
| 488 | 487 | Animation animation = Animation::New(SPIN_DURATION); | ... | ... |
examples/image-view-pixel-area/image-view-pixel-area-example.cpp
| ... | ... | @@ -74,13 +74,12 @@ private: |
| 74 | 74 | animation.Play(); |
| 75 | 75 | |
| 76 | 76 | // Respond to a click anywhere on the stage |
| 77 | - stage.GetRootLayer().TouchedSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch ); | |
| 77 | + stage.GetRootLayer().TouchSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch ); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 80 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 81 | 81 | { |
| 82 | - const TouchPoint &point = touch.GetPoint(0); | |
| 83 | - if(point.state == TouchPoint::Down) | |
| 82 | + if( touch.GetState( 0 ) == PointState::DOWN ) | |
| 84 | 83 | { |
| 85 | 84 | mIndex++; |
| 86 | 85 | for( int i=0; i<3;i++ ) | ... | ... |
examples/logging/logging-example.cpp
| ... | ... | @@ -174,7 +174,6 @@ class LoggingController: public ConnectionTracker |
| 174 | 174 | contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 175 | 175 | contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| 176 | 176 | contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) ); |
| 177 | -// contentTable.TouchedSignal().Connect( this, &LoggingController::OnTouchEvent ); | |
| 178 | 177 | |
| 179 | 178 | for( unsigned int i = 0; i < contentTable.GetRows(); ++i ) |
| 180 | 179 | { |
| ... | ... | @@ -639,35 +638,7 @@ class LoggingController: public ConnectionTracker |
| 639 | 638 | return true; |
| 640 | 639 | } |
| 641 | 640 | |
| 642 | - bool OnTouchEvent( Actor actor, const TouchEvent& event ) | |
| 643 | - { | |
| 644 | - if( 1u == event.GetPointCount() ) | |
| 645 | - { | |
| 646 | - const TouchPoint::State state = event.GetPoint(0u).state; | |
| 647 | - | |
| 648 | - // Clamp to integer values; this is to reduce flicking due to pixel misalignment | |
| 649 | - const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) ); | |
| 650 | - | |
| 651 | - if( TouchPoint::Down == state ) | |
| 652 | - { | |
| 653 | - mLastPoint = localPoint; | |
| 654 | - mAnimation = Animation::New( 0.25f ); | |
| 655 | - } | |
| 656 | - else if( TouchPoint::Motion == state ) | |
| 657 | - { | |
| 658 | - if( mAnimation ) | |
| 659 | - { | |
| 660 | - mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR ); | |
| 661 | - mAnimation.Play(); | |
| 662 | - mLastPoint = localPoint; | |
| 663 | - } | |
| 664 | - } | |
| 665 | - } | |
| 666 | - | |
| 667 | - return true; | |
| 668 | - } | |
| 669 | - | |
| 670 | - private: | |
| 641 | +private: | |
| 671 | 642 | |
| 672 | 643 | struct LoggerState |
| 673 | 644 | { | ... | ... |
examples/magnifier/magnifier-example.cpp
| ... | ... | @@ -213,7 +213,7 @@ public: |
| 213 | 213 | APPLICATION_TITLE ); |
| 214 | 214 | |
| 215 | 215 | mContent.SetLeaveRequired(true); |
| 216 | - mContent.TouchedSignal().Connect( this, &ExampleController::OnTouched ); | |
| 216 | + mContent.TouchSignal().Connect( this, &ExampleController::OnTouched ); | |
| 217 | 217 | |
| 218 | 218 | // Create magnifier (controlled by human touch) |
| 219 | 219 | Layer overlay = Layer::New(); |
| ... | ... | @@ -300,33 +300,32 @@ public: |
| 300 | 300 | * @param[in] actor The actor that received the touch |
| 301 | 301 | * @param[in] event The touch-event information |
| 302 | 302 | */ |
| 303 | - bool OnTouched( Actor actor, const TouchEvent& event ) | |
| 303 | + bool OnTouched( Actor actor, const TouchData& event ) | |
| 304 | 304 | { |
| 305 | 305 | if(event.GetPointCount() > 0) |
| 306 | 306 | { |
| 307 | - const TouchPoint& point = event.GetPoint(0); | |
| 308 | - switch(point.state) | |
| 307 | + switch( event.GetState( 0 ) ) | |
| 309 | 308 | { |
| 310 | - case TouchPoint::Down: | |
| 311 | - case TouchPoint::Motion: | |
| 309 | + case PointState::DOWN: | |
| 310 | + case PointState::MOTION: | |
| 312 | 311 | { |
| 313 | 312 | ShowMagnifier(); |
| 314 | 313 | break; |
| 315 | 314 | } |
| 316 | - case TouchPoint::Up: | |
| 317 | - case TouchPoint::Leave: | |
| 318 | - case TouchPoint::Interrupted: | |
| 315 | + case PointState::UP: | |
| 316 | + case PointState::LEAVE: | |
| 317 | + case PointState::INTERRUPTED: | |
| 319 | 318 | { |
| 320 | 319 | HideMagnifier(); |
| 321 | 320 | break; |
| 322 | 321 | } |
| 323 | - default: | |
| 322 | + case PointState::STATIONARY: | |
| 324 | 323 | { |
| 325 | 324 | break; |
| 326 | 325 | } |
| 327 | 326 | } // end switch |
| 328 | 327 | |
| 329 | - Vector3 touchPoint(point.screen); | |
| 328 | + Vector3 touchPoint( event.GetScreenPosition( 0 ) ); | |
| 330 | 329 | |
| 331 | 330 | SetMagnifierPosition(touchPoint - mStageSize * 0.5f); |
| 332 | 331 | } | ... | ... |
examples/mesh-sorting/mesh-sorting-example.cpp
| ... | ... | @@ -187,7 +187,7 @@ public: |
| 187 | 187 | |
| 188 | 188 | meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES); |
| 189 | 189 | |
| 190 | - meshActor.TouchedSignal().Connect(this, &ExampleController::OnTouched); | |
| 190 | + meshActor.TouchSignal().Connect(this, &ExampleController::OnTouched); | |
| 191 | 191 | std::ostringstream oss; |
| 192 | 192 | oss << "Mesh Actor " << i; |
| 193 | 193 | meshActor.SetName(oss.str()); |
| ... | ... | @@ -196,7 +196,7 @@ public: |
| 196 | 196 | |
| 197 | 197 | mActors[NUMBER_OF_SAMPLES-2].GetRendererAt(0).SetTextures( firstTextureSet ); |
| 198 | 198 | |
| 199 | - stage.GetRootLayer().TouchedSignal().Connect(this, &ExampleController::OnStageTouched); | |
| 199 | + stage.GetRootLayer().TouchSignal().Connect(this, &ExampleController::OnStageTouched); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | void PrintDepths() |
| ... | ... | @@ -227,9 +227,9 @@ public: |
| 227 | 227 | printf("\n"); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - bool OnTouched( Actor actor, const TouchEvent& event ) | |
| 230 | + bool OnTouched( Actor actor, const TouchData& event ) | |
| 231 | 231 | { |
| 232 | - if( event.GetPoint(0).state == TouchPoint::Finished ) | |
| 232 | + if( event.GetState( 0 ) == PointState::UP ) | |
| 233 | 233 | { |
| 234 | 234 | int index = actor.GetProperty<int>(actor.GetPropertyIndex("index")); |
| 235 | 235 | |
| ... | ... | @@ -244,9 +244,9 @@ public: |
| 244 | 244 | return true; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - bool OnStageTouched( Actor rootLayer, const TouchEvent& event ) | |
| 247 | + bool OnStageTouched( Actor rootLayer, const TouchData& event ) | |
| 248 | 248 | { |
| 249 | - if( event.GetPoint(0).state == TouchPoint::Finished ) | |
| 249 | + if( event.GetState( 0 ) == PointState::UP ) | |
| 250 | 250 | { |
| 251 | 251 | switch( mZMode ) |
| 252 | 252 | { | ... | ... |
examples/metaball-explosion/metaball-explosion-example.cpp
| ... | ... | @@ -192,7 +192,7 @@ public: |
| 192 | 192 | /** |
| 193 | 193 | * Touch event function |
| 194 | 194 | */ |
| 195 | - bool OnTouch( Actor actor, const TouchEvent& touch ); | |
| 195 | + bool OnTouch( Actor actor, const TouchData& touch ); | |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | 198 | * Key event function |
| ... | ... | @@ -344,7 +344,7 @@ void MetaballExplosionController::Create( Application& app ) |
| 344 | 344 | mTimerDispersion.TickSignal().Connect(this, &MetaballExplosionController::OnTimerDispersionTick); |
| 345 | 345 | |
| 346 | 346 | // Connect the callback to the touch signal on the mesh actor |
| 347 | - stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballExplosionController::OnTouch ); | |
| 347 | + stage.GetRootLayer().TouchSignal().Connect( this, &MetaballExplosionController::OnTouch ); | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | Geometry MetaballExplosionController::CreateGeometry() |
| ... | ... | @@ -681,31 +681,32 @@ void MetaballExplosionController::SetPositionToMetaballs(Vector2 & metaballCente |
| 681 | 681 | mCompositionActor.SetProperty( mPositionIndex, metaballCenter ); |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | -bool MetaballExplosionController::OnTouch( Actor actor, const TouchEvent& touch ) | |
| 684 | +bool MetaballExplosionController::OnTouch( Actor actor, const TouchData& touch ) | |
| 685 | 685 | { |
| 686 | - const TouchPoint &point = touch.GetPoint(0); | |
| 687 | 686 | float aspectR = mScreenSize.y / mScreenSize.x; |
| 688 | 687 | |
| 689 | - switch( point.state ) | |
| 688 | + switch( touch.GetState( 0 ) ) | |
| 690 | 689 | { |
| 691 | - case TouchPoint::Down: | |
| 690 | + case PointState::DOWN: | |
| 692 | 691 | { |
| 693 | 692 | ResetMetaballs(true); |
| 694 | 693 | |
| 695 | - Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 694 | + const Vector2 screen = touch.GetScreenPosition( 0 ); | |
| 695 | + Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 696 | 696 | SetPositionToMetaballs(metaballCenter); |
| 697 | 697 | |
| 698 | 698 | break; |
| 699 | 699 | } |
| 700 | - case TouchPoint::Motion: | |
| 700 | + case PointState::MOTION: | |
| 701 | 701 | { |
| 702 | - Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 702 | + const Vector2 screen = touch.GetScreenPosition( 0 ); | |
| 703 | + Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 703 | 704 | SetPositionToMetaballs(metaballCenter); |
| 704 | 705 | break; |
| 705 | 706 | } |
| 706 | - case TouchPoint::Up: | |
| 707 | - case TouchPoint::Leave: | |
| 708 | - case TouchPoint::Interrupted: | |
| 707 | + case PointState::UP: | |
| 708 | + case PointState::LEAVE: | |
| 709 | + case PointState::INTERRUPTED: | |
| 709 | 710 | { |
| 710 | 711 | mTimerDispersion.Start(); |
| 711 | 712 | break; | ... | ... |
examples/metaball-refrac/metaball-refrac-example.cpp
| ... | ... | @@ -164,7 +164,7 @@ public: |
| 164 | 164 | ~MetaballRefracController(); |
| 165 | 165 | |
| 166 | 166 | void Create( Application& app ); |
| 167 | - bool OnTouch( Actor actor, const TouchEvent& touch ); | |
| 167 | + bool OnTouch( Actor actor, const TouchData& touch ); | |
| 168 | 168 | void OnKeyEvent(const KeyEvent& event); |
| 169 | 169 | |
| 170 | 170 | void SetGravity(const Vector2 & gravity); |
| ... | ... | @@ -283,7 +283,7 @@ void MetaballRefracController::Create( Application& app ) |
| 283 | 283 | CreateAnimations(); |
| 284 | 284 | |
| 285 | 285 | // Connect the callback to the touch signal on the mesh actor |
| 286 | - stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballRefracController::OnTouch ); | |
| 286 | + stage.GetRootLayer().TouchSignal().Connect( this, &MetaballRefracController::OnTouch ); | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /** |
| ... | ... | @@ -759,13 +759,12 @@ void MetaballRefracController::SetPositionToMetaballs(Vector2 & metaballCenter) |
| 759 | 759 | } |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | -bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch ) | |
| 762 | +bool MetaballRefracController::OnTouch( Actor actor, const TouchData& touch ) | |
| 763 | 763 | { |
| 764 | - const TouchPoint &point = touch.GetPoint(0); | |
| 765 | 764 | float aspectR = mScreenSize.y / mScreenSize.x; |
| 766 | - switch(point.state) | |
| 765 | + switch( touch.GetState( 0 ) ) | |
| 767 | 766 | { |
| 768 | - case TouchPoint::Down: | |
| 767 | + case PointState::DOWN: | |
| 769 | 768 | { |
| 770 | 769 | StopAfterClickAnimations(); |
| 771 | 770 | for (int i = 0 ; i < METABALL_NUMBER ; i++) |
| ... | ... | @@ -776,17 +775,18 @@ bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch ) |
| 776 | 775 | //We draw with the refraction-composition shader |
| 777 | 776 | mRendererRefraction.SetTextures(mTextureSetRefraction); |
| 778 | 777 | mRendererRefraction.SetShader( mShaderRefraction ); |
| 779 | - mCurrentTouchPosition = point.screen; | |
| 778 | + mCurrentTouchPosition = touch.GetScreenPosition( 0 ); | |
| 780 | 779 | |
| 781 | 780 | //we use the click position for the metaballs |
| 782 | - Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 781 | + Vector2 metaballCenter = Vector2((mCurrentTouchPosition.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - mCurrentTouchPosition.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 783 | 782 | SetPositionToMetaballs(metaballCenter); |
| 784 | 783 | break; |
| 785 | 784 | } |
| 786 | - case TouchPoint::Motion: | |
| 785 | + case PointState::MOTION: | |
| 787 | 786 | { |
| 788 | - Vector2 displacement = point.screen - mCurrentTouchPosition; | |
| 789 | - mCurrentTouchPosition = point.screen; | |
| 787 | + Vector2 screen = touch.GetScreenPosition( 0 ); | |
| 788 | + Vector2 displacement = screen - mCurrentTouchPosition; | |
| 789 | + mCurrentTouchPosition = screen; | |
| 790 | 790 | |
| 791 | 791 | mMetaballPosVariationTo.x += (displacement.x / mScreenSize.x) * 2.2; |
| 792 | 792 | mMetaballPosVariationTo.y += (- displacement.y / mScreenSize.y) * 2.2; |
| ... | ... | @@ -803,13 +803,13 @@ bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch ) |
| 803 | 803 | mPositionVarAnimation[1].Play(); |
| 804 | 804 | |
| 805 | 805 | //we use the click position for the metaballs |
| 806 | - Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 806 | + Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0; | |
| 807 | 807 | SetPositionToMetaballs(metaballCenter); |
| 808 | 808 | break; |
| 809 | 809 | } |
| 810 | - case TouchPoint::Up: | |
| 811 | - case TouchPoint::Leave: | |
| 812 | - case TouchPoint::Interrupted: | |
| 810 | + case PointState::UP: | |
| 811 | + case PointState::LEAVE: | |
| 812 | + case PointState::INTERRUPTED: | |
| 813 | 813 | { |
| 814 | 814 | //Stop click animations |
| 815 | 815 | StopClickAnimations(); | ... | ... |
examples/perf-scroll/perf-scroll.cpp
| ... | ... | @@ -284,7 +284,7 @@ public: |
| 284 | 284 | mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f ); |
| 285 | 285 | |
| 286 | 286 | // Respond to a click anywhere on the stage |
| 287 | - stage.GetRootLayer().TouchedSignal().Connect( this, &PerfScroll::OnTouch ); | |
| 287 | + stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch ); | |
| 288 | 288 | |
| 289 | 289 | mParent = Actor::New(); |
| 290 | 290 | mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| ... | ... | @@ -302,7 +302,7 @@ public: |
| 302 | 302 | ShowAnimation(); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 305 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 306 | 306 | { |
| 307 | 307 | // quit the application |
| 308 | 308 | mApplication.Quit(); | ... | ... |
examples/refraction-effect/refraction-effect-example.cpp
| ... | ... | @@ -294,7 +294,7 @@ private: |
| 294 | 294 | mContent.Add( mMeshActor ); |
| 295 | 295 | |
| 296 | 296 | // Connect the callback to the touch signal on the mesh actor |
| 297 | - mContent.TouchedSignal().Connect( this, &RefractionEffectExample::OnTouch ); | |
| 297 | + mContent.TouchSignal().Connect( this, &RefractionEffectExample::OnTouch ); | |
| 298 | 298 | |
| 299 | 299 | // shader used when the finger is touching the screen. render refraction effect |
| 300 | 300 | mShaderRefraction = Shader::New( VERTEX_SHADER_REFRACTION, FRAGMENT_SHADER_REFRACTION ); |
| ... | ... | @@ -348,16 +348,15 @@ private: |
| 348 | 348 | return true; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - bool OnTouch( Actor actor , const TouchEvent& event ) | |
| 351 | + bool OnTouch( Actor actor, const TouchData& event ) | |
| 352 | 352 | { |
| 353 | - const TouchPoint &point = event.GetPoint(0); | |
| 354 | - switch(point.state) | |
| 353 | + switch( event.GetState( 0 ) ) | |
| 355 | 354 | { |
| 356 | - case TouchPoint::Down: | |
| 355 | + case PointState::DOWN: | |
| 357 | 356 | { |
| 358 | 357 | mRenderer.SetShader( mShaderRefraction ); |
| 359 | 358 | |
| 360 | - SetLightXYOffset( point.screen ); | |
| 359 | + SetLightXYOffset( event.GetScreenPosition( 0 ) ); | |
| 361 | 360 | |
| 362 | 361 | mLightAnimation.Play(); |
| 363 | 362 | |
| ... | ... | @@ -372,15 +371,15 @@ private: |
| 372 | 371 | |
| 373 | 372 | break; |
| 374 | 373 | } |
| 375 | - case TouchPoint::Motion: | |
| 374 | + case PointState::MOTION: | |
| 376 | 375 | { |
| 377 | 376 | // make the light position following the finger movement |
| 378 | - SetLightXYOffset( point.screen ); | |
| 377 | + SetLightXYOffset( event.GetScreenPosition( 0 ) ); | |
| 379 | 378 | break; |
| 380 | 379 | } |
| 381 | - case TouchPoint::Up: | |
| 382 | - case TouchPoint::Leave: | |
| 383 | - case TouchPoint::Interrupted: | |
| 380 | + case PointState::UP: | |
| 381 | + case PointState::LEAVE: | |
| 382 | + case PointState::INTERRUPTED: | |
| 384 | 383 | { |
| 385 | 384 | mLightAnimation.Pause(); |
| 386 | 385 | |
| ... | ... | @@ -394,9 +393,7 @@ private: |
| 394 | 393 | mStrenghAnimation.Play(); |
| 395 | 394 | break; |
| 396 | 395 | } |
| 397 | - case TouchPoint::Stationary: | |
| 398 | - case TouchPoint::Last: | |
| 399 | - default: | |
| 396 | + case PointState::STATIONARY: | |
| 400 | 397 | { |
| 401 | 398 | break; |
| 402 | 399 | } | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| ... | ... | @@ -459,7 +459,7 @@ private: |
| 459 | 459 | actor.SetParentOrigin(ParentOrigin::CENTER); |
| 460 | 460 | actor.SetAnchorPoint(AnchorPoint::CENTER); |
| 461 | 461 | |
| 462 | - actor.TouchedSignal().Connect( this, &ExampleController::OnTouchImage ); | |
| 462 | + actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage ); | |
| 463 | 463 | return actor; |
| 464 | 464 | } |
| 465 | 465 | |
| ... | ... | @@ -489,12 +489,11 @@ private: |
| 489 | 489 | * @param[in] actor The actor touched |
| 490 | 490 | * @param[in] event The TouchEvent. |
| 491 | 491 | */ |
| 492 | - bool OnTouchImage( Actor actor, const TouchEvent& event ) | |
| 492 | + bool OnTouchImage( Actor actor, const TouchData& event ) | |
| 493 | 493 | { |
| 494 | - if( (event.points.size() > 0) && (!mScrolling) ) | |
| 494 | + if( (event.GetPointCount() > 0) && (!mScrolling) ) | |
| 495 | 495 | { |
| 496 | - TouchPoint point = event.points[0]; | |
| 497 | - if(point.state == TouchPoint::Up) | |
| 496 | + if( event.GetState( 0 ) == PointState::UP ) | |
| 498 | 497 | { |
| 499 | 498 | // Spin the Image a few times. |
| 500 | 499 | Animation animation = Animation::New(SPIN_DURATION); | ... | ... |
examples/super-blur-bloom/super-blur-bloom-example.cpp
| ... | ... | @@ -130,17 +130,16 @@ private: |
| 130 | 130 | mBloomView.Add( mBloomActor ); |
| 131 | 131 | |
| 132 | 132 | // Connect the callback to the touch signal on the background |
| 133 | - mSuperBlurView.TouchedSignal().Connect( this, &BlurExample::OnTouch ); | |
| 134 | - mBloomView.TouchedSignal().Connect( this, &BlurExample::OnTouch ); | |
| 133 | + mSuperBlurView.TouchSignal().Connect( this, &BlurExample::OnTouch ); | |
| 134 | + mBloomView.TouchSignal().Connect( this, &BlurExample::OnTouch ); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // Callback function of the touch signal on the background |
| 138 | - bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event) | |
| 138 | + bool OnTouch(Dali::Actor actor, const Dali::TouchData& event) | |
| 139 | 139 | { |
| 140 | - const TouchPoint &point = event.GetPoint(0); | |
| 141 | - switch(point.state) | |
| 140 | + switch( event.GetState( 0 ) ) | |
| 142 | 141 | { |
| 143 | - case TouchPoint::Down: | |
| 142 | + case PointState::DOWN: | |
| 144 | 143 | { |
| 145 | 144 | if( mAnimation ) |
| 146 | 145 | { |
| ... | ... | @@ -159,9 +158,9 @@ private: |
| 159 | 158 | mAnimation.Play(); |
| 160 | 159 | break; |
| 161 | 160 | } |
| 162 | - case TouchPoint::Up: | |
| 163 | - case TouchPoint::Leave: | |
| 164 | - case TouchPoint::Interrupted: | |
| 161 | + case PointState::UP: | |
| 162 | + case PointState::LEAVE: | |
| 163 | + case PointState::INTERRUPTED: | |
| 165 | 164 | { |
| 166 | 165 | if( mAnimation ) |
| 167 | 166 | { |
| ... | ... | @@ -180,10 +179,8 @@ private: |
| 180 | 179 | mAnimation.Play(); |
| 181 | 180 | break; |
| 182 | 181 | } |
| 183 | - case TouchPoint::Motion: | |
| 184 | - case TouchPoint::Stationary: | |
| 185 | - case TouchPoint::Last: | |
| 186 | - default: | |
| 182 | + case PointState::MOTION: | |
| 183 | + case PointState::STATIONARY: | |
| 187 | 184 | { |
| 188 | 185 | break; |
| 189 | 186 | } | ... | ... |
examples/text-editor/text-editor-example.cpp
0 โ 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2016 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * @file simple-text-editor-example.cpp | |
| 20 | + * @brief Very basic usage of TextEditor control | |
| 21 | + */ | |
| 22 | + | |
| 23 | +// EXTERNAL INCLUDES | |
| 24 | +#include <dali-toolkit/dali-toolkit.h> | |
| 25 | +#include <iostream> | |
| 26 | +#include <sstream> | |
| 27 | + | |
| 28 | +// INTERNAL INCLUDES | |
| 29 | +#include "shared/view.h" | |
| 30 | + | |
| 31 | +using namespace Dali; | |
| 32 | +using namespace Dali::Toolkit; | |
| 33 | + | |
| 34 | +namespace | |
| 35 | +{ | |
| 36 | + | |
| 37 | +const Vector4 BACKGROUND_COLOR( 0.04f, 0.345f, 0.392f, 1.0f ); ///< The background color. | |
| 38 | +const char* TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png"; ///< The tool-bar image. | |
| 39 | +const float TOOLBAR_BUTTON_PERCENTAGE = 0.1f; ///< The button's space width as a percentage of the toolbar's width. | |
| 40 | +const float TOOLBAR_TITLE_PERCENTAGE = 0.7f; ///< The title's width as a percentage of the toolbar's width. | |
| 41 | +const float TOOLBAR_HEIGHT_PERCENTAGE = 0.05f; ///< The toolbar's height as a percentage of the stage's height. | |
| 42 | +const float TOOLBAR_PADDING = 4.f; ///< The padding in pixels. | |
| 43 | +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. | |
| 44 | +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. | |
| 45 | +const Vector4 TEXT_EDITOR_BACKGROUND_COLOR( 1.f, 1.f, 1.f, 0.15f ); ///< The background color of the text editor. | |
| 46 | + | |
| 47 | +const Vector4 COLORS[] = { Color::RED, | |
| 48 | + Color::GREEN, | |
| 49 | + Color::BLUE, | |
| 50 | + Color::YELLOW, | |
| 51 | + Color::CYAN, | |
| 52 | + Color::MAGENTA, | |
| 53 | + Color::WHITE, | |
| 54 | + Color::BLACK }; | |
| 55 | +const unsigned int NUMBER_OF_COLORS = sizeof( COLORS ) / sizeof( Vector4 ); | |
| 56 | + | |
| 57 | +} // Unnamed namespace | |
| 58 | + | |
| 59 | +/** | |
| 60 | + * @brief The main class of the demo. | |
| 61 | + */ | |
| 62 | +class TextEditorExample : public ConnectionTracker | |
| 63 | +{ | |
| 64 | +public: | |
| 65 | + | |
| 66 | + TextEditorExample( Application& application ) | |
| 67 | + : mApplication( application ) | |
| 68 | + { | |
| 69 | + // Connect to the Application's Init signal | |
| 70 | + mApplication.InitSignal().Connect( this, &TextEditorExample::Create ); | |
| 71 | + } | |
| 72 | + | |
| 73 | + ~TextEditorExample() | |
| 74 | + { | |
| 75 | + // Nothing to do here. | |
| 76 | + } | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * One-time setup in response to Application InitSignal. | |
| 80 | + */ | |
| 81 | + void Create( Application& application ) | |
| 82 | + { | |
| 83 | + Stage stage = Stage::GetCurrent(); | |
| 84 | + | |
| 85 | + // Respond to key events | |
| 86 | + stage.KeyEventSignal().Connect(this, &TextEditorExample::OnKeyEvent); | |
| 87 | + | |
| 88 | + // Set a background color. | |
| 89 | + stage.SetBackgroundColor( BACKGROUND_COLOR ); | |
| 90 | + | |
| 91 | + // The stage size. | |
| 92 | + const Vector2 stageSize = stage.GetSize(); | |
| 93 | + | |
| 94 | + // Creates a default view with a default tool bar. | |
| 95 | + // The view is added to the stage. | |
| 96 | + | |
| 97 | + // Set the toolbar style | |
| 98 | + const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height; | |
| 99 | + const DemoHelper::ViewStyle viewStyle( TOOLBAR_BUTTON_PERCENTAGE, | |
| 100 | + TOOLBAR_TITLE_PERCENTAGE, | |
| 101 | + toolBarHeight, | |
| 102 | + TOOLBAR_PADDING ); | |
| 103 | + | |
| 104 | + Layer contents = DemoHelper::CreateView( mApplication, | |
| 105 | + mView, | |
| 106 | + mToolBar, | |
| 107 | + "", | |
| 108 | + TOOLBAR_IMAGE, | |
| 109 | + "", | |
| 110 | + viewStyle ); | |
| 111 | + | |
| 112 | + // Create a 'select color' button. | |
| 113 | + mColorButtonOption = Toolkit::PushButton::New(); | |
| 114 | + mColorButtonOption.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 115 | + mColorButtonOption.SetSizeModeFactor( BUTTON_PERCENTAGE ); | |
| 116 | + | |
| 117 | + mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, Color::BLACK ); | |
| 118 | + mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, Color::BLACK ); | |
| 119 | + | |
| 120 | + mColorButtonOption.ClickedSignal().Connect( this, &TextEditorExample::OnChangeColorButtonClicked ); | |
| 121 | + | |
| 122 | + mToolBar.AddControl( mColorButtonOption, viewStyle.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); | |
| 123 | + | |
| 124 | + // Create the text editor. | |
| 125 | + mEditor = TextEditor::New(); | |
| 126 | + mEditor.SetParentOrigin( ParentOrigin::TOP_CENTER ); | |
| 127 | + mEditor.SetAnchorPoint( AnchorPoint::TOP_CENTER ); | |
| 128 | + mEditor.SetPosition( 0.f, toolBarHeight, 0.f ); | |
| 129 | + mEditor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 130 | + mEditor.SetSizeModeFactor( TEXT_EDITOR_RELATIVE_SIZE ); | |
| 131 | + | |
| 132 | + mEditor.SetBackgroundColor( TEXT_EDITOR_BACKGROUND_COLOR ); | |
| 133 | + | |
| 134 | + mEditor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK ); | |
| 135 | + mEditor.SetProperty( TextEditor::Property::TEXT, | |
| 136 | + "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n" | |
| 137 | + "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n" | |
| 138 | + "Ne nec nulla regione albucius, mea doctus delenit ad!\n" | |
| 139 | + "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n" | |
| 140 | + "Quidam corpora at duo. An eos possim scripserit?\n\n" | |
| 141 | + "Aลฅqui dicant sฤnลฅenลฅรญae aล vel!\n" | |
| 142 | + "Vis viris mรฉdiocrem elaboraret รฉt, verear civibus moderatius ex duo!\n" | |
| 143 | + "รn veri laborฤ iลtฤgrรฉ quรณ, mei aฤ poลกลกit lobortis, mei prompลฅa ฤonsลฅitลฏลฅรณ eลฏ.\n" | |
| 144 | + "Aliquip sanctลฏs delicรกta quรญ ฤรก, et natum aliquam est?\n" | |
| 145 | + "Asลกรบm sapฤret usu ลฏลฅ.\n" | |
| 146 | + "Sรญลฅ ut apeiriรกn laboramรบลก percipitur, sลฏas haลum รญn รฉos?\n" ); | |
| 147 | + | |
| 148 | + contents.Add( mEditor ); | |
| 149 | + } | |
| 150 | + | |
| 151 | + void CreateButtonContainer() | |
| 152 | + { | |
| 153 | + mButtonContainer = Toolkit::TableView::New( NUMBER_OF_COLORS, 1u ); | |
| 154 | + mButtonContainer.SetParentOrigin( ParentOrigin::TOP_LEFT ); | |
| 155 | + mButtonContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 156 | + | |
| 157 | + Stage stage = Stage::GetCurrent(); | |
| 158 | + const Vector2 stageSize = stage.GetSize(); | |
| 159 | + const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height; | |
| 160 | + mButtonContainer.SetPosition( TOOLBAR_PADDING, 2.f * TOOLBAR_PADDING + toolBarHeight, 0.f ); | |
| 161 | + | |
| 162 | + mButtonContainer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 163 | + | |
| 164 | + const Vector3 containerPercentage( 0.8f * TOOLBAR_BUTTON_PERCENTAGE, NUMBER_OF_COLORS, 1.f ); | |
| 165 | + mButtonContainer.SetSizeModeFactor( containerPercentage ); | |
| 166 | + | |
| 167 | + Layer toolbarLayer = mToolBar.GetLayer(); | |
| 168 | + toolbarLayer.Add( mButtonContainer ); | |
| 169 | + | |
| 170 | + const Vector3 buttonPercentage( 1.f, 0.8f / static_cast<float>( NUMBER_OF_COLORS ), 1.f ); | |
| 171 | + for( unsigned int index = 0u; index < NUMBER_OF_COLORS; ++index ) | |
| 172 | + { | |
| 173 | + Toolkit::PushButton button = Toolkit::PushButton::New(); | |
| 174 | + button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 175 | + button.SetSizeModeFactor( buttonPercentage ); | |
| 176 | + | |
| 177 | + std::ostringstream s; | |
| 178 | + s << "color" << index; | |
| 179 | + button.SetName( s.str() ); | |
| 180 | + | |
| 181 | + button.SetProperty( Button::Property::UNSELECTED_COLOR, COLORS[index] ); | |
| 182 | + button.SetProperty( Button::Property::SELECTED_COLOR, COLORS[index] ); | |
| 183 | + | |
| 184 | + button.ClickedSignal().Connect( this, &TextEditorExample::OnColorButtonClicked ); | |
| 185 | + | |
| 186 | + mButtonContainer.Add( button ); | |
| 187 | + } | |
| 188 | + } | |
| 189 | + | |
| 190 | + void OnKeyEvent( const KeyEvent& event ) | |
| 191 | + { | |
| 192 | + if( event.state == KeyEvent::Down ) | |
| 193 | + { | |
| 194 | + if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | |
| 195 | + { | |
| 196 | + // Exit application when click back or escape. | |
| 197 | + mApplication.Quit(); | |
| 198 | + } | |
| 199 | + } | |
| 200 | + } | |
| 201 | + | |
| 202 | + bool OnChangeColorButtonClicked( Button button ) | |
| 203 | + { | |
| 204 | + if( !mButtonContainer ) | |
| 205 | + { | |
| 206 | + CreateButtonContainer(); | |
| 207 | + } | |
| 208 | + | |
| 209 | + mButtonContainer.SetVisible( true ); | |
| 210 | + mButtonContainer.SetSensitive( true ); | |
| 211 | + return true; | |
| 212 | + } | |
| 213 | + | |
| 214 | + bool OnColorButtonClicked( Button button ) | |
| 215 | + { | |
| 216 | + const std::string& name = button.GetName(); | |
| 217 | + | |
| 218 | + if( "color" == name.substr( 0u, 5u ) ) | |
| 219 | + { | |
| 220 | + const unsigned int index = strtoul( name.substr( 5u, 1u ).c_str(), NULL, 10u ); | |
| 221 | + mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, COLORS[index] ); | |
| 222 | + } | |
| 223 | + | |
| 224 | + mButtonContainer.SetVisible( false ); | |
| 225 | + mButtonContainer.SetSensitive( false ); | |
| 226 | + | |
| 227 | + return true; | |
| 228 | + } | |
| 229 | + | |
| 230 | +private: | |
| 231 | + | |
| 232 | + Application& mApplication; | |
| 233 | + | |
| 234 | + Toolkit::Control mView; | |
| 235 | + Toolkit::ToolBar mToolBar; | |
| 236 | + Toolkit::TextEditor mEditor; | |
| 237 | + Toolkit::PushButton mColorButtonOption; | |
| 238 | + Toolkit::TableView mButtonContainer; | |
| 239 | +}; | |
| 240 | + | |
| 241 | +void RunTest( Application& application ) | |
| 242 | +{ | |
| 243 | + TextEditorExample test( application ); | |
| 244 | + | |
| 245 | + application.MainLoop(); | |
| 246 | +} | |
| 247 | + | |
| 248 | +/** Entry point for Linux & Tizen applications */ | |
| 249 | +int main( int argc, char **argv ) | |
| 250 | +{ | |
| 251 | + // DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet. | |
| 252 | + Application application = Application::New( &argc, &argv ); | |
| 253 | + | |
| 254 | + RunTest( application ); | |
| 255 | + | |
| 256 | + return 0; | |
| 257 | +} | ... | ... |
examples/text-field/text-field-example.cpp
| ... | ... | @@ -136,7 +136,7 @@ public: |
| 136 | 136 | popup.SetSize( width, 0.0f ); |
| 137 | 137 | popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT ); |
| 138 | 138 | popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT ); |
| 139 | - popup.TouchedSignal().Connect( this, &TextFieldExample::OnPopupTouched ); | |
| 139 | + popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched ); | |
| 140 | 140 | |
| 141 | 141 | return popup; |
| 142 | 142 | } |
| ... | ... | @@ -159,15 +159,14 @@ public: |
| 159 | 159 | mField.Reset(); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - bool OnPopupTouched( Actor actor, const TouchEvent& event ) | |
| 162 | + bool OnPopupTouched( Actor actor, const TouchData& event ) | |
| 163 | 163 | { |
| 164 | 164 | // End edit mode for TextField if parent Popup touched. |
| 165 | 165 | if(event.GetPointCount() > 0) |
| 166 | 166 | { |
| 167 | - const TouchPoint& point = event.GetPoint(0); | |
| 168 | - switch(point.state) | |
| 167 | + switch( event.GetState( 0 ) ) | |
| 169 | 168 | { |
| 170 | - case TouchPoint::Down: | |
| 169 | + case PointState::DOWN: | |
| 171 | 170 | { |
| 172 | 171 | // Update the folder text and lose focus for Key events |
| 173 | 172 | if( mButton && mField ) | ... | ... |
examples/text-label-emojis/text-label-emojis.cpp
| ... | ... | @@ -63,7 +63,7 @@ public: |
| 63 | 63 | mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 64 | 64 | mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| 65 | 65 | mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 66 | - mTableView.TouchedSignal().Connect( this, &EmojiExample::OnTouchEvent ); | |
| 66 | + mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch ); | |
| 67 | 67 | stage.Add( mTableView ); |
| 68 | 68 | |
| 69 | 69 | for( unsigned int index = 0u; index < NUMBER_OF_EMOJIS; ++index ) |
| ... | ... | @@ -81,21 +81,21 @@ public: |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - bool OnTouchEvent( Actor actor, const TouchEvent& event ) | |
| 84 | + bool OnTouch( Actor actor, const TouchData& event ) | |
| 85 | 85 | { |
| 86 | 86 | if( 1u == event.GetPointCount() ) |
| 87 | 87 | { |
| 88 | - const TouchPoint::State state = event.GetPoint(0u).state; | |
| 88 | + const PointState::Type state = event.GetState( 0 ); | |
| 89 | 89 | |
| 90 | 90 | // Clamp to integer values; this is to reduce flicking due to pixel misalignment |
| 91 | - const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) ); | |
| 91 | + const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) ); | |
| 92 | 92 | |
| 93 | - if( TouchPoint::Down == state ) | |
| 93 | + if( PointState::DOWN == state ) | |
| 94 | 94 | { |
| 95 | 95 | mLastPoint = localPoint; |
| 96 | 96 | mAnimation = Animation::New( 0.25f ); |
| 97 | 97 | } |
| 98 | - else if( TouchPoint::Motion == state ) | |
| 98 | + else if( PointState::MOTION == state ) | |
| 99 | 99 | { |
| 100 | 100 | if( mAnimation ) |
| 101 | 101 | { | ... | ... |
examples/text-label-multi-language/text-label-multi-language-example.cpp
| ... | ... | @@ -66,7 +66,7 @@ public: |
| 66 | 66 | mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 67 | 67 | mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| 68 | 68 | mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 69 | - mTableView.TouchedSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouchEvent ); | |
| 69 | + mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch ); | |
| 70 | 70 | stage.Add( mTableView ); |
| 71 | 71 | |
| 72 | 72 | for( unsigned int index = 0u; index < NUMBER_OF_LANGUAGES; ++index ) |
| ... | ... | @@ -84,21 +84,21 @@ public: |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - bool OnTouchEvent( Actor actor, const TouchEvent& event ) | |
| 87 | + bool OnTouch( Actor actor, const TouchData& event ) | |
| 88 | 88 | { |
| 89 | 89 | if( 1u == event.GetPointCount() ) |
| 90 | 90 | { |
| 91 | - const TouchPoint::State state = event.GetPoint(0u).state; | |
| 91 | + const PointState::Type state = event.GetState( 0 ); | |
| 92 | 92 | |
| 93 | 93 | // Clamp to integer values; this is to reduce flicking due to pixel misalignment |
| 94 | - const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) ); | |
| 94 | + const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) ); | |
| 95 | 95 | |
| 96 | - if( TouchPoint::Down == state ) | |
| 96 | + if( PointState::DOWN == state ) | |
| 97 | 97 | { |
| 98 | 98 | mLastPoint = localPoint; |
| 99 | 99 | mAnimation = Animation::New( 0.25f ); |
| 100 | 100 | } |
| 101 | - else if( TouchPoint::Motion == state ) | |
| 101 | + else if( PointState::MOTION == state ) | |
| 102 | 102 | { |
| 103 | 103 | if( mAnimation ) |
| 104 | 104 | { | ... | ... |
examples/tilt/tilt-example.cpp
| ... | ... | @@ -56,7 +56,7 @@ public: |
| 56 | 56 | stage.Add( mTextLabel ); |
| 57 | 57 | |
| 58 | 58 | // Respond to a click anywhere on the stage |
| 59 | - stage.GetRootLayer().TouchedSignal().Connect( this, &TiltController::OnTouch ); | |
| 59 | + stage.GetRootLayer().TouchSignal().Connect( this, &TiltController::OnTouch ); | |
| 60 | 60 | |
| 61 | 61 | CreateSensor(); |
| 62 | 62 | } |
| ... | ... | @@ -71,7 +71,7 @@ public: |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 74 | + bool OnTouch( Actor actor, const TouchData& touch ) | |
| 75 | 75 | { |
| 76 | 76 | // quit the application |
| 77 | 77 | mApplication.Quit(); | ... | ... |
packaging/com.samsung.dali-demo.spec
shared/dali-demo-strings.h
| ... | ... | @@ -88,6 +88,7 @@ extern "C" |
| 88 | 88 | #define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts" |
| 89 | 89 | #define DALI_DEMO_STR_TITLE_EMOJI_TEXT "Emoji Text" |
| 90 | 90 | #define DALI_DEMO_STR_TITLE_TEXT_SCROLLING "Text Scrolling" |
| 91 | +#define DALI_DEMO_STR_TITLE_TEXT_EDITOR "Text Editor" | |
| 91 | 92 | #define DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE "Negotiate Size" |
| 92 | 93 | #define DALI_DEMO_STR_TITLE_POPUP "Popup" |
| 93 | 94 | #define DALI_DEMO_STR_TITLE_BUTTONS "Buttons" | ... | ... |
shared/view.h
| ... | ... | @@ -85,7 +85,7 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, |
| 85 | 85 | toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); |
| 86 | 86 | toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); |
| 87 | 87 | |
| 88 | - // Add the tool bar to the too bar layer. | |
| 88 | + // Add the tool bar to the tool bar layer. | |
| 89 | 89 | toolBarLayer.Add( toolBar ); |
| 90 | 90 | |
| 91 | 91 | // Tool bar text. | ... | ... |