From: Adeel Kazmi Date: Thu, 7 Jul 2016 09:01:53 +0000 (+0100) Subject: (Touch) Remove Usage of TouchEvent X-Git-Tag: dali_1.1.42~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=0ebe1f65f192d14cdffb12285862948ba0b9af7f (Touch) Remove Usage of TouchEvent Change-Id: Ie09429854a2dd9cd8aa9e4bc506f41cd41374f7f --- diff --git a/demo/dali-table-view.h b/demo/dali-table-view.h index d4b0946..749000b 100644 --- a/demo/dali-table-view.h +++ b/demo/dali-table-view.h @@ -159,7 +159,7 @@ private: // Application callbacks & implementation * Signal emitted when any tile has been pressed * * @param[in] actor The Actor representing this tile. - * @param[in] event The TouchEvent + * @param[in] event The Touch information. * * @return Consume flag */ @@ -220,7 +220,7 @@ private: // Application callbacks & implementation * (other than those touches consumed by OnTilePressed) * * @param[in] actor The Actor touched. - * @param[in] event The TouchEvent + * @param[in] event The Touch information. * * @return Consume flag */ diff --git a/emscripten-examples/dali-toy.js b/emscripten-examples/dali-toy.js index 2fa343e..326e1c1 100644 --- a/emscripten-examples/dali-toy.js +++ b/emscripten-examples/dali-toy.js @@ -1583,7 +1583,7 @@ var javascriptSources = "\n" + "function onTouched(actor, e) {\n" + " for(var i = 0; i < e.points.length; i++) {\n" + - " if(e.points[i].state === \"Down\") {\n" + + " if(e.points[i].state === \"DOWN\") {\n" + " console.log(e);\n" + " animation.play();\n" + " return;\n" + @@ -1591,7 +1591,7 @@ var javascriptSources = " }\n" + "}\n" + "\n" + - "actor2.connect(\"touched\", onTouched);\n" + + "actor2.connect(\"touch\", onTouched);\n" + "\n" + "\n" + "" @@ -3843,7 +3843,7 @@ function path() { } // conditional animation -// when("myimage", condition("touched", "inside", 0, 100), +// when("myimage", condition("touch", "inside", 0, 100), // function condition(propertyName, conditionType, arg0, arg1) { @@ -4108,7 +4108,7 @@ function _makeCallback(args) { // then("play", "myanim"), // thenOnChild("myimage", "child", "hide"), // animate("name"), -// animateTo("position", +// animateTo("position", // ) function doNow(args) { "use strict"; @@ -4121,10 +4121,10 @@ function doNow(args) { function _makeSensibleTouched(func, state) { // dali giving all mouse events on touched signal --- is this correct?? @todo "use strict"; - return function(actor, touchEvent){ + return function(actor, touch){ var doit = false; - for(var i = 0; i < touchEvent.points.length; i++) { - if(touchEvent.points[i].state === state) { + for(var i = 0; i < touch.points.length; i++) { + if(touch.points[i].state === state) { doit = true; break; } @@ -4142,7 +4142,7 @@ function _makeSensibleTouched(func, state) { // dali giving all mouse events on // if( signalName === "touchedDown" ) { // fix as touched signal is really "mouseState"? // f = _makeSensibleTouchedDown(func); -// signalName = "touched"; +// signalName = "touch"; // } // for(var ai = 0; ai < actors.length; ai++) { @@ -4152,9 +4152,9 @@ function _makeSensibleTouched(func, state) { // dali giving all mouse events on // } -// when("myimage", condition("touched", "inside", 0, 100), +// when("myimage", condition("touch", "inside", 0, 100), // or -// when("myimage", "touched", +// when("myimage", "touch", // call(myfunction), // call(myfunction, arg1), // and("animation-ends"), @@ -4206,32 +4206,28 @@ function when() { f = _makeCallback(arguments); if( signal === "touchedDown" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Down"); - signal = "touched"; + f = _makeSensibleTouched(f, "DOWN"); + signal = "touch"; } if( signal === "touchedUp" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Up"); - signal = "touched"; + f = _makeSensibleTouched(f, "UP"); + signal = "touch"; } if( signal === "touchedMotion" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Motion"); - signal = "touched"; + f = _makeSensibleTouched(f, "MOTION"); + signal = "touch"; } if( signal === "touchedLeave" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Leave"); - signal = "touched"; + f = _makeSensibleTouched(f, "LEAVE"); + signal = "touch"; } if( signal === "touchedStationary" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Stationary"); - signal = "touched"; + f = _makeSensibleTouched(f, "STATIONARY"); + signal = "touch"; } if( signal === "touchedInterrupted" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Interrupted"); - signal = "touched"; - } - if( signal === "touchedLast" ) { // fix as touched signal is really "mouseState"? - f = _makeSensibleTouched(f, "Last"); - signal = "touched"; + f = _makeSensibleTouched(f, "INTERRUPTED"); + signal = "touch"; } for(ai = 0; ai < actors.length; ai++) { @@ -4253,9 +4249,9 @@ function when() { } } -// when("myimage", condition("touched", "inside", 0, 100), +// when("myimage", condition("touch", "inside", 0, 100), // or -// when("myimage", "touched", +// when("myimage", "touch", // *** // dali.ActorWrapper.prototype.connect = function(signalName, callback) { // if(d.action === "set") { @@ -4399,9 +4395,9 @@ function when() { // ) // ) -// when("myimage", condition("touched", "inside", 0, 100), +// when("myimage", condition("touch", "inside", 0, 100), // or -// when("myimage", "touched", +// when("myimage", "touch", // call(myfunction), // call(myfunction, arg1), // and("animation-ends"), @@ -4690,25 +4686,25 @@ Test.prototype.hierarchy = function() { dali.stage.add(actor); var hello = new dali.Actor(); - // hello.connect("touched", onTouched); + // hello.connect("touch", onTouched); hello.text = "hello"; hello.name = hello.text; actor.add(hello); var hellochild = new dali.Actor(); - // hellochild.connect("touched", onTouched); + // hellochild.connect("touch", onTouched); hellochild.text = "hello-child"; hellochild.name = hellochild.text; hello.add(hellochild); var hellochild2 = new dali.Actor(); - // hellochild2.connect("touched", onTouched); + // hellochild2.connect("touch", onTouched); hellochild2.text = "hello-child2"; hellochild2.name = hellochild2.text; hello.add(hellochild2); var hellochildchild = new dali.Actor(); - // hellochildchild.connect("touched", onTouched); + // hellochildchild.connect("touch", onTouched); hellochildchild.text = "hello-child-child1"; hellochildchild.name = "hello-child-child1"; hellochildchild.name = hellochildchild.text; @@ -4747,7 +4743,7 @@ Test.prototype.hierarchy = function() { assert(root.findChildByName("none") === null); - // actor.connect("touched", onTouched); + // actor.connect("touch", onTouched); // var inserted = new dali.TextActor(); // TextActor no more RIP // inserted.parentOrigin = [0.5, 0.5, 0.5]; diff --git a/examples/gradients/gradients-example.cpp b/examples/gradients/gradients-example.cpp index 2e59ab8..654422e 100644 --- a/examples/gradients/gradients-example.cpp +++ b/examples/gradients/gradients-example.cpp @@ -143,13 +143,6 @@ public: return true; } - bool OnTouch( Actor actor, const TouchEvent& touch ) - { - // quit the application - mApplication.Quit(); - return true; - } - void OnKeyEvent(const KeyEvent& event) { if(event.state == KeyEvent::Down) 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 51482d4..302686c 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 @@ -475,7 +475,7 @@ public: /** * Upon Touching an image (Release), change its scaling mode and make it spin, provided we're not scrolling. * @param[in] actor The actor touched - * @param[in] event The TouchEvent. + * @param[in] event The Touch information. */ bool OnTouchImage( Actor actor, const TouchData& event ) { diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index 8929d68..20bff95 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -494,7 +494,7 @@ private: * Upon Touching an image (Release), make it spin * (provided we're not scrolling). * @param[in] actor The actor touched - * @param[in] event The TouchEvent. + * @param[in] event The touch information. */ bool OnTouchImage( Actor actor, const TouchData& event ) {