added html5 api files
This commit is contained in:
@@ -0,0 +1,63 @@
|
|||||||
|
package html5
|
||||||
|
|
||||||
|
import js.annotations.Native
|
||||||
|
|
||||||
|
Native
|
||||||
|
class Context() {
|
||||||
|
fun save() {}
|
||||||
|
fun restore() {}
|
||||||
|
|
||||||
|
fun scale(x : Double, y : Double) {}
|
||||||
|
fun rotate(angle : Double) {}
|
||||||
|
fun translate(x : Double, y : Double) {}
|
||||||
|
|
||||||
|
fun fillRect(x : Double, y : Double, w : Double, h : Double) {}
|
||||||
|
fun strokeRect(x : Double, y : Double, w : Double, h : Double) {}
|
||||||
|
|
||||||
|
var globalAlpha : Double = 1.0;
|
||||||
|
var strokeStyle : String = ""
|
||||||
|
var fillStyle : String = ""
|
||||||
|
var lineWidth : Double = 1.0
|
||||||
|
var shadowOffsetX : Double = 0.0
|
||||||
|
var shadowOffsetY : Double = 0.0
|
||||||
|
var shadowBlur : Double = 0.0
|
||||||
|
var shadowColor : String = ""
|
||||||
|
var font : String = ""
|
||||||
|
|
||||||
|
fun beginPath() {}
|
||||||
|
fun moveTo(x : Double, y : Double) {}
|
||||||
|
fun closePath() {}
|
||||||
|
|
||||||
|
fun lineTo(x : Double, y : Double) {}
|
||||||
|
fun quadraticCurveTo(cpx : Double, cpy : Double, x : Double, y : Double) {}
|
||||||
|
fun bezierCurveTo(cp1x : Double, cp1y : Double, cp2x : Double, cp2y : Double, x : Double, y : Double) {}
|
||||||
|
fun arcTo(x1 : Double, y1 : Double, x2 : Double, y2 : Double, radius : Double) {}
|
||||||
|
fun arc(x : Double, y : Double, radius : Double, startAngle : Double, endAngle : Double, anticlockwise : Boolean= false) {}
|
||||||
|
|
||||||
|
fun rect(x : Double, y : Double, w : Double, h : Double) {}
|
||||||
|
fun fill() {}
|
||||||
|
fun stroke() {}
|
||||||
|
|
||||||
|
fun fillText(text : String, x : Double, y : Double) {}
|
||||||
|
fun fillText(text : String, x : Double, y : Double, maxWidth : Double) {}
|
||||||
|
fun strokeText(text : String, x : Double, y : Double) {}
|
||||||
|
fun strokeText(text : String, x : Double, y : Double, maxWidth : Double) {}
|
||||||
|
|
||||||
|
fun measureText(text : String) : TextMetrics = TextMetrics();
|
||||||
|
}
|
||||||
|
|
||||||
|
Native
|
||||||
|
class TextMetrics() {
|
||||||
|
val width : Int = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Native
|
||||||
|
fun getContext() : Context = Context();
|
||||||
|
|
||||||
|
Native
|
||||||
|
fun random() : Double = 0.0
|
||||||
|
|
||||||
|
Native
|
||||||
|
fun getCanvasWidth() : Double = 0.0
|
||||||
|
Native
|
||||||
|
fun getCanvasHeight() : Double = 0.0
|
||||||
@@ -13,7 +13,7 @@ import java.util.Map;
|
|||||||
* @author Pavel Talanov
|
* @author Pavel Talanov
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//TODO: change using guava builders
|
//TODO: refactor using guava builders
|
||||||
public final class OperatorTable {
|
public final class OperatorTable {
|
||||||
|
|
||||||
private static final Map<JetToken, JsBinaryOperator> binaryOperatorsMap = new HashMap<JetToken, JsBinaryOperator>();
|
private static final Map<JetToken, JsBinaryOperator> binaryOperatorsMap = new HashMap<JetToken, JsBinaryOperator>();
|
||||||
|
|||||||
@@ -460,6 +460,10 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Kotlin.collectionsMax = function(col, comp) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
Kotlin.StringBuilder = Kotlin.Class.create(
|
Kotlin.StringBuilder = Kotlin.Class.create(
|
||||||
{
|
{
|
||||||
initialize:function () {
|
initialize:function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user