projects
/
platform
/
core
/
uifw
/
dali-demo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(Touch) Remove Usage of TouchEvent
[platform/core/uifw/dali-demo.git]
/
emscripten-examples
/
dali-toy.js
diff --git
a/emscripten-examples/dali-toy.js
b/emscripten-examples/dali-toy.js
index
2fa343e
..
326e1c1
100644
(file)
--- 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" +
"\n" +
"function onTouched(actor, e) {\n" +
" for(var i = 0; i < e.points.length; i++) {\n" +
- " if(e.points[i].state === \"D
own
\") {\n" +
+ " if(e.points[i].state === \"D
OWN
\") {\n" +
" console.log(e);\n" +
" animation.play();\n" +
" return;\n" +
" console.log(e);\n" +
" animation.play();\n" +
" return;\n" +
@@
-1591,7
+1591,7
@@
var javascriptSources =
" }\n" +
"}\n" +
"\n" +
" }\n" +
"}\n" +
"\n" +
- "actor2.connect(\"touch
ed
\", onTouched);\n" +
+ "actor2.connect(\"touch\", onTouched);\n" +
"\n" +
"\n" +
""
"\n" +
"\n" +
""
@@
-3843,7
+3843,7
@@
function path() {
}
// conditional animation
}
// conditional animation
-// when("myimage", condition("touch
ed
", "inside", 0, 100),
+// when("myimage", condition("touch", "inside", 0, 100),
//
function condition(propertyName, conditionType, arg0, arg1)
{
//
function condition(propertyName, conditionType, arg0, arg1)
{
@@
-4108,7
+4108,7
@@
function _makeCallback(args) {
// then("play", "myanim"),
// thenOnChild("myimage", "child", "hide"),
// animate("name"),
// then("play", "myanim"),
// thenOnChild("myimage", "child", "hide"),
// animate("name"),
-// animateTo("position",
+// animateTo("position",
// )
function doNow(args) {
"use strict";
// )
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";
function _makeSensibleTouched(func, state) { // dali giving all mouse events on touched signal --- is this correct?? @todo
"use strict";
- return function(actor, touch
Event
){
+ return function(actor, touch){
var doit = false;
var doit = false;
- for(var i = 0; i < touch
Event
.points.length; i++) {
- if(touch
Event
.points[i].state === state) {
+ for(var i = 0; i < touch.points.length; i++) {
+ if(touch.points[i].state === state) {
doit = true;
break;
}
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);
// if( signalName === "touchedDown" ) { // fix as touched signal is really "mouseState"?
// f = _makeSensibleTouchedDown(func);
-// signalName = "touch
ed
";
+// signalName = "touch";
// }
// for(var ai = 0; ai < actors.length; ai++) {
// }
// 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("touch
ed
", "inside", 0, 100),
+// when("myimage", condition("touch", "inside", 0, 100),
// or
// or
-// when("myimage", "touch
ed
",
+// when("myimage", "touch",
// call(myfunction),
// call(myfunction, arg1),
// and("animation-ends"),
// 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 = _makeCallback(arguments);
if( signal === "touchedDown" ) { // fix as touched signal is really "mouseState"?
- f = _makeSensibleTouched(f, "D
own
");
- signal = "touch
ed
";
+ f = _makeSensibleTouched(f, "D
OWN
");
+ signal = "touch";
}
if( signal === "touchedUp" ) { // fix as touched signal is really "mouseState"?
}
if( signal === "touchedUp" ) { // fix as touched signal is really "mouseState"?
- f = _makeSensibleTouched(f, "U
p
");
- signal = "touch
ed
";
+ f = _makeSensibleTouched(f, "U
P
");
+ signal = "touch";
}
if( signal === "touchedMotion" ) { // fix as touched signal is really "mouseState"?
}
if( signal === "touchedMotion" ) { // fix as touched signal is really "mouseState"?
- f = _makeSensibleTouched(f, "M
otion
");
- signal = "touch
ed
";
+ f = _makeSensibleTouched(f, "M
OTION
");
+ signal = "touch";
}
if( signal === "touchedLeave" ) { // fix as touched signal is really "mouseState"?
}
if( signal === "touchedLeave" ) { // fix as touched signal is really "mouseState"?
- f = _makeSensibleTouched(f, "L
eave
");
- signal = "touch
ed
";
+ f = _makeSensibleTouched(f, "L
EAVE
");
+ signal = "touch";
}
if( signal === "touchedStationary" ) { // fix as touched signal is really "mouseState"?
}
if( signal === "touchedStationary" ) { // fix as touched signal is really "mouseState"?
- f = _makeSensibleTouched(f, "S
tationary
");
- signal = "touch
ed
";
+ f = _makeSensibleTouched(f, "S
TATIONARY
");
+ signal = "touch";
}
if( signal === "touchedInterrupted" ) { // fix as touched signal is really "mouseState"?
}
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++) {
}
for(ai = 0; ai < actors.length; ai++) {
@@
-4253,9
+4249,9
@@
function when() {
}
}
}
}
-// when("myimage", condition("touch
ed
", "inside", 0, 100),
+// when("myimage", condition("touch", "inside", 0, 100),
// or
// or
-// when("myimage", "touch
ed
",
+// when("myimage", "touch",
// ***
// dali.ActorWrapper.prototype.connect = function(signalName, callback) {
// if(d.action === "set") {
// ***
// dali.ActorWrapper.prototype.connect = function(signalName, callback) {
// if(d.action === "set") {
@@
-4399,9
+4395,9
@@
function when() {
// )
// )
// )
// )
-// when("myimage", condition("touch
ed
", "inside", 0, 100),
+// when("myimage", condition("touch", "inside", 0, 100),
// or
// or
-// when("myimage", "touch
ed
",
+// when("myimage", "touch",
// call(myfunction),
// call(myfunction, arg1),
// and("animation-ends"),
// 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();
dali.stage.add(actor);
var hello = new dali.Actor();
- // hello.connect("touch
ed
", onTouched);
+ // hello.connect("touch", onTouched);
hello.text = "hello";
hello.name = hello.text;
actor.add(hello);
var hellochild = new dali.Actor();
hello.text = "hello";
hello.name = hello.text;
actor.add(hello);
var hellochild = new dali.Actor();
- // hellochild.connect("touch
ed
", onTouched);
+ // hellochild.connect("touch", onTouched);
hellochild.text = "hello-child";
hellochild.name = hellochild.text;
hello.add(hellochild);
var hellochild2 = new dali.Actor();
hellochild.text = "hello-child";
hellochild.name = hellochild.text;
hello.add(hellochild);
var hellochild2 = new dali.Actor();
- // hellochild2.connect("touch
ed
", onTouched);
+ // hellochild2.connect("touch", onTouched);
hellochild2.text = "hello-child2";
hellochild2.name = hellochild2.text;
hello.add(hellochild2);
var hellochildchild = new dali.Actor();
hellochild2.text = "hello-child2";
hellochild2.name = hellochild2.text;
hello.add(hellochild2);
var hellochildchild = new dali.Actor();
- // hellochildchild.connect("touch
ed
", onTouched);
+ // hellochildchild.connect("touch", onTouched);
hellochildchild.text = "hello-child-child1";
hellochildchild.name = "hello-child-child1";
hellochildchild.name = hellochildchild.text;
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);
assert(root.findChildByName("none") === null);
- // actor.connect("touch
ed
", onTouched);
+ // actor.connect("touch", onTouched);
// var inserted = new dali.TextActor(); // TextActor no more RIP
// inserted.parentOrigin = [0.5, 0.5, 0.5];
// var inserted = new dali.TextActor(); // TextActor no more RIP
// inserted.parentOrigin = [0.5, 0.5, 0.5];