added native math object

This commit is contained in:
Pavel Talanov
2012-02-06 14:19:58 +04:00
parent e9a8c3b0d9
commit d836ea04cb
3 changed files with 31 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
package js;
import js.annotations.native
native
val Math = object {
native
fun random() : Double = 0.0;
fun abs(value : Double) = 0.0
fun acos(value : Double) = 0.0
fun asin(value : Double) = 0.0
fun atan(value : Double) = 0.0
fun atan2(x : Double, y : Double) = 0.0
fun cos(value : Double) = 0.0
fun sin(value : Double) = 0.0
fun exp(value : Double) = 0.0
fun max(vararg values : Double) = 0.0
fun min(vararg values : Double) = 0.0
fun sqrt(value : Double) = 0.0
fun tan(value : Double) = 0.0
fun log(value : Double) = 0.0
fun pow(base : Double, exp : Double) = 0.0
fun round(value : Double) = 0.0
fun floor(value : Double) = 0.0
fun ceil(value : Double) = 0.0
}
+3 -4
View File
@@ -51,12 +51,11 @@ class TextMetrics() {
val width : Int = 0
}
/*custom helpers*/
native
fun getContext() : Context = Context();
native
fun random() : Double = 0.0
//native
//fun random() : Double = 0.0
native
fun getCanvasWidth() : Double = 0.0
native
@@ -31,8 +31,9 @@ public abstract class Config {
PATH_TO_JS_LIB_SRC + "\\core\\javautil.kt",
PATH_TO_JS_LIB_SRC + "\\core\\javalang.kt",
PATH_TO_JS_LIB_SRC + "\\core\\core.kt",
PATH_TO_JS_LIB_SRC + "\\raphael\\raphael.kt",
PATH_TO_JS_LIB_SRC + "\\core\\math.kt",
PATH_TO_JS_LIB_SRC + "\\core\\json.kt",
PATH_TO_JS_LIB_SRC + "\\raphael\\raphael.kt",
PATH_TO_JS_LIB_SRC + "\\html5\\core.kt"
);