From cf717f8cb7c643fb64513d7ac21c6765e6401f45 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Thu, 14 Nov 2013 16:30:00 +0400 Subject: [PATCH] JS backend: minor fixes in k2js stdlib. --- js/js.libraries/src/core/domEventsCode.kt | 2 +- js/js.libraries/src/core/htmlDom.kt | 962 +++++++++++----------- js/js.libraries/src/core/kotlin.kt | 12 +- js/js.libraries/src/core/string.kt | 6 +- js/js.libraries/src/html5/canvas.kt | 154 ++-- js/js.libraries/src/jquery/common.kt | 81 +- 6 files changed, 614 insertions(+), 603 deletions(-) diff --git a/js/js.libraries/src/core/domEventsCode.kt b/js/js.libraries/src/core/domEventsCode.kt index 4fc9a9bba5d..edc18cfb02f 100644 --- a/js/js.libraries/src/core/domEventsCode.kt +++ b/js/js.libraries/src/core/domEventsCode.kt @@ -11,5 +11,5 @@ import org.w3c.dom.views.* */ public trait EventListener { - public fun handleEvent(arg1: Event?): Unit = js.noImpl + public fun handleEvent(arg1: Event?): Unit } diff --git a/js/js.libraries/src/core/htmlDom.kt b/js/js.libraries/src/core/htmlDom.kt index 8c9c7166d79..72b66ffb35e 100644 --- a/js/js.libraries/src/core/htmlDom.kt +++ b/js/js.libraries/src/core/htmlDom.kt @@ -15,69 +15,69 @@ public native trait Image : HTMLImageElement { } public native trait Navigator { - public native var userAgent: String = js.noImpl - public native var product: String = js.noImpl - public native var appVersion: String = js.noImpl - public native var appName: String = js.noImpl - public native var appCodeName: String = js.noImpl - public native var language: String = js.noImpl - public native var mimeTypes: Array = js.noImpl - public native var platform: Array = js.noImpl - public native var plugins: String = js.noImpl - public native fun taintEnabled(): Boolean = js.noImpl - public native fun javaEnabled(): Boolean = js.noImpl - public native fun preference(prefName: String, prefValue: String): String = js.noImpl - public native fun preference(prefName: String): String = js.noImpl + public native var userAgent: String + public native var product: String + public native var appVersion: String + public native var appName: String + public native var appCodeName: String + public native var language: String + public native var mimeTypes: Array + public native var platform: Array + public native var plugins: String + public native fun taintEnabled(): Boolean + public native fun javaEnabled(): Boolean + public native fun preference(prefName: String, prefValue: String): String + public native fun preference(prefName: String): String } public native trait Screen { - public native var width: Double = js.noImpl - public native var height: Double = js.noImpl - public native var availHeight: Double = js.noImpl - public native var availWidth: Double = js.noImpl - public native var pixelDepth: Double = js.noImpl - public native var colorDepth: Double = js.noImpl + public native var width: Double + public native var height: Double + public native var availHeight: Double + public native var availWidth: Double + public native var pixelDepth: Double + public native var colorDepth: Double } public native trait Option { - public native var defaultSelected: Boolean = js.noImpl - public native var selected: Boolean = js.noImpl - public native var text: String = js.noImpl - public native var value: String = js.noImpl + public native var defaultSelected: Boolean + public native var selected: Boolean + public native var text: String + public native var value: String } public native trait Location { - public native var href: String = js.noImpl - public native var hash: String = js.noImpl - public native var port: String = js.noImpl - public native var host: String = js.noImpl - public native var hostname: String = js.noImpl - public native var pathname: String = js.noImpl - public native var protocol: String = js.noImpl - public native var search: String = js.noImpl - public native var target: String = js.noImpl - public native fun reload(): Unit = js.noImpl - public native fun replace(url: String): Unit = js.noImpl + public native var href: String + public native var hash: String + public native var port: String + public native var host: String + public native var hostname: String + public native var pathname: String + public native var protocol: String + public native var search: String + public native var target: String + public native fun reload(): Unit + public native fun replace(url: String): Unit } public native trait Event { - public native var data: Array = js.noImpl - public native var height: Double = js.noImpl - public native var screenX: Double = js.noImpl - public native var clientX: Double = js.noImpl - public native var pageX: Double = js.noImpl - public native var screenY: Double = js.noImpl - public native var clientY: Double = js.noImpl - public native var pageY: Double = js.noImpl - public native var width: Double = js.noImpl - public native var modifiers: Double = js.noImpl - public native var keyCode: Double = js.noImpl - public native var `type`: String = js.noImpl - public native var which: Any = js.noImpl - public native var altKey: Boolean = js.noImpl - public native var ctrlKey: Boolean = js.noImpl - public native var shiftKey: Boolean = js.noImpl - public native var button: Boolean = js.noImpl + public native var data: Array + public native var height: Double + public native var screenX: Double + public native var clientX: Double + public native var pageX: Double + public native var screenY: Double + public native var clientY: Double + public native var pageY: Double + public native var width: Double + public native var modifiers: Double + public native var keyCode: Double + public native var `type`: String + public native var which: Any + public native var altKey: Boolean + public native var ctrlKey: Boolean + public native var shiftKey: Boolean + public native var button: Boolean } public native trait Selection { @@ -85,621 +85,621 @@ public native trait Selection { } public native trait CSSRule { - public native var selectorText: String = js.noImpl + public native var selectorText: String } public native trait Stylesheet { } public native trait History { - public native fun back(): Unit = js.noImpl - public native fun forward(): Unit = js.noImpl - public native fun go(count: Number): Unit = js.noImpl + public native fun back(): Unit + public native fun forward(): Unit + public native fun go(count: Number): Unit } public native trait Console { - public native fun log(message: Any): Unit = js.noImpl + public native fun log(message: Any): Unit } public native trait Window { - public native val document: HTMLDocument = js.noImpl - public native val event: Event = js.noImpl - public native val navigator: Navigator = js.noImpl - public native val screen: Screen = js.noImpl - public native val location: Location = js.noImpl - public native var frameElement: Any = js.noImpl - public native var opener: Window = js.noImpl - public native var window: Window = js.noImpl - public native var parent: Window = js.noImpl - public native var top: Window = js.noImpl - public native var self: Any = js.noImpl - public native var frames: Array = js.noImpl - public native var innerHeight: Double = js.noImpl - public native var innerWidth: Double = js.noImpl - public native var outerHeight: Double = js.noImpl - public native var outerWidth: Double = js.noImpl - public native var scrollX: Double = js.noImpl - public native var scrollY: Double = js.noImpl - public native var pageXOffset: Double = js.noImpl - public native var pageYOffset: Double = js.noImpl - public native var scrollMaxX: Double = js.noImpl - public native var scrollMaxY: Double = js.noImpl - public native var status: String = js.noImpl - public native var defaultStatus: String = js.noImpl - public native var toolbar: Any = js.noImpl - public native var menubar: Any = js.noImpl - public native var scrollbars: Any = js.noImpl - public native var directories: Any = js.noImpl - public native var history: History = js.noImpl - public native fun open(strUrl: String, strWindowName: String, strWindowFeatures: String): Window? = js.noImpl - public native fun open(): Window? = js.noImpl - public native fun open(strUrl: String): Window? = js.noImpl - public native fun open(strUrl: String, strWindowName: String): Window? = js.noImpl - public native fun print(): Unit = js.noImpl - public native fun clearInterval(intervalId: Number): Unit = js.noImpl - public native fun clearTimeout(intervalId: Number): Unit = js.noImpl - public native fun setInterval(vCode: () -> Unit, iMillis: Number): Long = js.noImpl - public native fun setInterval(vCode: String, iMillis: Number): Long = js.noImpl - public native fun setTimeout(vCode: () -> Unit, iMillis: Number): Long = js.noImpl - public native fun setTimeout(vCode: String, iMillis: Number): Long = js.noImpl - public native fun scrollTo(x: Number, y: Number): Unit = js.noImpl - public native fun scrollBy(xDelta: Number, yDelta: Number): Unit = js.noImpl - public native fun moveTo(x: Number, y: Number): Unit = js.noImpl - public native fun moveBy(xDelta: Number, yDelta: Number): Unit = js.noImpl - public native fun resizeTo(width: Number, height: Number): Unit = js.noImpl - public native fun resizeBy(widthDelta: Number, heightDelta: Number): Unit = js.noImpl - public native var onload: () -> Unit = js.noImpl - public native var onunload: () -> Unit = js.noImpl + public native val document: HTMLDocument + public native val event: Event + public native val navigator: Navigator + public native val screen: Screen + public native val location: Location + public native var frameElement: Any + public native var opener: Window + public native var window: Window + public native var parent: Window + public native var top: Window + public native var self: Any + public native var frames: Array + public native var innerHeight: Double + public native var innerWidth: Double + public native var outerHeight: Double + public native var outerWidth: Double + public native var scrollX: Double + public native var scrollY: Double + public native var pageXOffset: Double + public native var pageYOffset: Double + public native var scrollMaxX: Double + public native var scrollMaxY: Double + public native var status: String + public native var defaultStatus: String + public native var toolbar: Any + public native var menubar: Any + public native var scrollbars: Any + public native var directories: Any + public native var history: History + public native fun open(strUrl: String, strWindowName: String, strWindowFeatures: String): Window? + public native fun open(): Window? + public native fun open(strUrl: String): Window? + public native fun open(strUrl: String, strWindowName: String): Window? + public native fun print(): Unit + public native fun clearInterval(intervalId: Number): Unit + public native fun clearTimeout(intervalId: Number): Unit + public native fun setInterval(vCode: () -> Unit, iMillis: Number): Long + public native fun setInterval(vCode: String, iMillis: Number): Long + public native fun setTimeout(vCode: () -> Unit, iMillis: Number): Long + public native fun setTimeout(vCode: String, iMillis: Number): Long + public native fun scrollTo(x: Number, y: Number): Unit + public native fun scrollBy(xDelta: Number, yDelta: Number): Unit + public native fun moveTo(x: Number, y: Number): Unit + public native fun moveBy(xDelta: Number, yDelta: Number): Unit + public native fun resizeTo(width: Number, height: Number): Unit + public native fun resizeBy(widthDelta: Number, heightDelta: Number): Unit + public native var onload: () -> Unit + public native var onunload: () -> Unit } public native trait Global { - public native val window: Window = js.noImpl - public native fun escape(str: String): Unit = js.noImpl - public native fun escape(): Unit = js.noImpl - public native fun unescape(str: String): Unit = js.noImpl - public native fun unescape(): Unit = js.noImpl + public native val window: Window + public native fun escape(str: String): Unit + public native fun escape(): Unit + public native fun unescape(str: String): Unit + public native fun unescape(): Unit } public native trait HTMLCollection { - public native val length: Double = js.noImpl - public native fun item(index: Number): Node? = js.noImpl - public native fun namedItem(name: String): Node? = js.noImpl + public native val length: Double + public native fun item(index: Number): Node? + public native fun namedItem(name: String): Node? } public native trait HTMLOptionsCollection { - public native val length: Double = js.noImpl - public native fun item(index: Number): Node? = js.noImpl - public native fun namedItem(name: String): Node? = js.noImpl + public native val length: Double + public native fun item(index: Number): Node? + public native fun namedItem(name: String): Node? } public native trait HTMLDocument : Document { - public native var title: String = js.noImpl - public native val referrer: String = js.noImpl - public native val domain: String = js.noImpl - public native val URL: String = js.noImpl - public native var body: HTMLElement = js.noImpl - public native val images: HTMLCollection = js.noImpl - public native val applets: HTMLCollection = js.noImpl - public native val links: HTMLCollection = js.noImpl - public native val forms: HTMLCollection = js.noImpl - public native val anchors: HTMLCollection = js.noImpl - public native var cookie: HTMLCollection = js.noImpl - public native fun open(): Unit = js.noImpl - public native fun close(): Unit = js.noImpl - public native fun write(text: String): Unit = js.noImpl - public native fun writeln(text: String): Unit = js.noImpl - public native fun getElementsByName(elementName: String): NodeList = js.noImpl - public native var compatMode: String = js.noImpl - public native var onload: () -> Unit = js.noImpl - public native var onunload: () -> Unit = js.noImpl + public native var title: String + public native val referrer: String + public native val domain: String + public native val URL: String + public native var body: HTMLElement + public native val images: HTMLCollection + public native val applets: HTMLCollection + public native val links: HTMLCollection + public native val forms: HTMLCollection + public native val anchors: HTMLCollection + public native var cookie: HTMLCollection + public native fun open(): Unit + public native fun close(): Unit + public native fun write(text: String): Unit + public native fun writeln(text: String): Unit + public native fun getElementsByName(elementName: String): NodeList + public native var compatMode: String + public native var onload: () -> Unit + public native var onunload: () -> Unit } public native trait HTMLElement : Element { - public native var id: String = js.noImpl - public native var title: String = js.noImpl - public native var lang: String = js.noImpl - public native var dir: String = js.noImpl - public native var className: String = js.noImpl - public native var style: CSSStyleDeclaration = js.noImpl - public native var clientWidth: Double = js.noImpl - public native var clientHeight: Double = js.noImpl - public native var clientTop: Double = js.noImpl - public native var clientLeft: Double = js.noImpl - public native var innerHTML: String = js.noImpl - public native var offsetWidth: Double = js.noImpl - public native var offsetHeight: Double = js.noImpl - public native var offsetTop: Double = js.noImpl - public native var offsetLeft: Double = js.noImpl - public native var offsetParent: HTMLElement? = js.noImpl - public native var scrollWidth: Double = js.noImpl - public native var scrollHeight: Double = js.noImpl - public native var scrollTop: Double = js.noImpl - public native var scrollLeft: Double = js.noImpl - public native var stylesheet: Stylesheet = js.noImpl - public native var onblur: () -> Unit = js.noImpl - public native var onclick: () -> Unit = js.noImpl - public native var ondblclick: () -> Unit = js.noImpl - public native var onfocus: () -> Unit = js.noImpl - public native var onkeydown: () -> Unit = js.noImpl - public native var onkeyup: () -> Unit = js.noImpl - public native var onmouseup: () -> Unit = js.noImpl - public native var onmousedown: () -> Unit = js.noImpl - public native var onmouseout: () -> Unit = js.noImpl - public native var onmouseover: () -> Unit = js.noImpl - public native var onmousemove: () -> Unit = js.noImpl - public native var onresize: () -> Unit = js.noImpl + public native var id: String + public native var title: String + public native var lang: String + public native var dir: String + public native var className: String + public native var style: CSSStyleDeclaration + public native var clientWidth: Double + public native var clientHeight: Double + public native var clientTop: Double + public native var clientLeft: Double + public native var innerHTML: String + public native var offsetWidth: Double + public native var offsetHeight: Double + public native var offsetTop: Double + public native var offsetLeft: Double + public native var offsetParent: HTMLElement? + public native var scrollWidth: Double + public native var scrollHeight: Double + public native var scrollTop: Double + public native var scrollLeft: Double + public native var stylesheet: Stylesheet + public native var onblur: () -> Unit + public native var onclick: () -> Unit + public native var ondblclick: () -> Unit + public native var onfocus: () -> Unit + public native var onkeydown: () -> Unit + public native var onkeyup: () -> Unit + public native var onmouseup: () -> Unit + public native var onmousedown: () -> Unit + public native var onmouseout: () -> Unit + public native var onmouseover: () -> Unit + public native var onmousemove: () -> Unit + public native var onresize: () -> Unit } public native trait CSSStyleDeclaration { - public native var cssText: String = js.noImpl - public native var length: Double = js.noImpl - public native var parentRule: CSSRule = js.noImpl - public native fun getPropertyPriority(propertyName: String): String = js.noImpl - public native fun getPropertyValue(propertyName: String): String = js.noImpl - public native fun item(index: Number): String = js.noImpl - public native fun removeProperty(propertyName: String): String = js.noImpl - public native fun setProperty(propertyName: String, value: String, priority: String): Unit = js.noImpl + public native var cssText: String + public native var length: Double + public native var parentRule: CSSRule + public native fun getPropertyPriority(propertyName: String): String + public native fun getPropertyValue(propertyName: String): String + public native fun item(index: Number): String + public native fun removeProperty(propertyName: String): String + public native fun setProperty(propertyName: String, value: String, priority: String): Unit } public native trait HTMLHtmlElement : HTMLElement { - public native var version: String = js.noImpl + public native var version: String } public native trait HTMLHeadElement : HTMLElement { - public native var profile: String = js.noImpl + public native var profile: String } public native trait HTMLLinkElement : HTMLElement { - public native var disabled: Boolean = js.noImpl - public native var charset: String = js.noImpl - public native var href: String = js.noImpl - public native var hreflang: String = js.noImpl - public native var media: String = js.noImpl - public native var rel: String = js.noImpl - public native var rev: String = js.noImpl - public native var target: String = js.noImpl - public native var `type`: String = js.noImpl + public native var disabled: Boolean + public native var charset: String + public native var href: String + public native var hreflang: String + public native var media: String + public native var rel: String + public native var rev: String + public native var target: String + public native var `type`: String } public native trait HTMLTitleElement : HTMLElement { - public native var text: String = js.noImpl + public native var text: String } public native trait HTMLMetaElement : HTMLElement { - public native var content: String = js.noImpl - public native var httpEquiv: String = js.noImpl - public native var name: String = js.noImpl - public native var scheme: String = js.noImpl + public native var content: String + public native var httpEquiv: String + public native var name: String + public native var scheme: String } public native trait HTMLBaseElement : HTMLElement { - public native var href: String = js.noImpl - public native var target: String = js.noImpl + public native var href: String + public native var target: String } public native trait HTMLIsIndexElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl - public native var prompt: String = js.noImpl + public native val form: HTMLFormElement + public native var prompt: String } public native trait HTMLStyleElement : HTMLElement { - public native var disabled: Boolean = js.noImpl - public native var media: String = js.noImpl - public native var `type`: String = js.noImpl + public native var disabled: Boolean + public native var media: String + public native var `type`: String } public native trait HTMLBodyElement : HTMLElement { - public native var aLink: String = js.noImpl - public native var background: String = js.noImpl - public native var bgColor: String = js.noImpl - public native var link: String = js.noImpl - public native var text: String = js.noImpl - public native var vLink: String = js.noImpl - public native var onload: () -> Unit = js.noImpl - public native var onunload: () -> Unit = js.noImpl + public native var aLink: String + public native var background: String + public native var bgColor: String + public native var link: String + public native var text: String + public native var vLink: String + public native var onload: () -> Unit + public native var onunload: () -> Unit } public native trait HTMLFormElement { - public native val elements: HTMLCollection = js.noImpl - public native val length: Double = js.noImpl - public native var name: String = js.noImpl - public native var acceptCharset: String = js.noImpl - public native var action: String = js.noImpl - public native var enctype: String = js.noImpl - public native var method: String = js.noImpl - public native var target: String = js.noImpl - public native fun submit(): Unit = js.noImpl - public native fun reset(): Unit = js.noImpl + public native val elements: HTMLCollection + public native val length: Double + public native var name: String + public native var acceptCharset: String + public native var action: String + public native var enctype: String + public native var method: String + public native var target: String + public native fun submit(): Unit + public native fun reset(): Unit } public native trait HTMLSelectElement : HTMLElement { - public native val `type`: String = js.noImpl - public native var selectedIndex: Double = js.noImpl - public native var value: String = js.noImpl - public native var length: Double = js.noImpl - public native val form: HTMLFormElement = js.noImpl - public native val options: HTMLOptionsCollection = js.noImpl - public native var disabled: Boolean = js.noImpl - public native var multiple: Boolean = js.noImpl - public native var name: String = js.noImpl - public native var size: Double = js.noImpl - public native var tabIndex: Double = js.noImpl - public native fun add(element: HTMLElement, before: HTMLElement): Unit = js.noImpl - public native fun remove(index: Number): Unit = js.noImpl - public native fun blur(): Unit = js.noImpl - public native fun focus(): Unit = js.noImpl + public native val `type`: String + public native var selectedIndex: Double + public native var value: String + public native var length: Double + public native val form: HTMLFormElement + public native val options: HTMLOptionsCollection + public native var disabled: Boolean + public native var multiple: Boolean + public native var name: String + public native var size: Double + public native var tabIndex: Double + public native fun add(element: HTMLElement, before: HTMLElement): Unit + public native fun remove(index: Number): Unit + public native fun blur(): Unit + public native fun focus(): Unit } public native trait HTMLOptGroupElement : HTMLElement { - public native var disabled: Boolean = js.noImpl - public native var label: String = js.noImpl + public native var disabled: Boolean + public native var label: String } public native trait HTMLOptionElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl - public native var defaultSelected: Boolean = js.noImpl - public native var text: String = js.noImpl - public native var index: Double = js.noImpl - public native var disabled: Boolean = js.noImpl - public native var label: String = js.noImpl - public native var selected: Boolean = js.noImpl - public native var value: String = js.noImpl + public native val form: HTMLFormElement + public native var defaultSelected: Boolean + public native var text: String + public native var index: Double + public native var disabled: Boolean + public native var label: String + public native var selected: Boolean + public native var value: String } public native trait HTMLInputElement : HTMLElement { - public native var defaultValue: String = js.noImpl - public native var defaultChecked: Boolean = js.noImpl - public native val form: HTMLFormElement = js.noImpl - public native var accept: String = js.noImpl - public native var accessKey: String = js.noImpl - public native var align: String = js.noImpl - public native var alt: String = js.noImpl - public native var checked: Boolean = js.noImpl - public native var disabled: Boolean = js.noImpl - public native var maxLength: Double = js.noImpl - public native var name: String = js.noImpl - public native var readOnly: Boolean = js.noImpl - public native var size: Double = js.noImpl - public native var src: String = js.noImpl - public native var tabIndex: Double = js.noImpl - public native var `type`: String = js.noImpl - public native var useMap: String = js.noImpl - public native var value: String = js.noImpl - public native fun blur(): Unit = js.noImpl - public native fun focus(): Unit = js.noImpl - public native fun select(): Unit = js.noImpl - public native fun click(): Unit = js.noImpl - public native var selectionStart: Double = js.noImpl - public native var selectionEnd: Double = js.noImpl + public native var defaultValue: String + public native var defaultChecked: Boolean + public native val form: HTMLFormElement + public native var accept: String + public native var accessKey: String + public native var align: String + public native var alt: String + public native var checked: Boolean + public native var disabled: Boolean + public native var maxLength: Double + public native var name: String + public native var readOnly: Boolean + public native var size: Double + public native var src: String + public native var tabIndex: Double + public native var `type`: String + public native var useMap: String + public native var value: String + public native fun blur(): Unit + public native fun focus(): Unit + public native fun select(): Unit + public native fun click(): Unit + public native var selectionStart: Double + public native var selectionEnd: Double } public native trait HTMLTextAreaElement : HTMLElement { - public native var defaultValue: String = js.noImpl - public native val form: HTMLFormElement = js.noImpl - public native var accessKey: String = js.noImpl - public native var cols: Double = js.noImpl - public native var disabled: Boolean = js.noImpl - public native var name: String = js.noImpl - public native var readOnly: Boolean = js.noImpl - public native var rows: Double = js.noImpl - public native var tabIndex: Double = js.noImpl - public native var `type`: String = js.noImpl - public native var value: String = js.noImpl - public native fun blur(): Unit = js.noImpl - public native fun focus(): Unit = js.noImpl - public native fun select(): Unit = js.noImpl + public native var defaultValue: String + public native val form: HTMLFormElement + public native var accessKey: String + public native var cols: Double + public native var disabled: Boolean + public native var name: String + public native var readOnly: Boolean + public native var rows: Double + public native var tabIndex: Double + public native var `type`: String + public native var value: String + public native fun blur(): Unit + public native fun focus(): Unit + public native fun select(): Unit } public native trait HTMLButtonElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl - public native var accessKey: String = js.noImpl - public native var disabled: Boolean = js.noImpl - public native var name: String = js.noImpl - public native var tabIndex: Double = js.noImpl - public native var `type`: String = js.noImpl - public native var value: String = js.noImpl + public native val form: HTMLFormElement + public native var accessKey: String + public native var disabled: Boolean + public native var name: String + public native var tabIndex: Double + public native var `type`: String + public native var value: String } public native trait HTMLLabelElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl - public native var accessKey: String = js.noImpl - public native var htmlFor: String = js.noImpl + public native val form: HTMLFormElement + public native var accessKey: String + public native var htmlFor: String } public native trait HTMLFieldSetElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl + public native val form: HTMLFormElement } public native trait HTMLLegendElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl - public native var accessKey: String = js.noImpl - public native var align: String = js.noImpl + public native val form: HTMLFormElement + public native var accessKey: String + public native var align: String } public native trait HTMLUListElement : HTMLElement { - public native var compact: Boolean = js.noImpl - public native var `type`: String = js.noImpl + public native var compact: Boolean + public native var `type`: String } public native trait HTMLOListElement : HTMLElement { - public native var compact: Boolean = js.noImpl - public native var start: Double = js.noImpl - public native var `type`: String = js.noImpl + public native var compact: Boolean + public native var start: Double + public native var `type`: String } public native trait HTMLDListElement : HTMLElement { - public native var compact: Boolean = js.noImpl + public native var compact: Boolean } public native trait HTMLDirectoryElement : HTMLElement { - public native var compact: Boolean = js.noImpl + public native var compact: Boolean } public native trait HTMLMenuElement : HTMLElement { - public native var compact: Boolean = js.noImpl + public native var compact: Boolean } public native trait HTMLLIElement : HTMLElement { - public native var `type`: String = js.noImpl - public native var value: Double = js.noImpl + public native var `type`: String + public native var value: Double } public native trait HTMLDivElement : HTMLElement { - public native var align: String = js.noImpl + public native var align: String } public native trait HTMLParagraphElement : HTMLElement { - public native var align: String = js.noImpl + public native var align: String } public native trait HTMLHeadingElement : HTMLElement { - public native var align: String = js.noImpl + public native var align: String } public native trait HTMLQuoteElement : HTMLElement { - public native var cite: String = js.noImpl + public native var cite: String } public native trait HTMLPreElement : HTMLElement { - public native var width: Double = js.noImpl + public native var width: Double } public native trait HTMLBRElement : HTMLElement { - public native var clear: String = js.noImpl + public native var clear: String } public native trait HTMLBaseFontElement : HTMLElement { - public native var color: String = js.noImpl - public native var face: String = js.noImpl - public native var size: Double = js.noImpl + public native var color: String + public native var face: String + public native var size: Double } public native trait HTMLFontElement : HTMLElement { - public native var color: String = js.noImpl - public native var face: String = js.noImpl - public native var size: String = js.noImpl + public native var color: String + public native var face: String + public native var size: String } public native trait HTMLHRElement : HTMLElement { - public native var align: String = js.noImpl - public native var noShade: Boolean = js.noImpl - public native var size: String = js.noImpl - public native var width: String = js.noImpl + public native var align: String + public native var noShade: Boolean + public native var size: String + public native var width: String } public native trait HTMLModElement : HTMLElement { - public native var cite: String = js.noImpl - public native var dateTime: String = js.noImpl + public native var cite: String + public native var dateTime: String } public native trait HTMLAnchorElement : HTMLElement { - public native var accessKey: String = js.noImpl - public native var charset: String = js.noImpl - public native var coords: String = js.noImpl - public native var href: String = js.noImpl - public native var hreflang: String = js.noImpl - public native var name: String = js.noImpl - public native var rel: String = js.noImpl - public native var rev: String = js.noImpl - public native var shape: String = js.noImpl - public native var tabIndex: Double = js.noImpl - public native var target: String = js.noImpl - public native var `type`: String = js.noImpl - public native fun blur(): Unit = js.noImpl - public native fun focus(): Unit = js.noImpl + public native var accessKey: String + public native var charset: String + public native var coords: String + public native var href: String + public native var hreflang: String + public native var name: String + public native var rel: String + public native var rev: String + public native var shape: String + public native var tabIndex: Double + public native var target: String + public native var `type`: String + public native fun blur(): Unit + public native fun focus(): Unit } public native trait HTMLImageElement : HTMLElement { - public native var name: String = js.noImpl - public native var align: String = js.noImpl - public native var alt: String = js.noImpl - public native var border: String = js.noImpl - public native var height: Double = js.noImpl - public native var hspace: Double = js.noImpl - public native var isMap: Boolean = js.noImpl - public native var longDesc: String = js.noImpl - public native var src: String = js.noImpl - public native var useMap: String = js.noImpl - public native var vspace: Double = js.noImpl - public native var width: Double = js.noImpl + public native var name: String + public native var align: String + public native var alt: String + public native var border: String + public native var height: Double + public native var hspace: Double + public native var isMap: Boolean + public native var longDesc: String + public native var src: String + public native var useMap: String + public native var vspace: Double + public native var width: Double } public native trait HTMLObjectElement : HTMLElement { - public native val form: HTMLFormElement = js.noImpl - public native var code: String = js.noImpl - public native var align: String = js.noImpl - public native var archive: String = js.noImpl - public native var border: String = js.noImpl - public native var codeBase: String = js.noImpl - public native var codeType: String = js.noImpl - public native var data: String = js.noImpl - public native var declare: Boolean = js.noImpl - public native var height: String = js.noImpl - public native var hspace: Double = js.noImpl - public native var name: String = js.noImpl - public native var standby: String = js.noImpl - public native var tabIndex: Double = js.noImpl - public native var `type`: String = js.noImpl - public native var useMap: String = js.noImpl - public native var vspace: Double = js.noImpl - public native var width: String = js.noImpl - public native val contentDocument: Document = js.noImpl + public native val form: HTMLFormElement + public native var code: String + public native var align: String + public native var archive: String + public native var border: String + public native var codeBase: String + public native var codeType: String + public native var data: String + public native var declare: Boolean + public native var height: String + public native var hspace: Double + public native var name: String + public native var standby: String + public native var tabIndex: Double + public native var `type`: String + public native var useMap: String + public native var vspace: Double + public native var width: String + public native val contentDocument: Document } public native trait HTMLParamElement : HTMLElement { - public native var name: String = js.noImpl - public native var `type`: String = js.noImpl - public native var value: String = js.noImpl - public native var valueType: String = js.noImpl + public native var name: String + public native var `type`: String + public native var value: String + public native var valueType: String } public native trait HTMLAppletElement : HTMLElement { - public native var align: String = js.noImpl - public native var alt: String = js.noImpl - public native var archive: String = js.noImpl - public native var code: String = js.noImpl - public native var codeBase: String = js.noImpl - public native var height: String = js.noImpl - public native var hspace: Double = js.noImpl - public native var name: String = js.noImpl - public native var `object`: String = js.noImpl - public native var vspace: Double = js.noImpl - public native var width: String = js.noImpl + public native var align: String + public native var alt: String + public native var archive: String + public native var code: String + public native var codeBase: String + public native var height: String + public native var hspace: Double + public native var name: String + public native var `object`: String + public native var vspace: Double + public native var width: String } public native trait HTMLMapElement : HTMLElement { - public native val areas: HTMLCollection = js.noImpl - public native var name: String = js.noImpl + public native val areas: HTMLCollection + public native var name: String } public native trait HTMLAreaElement : HTMLElement { - public native var accessKey: String = js.noImpl - public native var alt: String = js.noImpl - public native var coords: String = js.noImpl - public native var href: String = js.noImpl - public native var noHref: Boolean = js.noImpl - public native var shape: String = js.noImpl - public native var tabIndex: Double = js.noImpl - public native var target: String = js.noImpl + public native var accessKey: String + public native var alt: String + public native var coords: String + public native var href: String + public native var noHref: Boolean + public native var shape: String + public native var tabIndex: Double + public native var target: String } public native trait HTMLScriptElement : HTMLElement { - public native var text: String = js.noImpl - public native var htmlFor: String = js.noImpl - public native var event: String = js.noImpl - public native var charset: String = js.noImpl - public native var defer: Boolean = js.noImpl - public native var src: String = js.noImpl - public native var `type`: String = js.noImpl + public native var text: String + public native var htmlFor: String + public native var event: String + public native var charset: String + public native var defer: Boolean + public native var src: String + public native var `type`: String } public native trait HTMLTableElement : HTMLElement { - public native var caption: HTMLTableCaptionElement = js.noImpl - public native var tHead: HTMLTableSectionElement = js.noImpl - public native var tFoot: HTMLTableSectionElement = js.noImpl - public native val rows: HTMLCollection = js.noImpl - public native val tBodies: HTMLCollection = js.noImpl - public native var align: String = js.noImpl - public native var bgColor: String = js.noImpl - public native var border: String = js.noImpl - public native var cellPadding: String = js.noImpl - public native var cellSpacing: String = js.noImpl - public native var frame: String = js.noImpl - public native var rules: String = js.noImpl - public native var summary: String = js.noImpl - public native var width: String = js.noImpl - public native fun createTHead(): HTMLElement? = js.noImpl - public native fun deleteTHead(): Unit = js.noImpl - public native fun createTFoot(): HTMLElement? = js.noImpl - public native fun deleteTFoot(): Unit = js.noImpl - public native fun createCaption(): HTMLElement? = js.noImpl - public native fun deleteCaption(): Unit = js.noImpl - public native fun insertRow(index: Number): HTMLElement? = js.noImpl - public native fun deleteRow(index: Number): Unit = js.noImpl + public native var caption: HTMLTableCaptionElement + public native var tHead: HTMLTableSectionElement + public native var tFoot: HTMLTableSectionElement + public native val rows: HTMLCollection + public native val tBodies: HTMLCollection + public native var align: String + public native var bgColor: String + public native var border: String + public native var cellPadding: String + public native var cellSpacing: String + public native var frame: String + public native var rules: String + public native var summary: String + public native var width: String + public native fun createTHead(): HTMLElement? + public native fun deleteTHead(): Unit + public native fun createTFoot(): HTMLElement? + public native fun deleteTFoot(): Unit + public native fun createCaption(): HTMLElement? + public native fun deleteCaption(): Unit + public native fun insertRow(index: Number): HTMLElement? + public native fun deleteRow(index: Number): Unit } public native trait HTMLTableCaptionElement : HTMLElement { - public native var align: String = js.noImpl + public native var align: String } public native trait HTMLTableColElement : HTMLElement { - public native var align: String = js.noImpl - public native var ch: String = js.noImpl - public native var chOff: String = js.noImpl - public native var span: Double = js.noImpl - public native var vAlign: String = js.noImpl - public native var width: String = js.noImpl + public native var align: String + public native var ch: String + public native var chOff: String + public native var span: Double + public native var vAlign: String + public native var width: String } public native trait HTMLTableSectionElement : HTMLElement { - public native var align: String = js.noImpl - public native var ch: String = js.noImpl - public native var chOff: String = js.noImpl - public native var vAlign: String = js.noImpl - public native val rows: HTMLCollection = js.noImpl - public native fun insertRow(index: Number): HTMLElement? = js.noImpl - public native fun deleteRow(index: Number): Unit = js.noImpl + public native var align: String + public native var ch: String + public native var chOff: String + public native var vAlign: String + public native val rows: HTMLCollection + public native fun insertRow(index: Number): HTMLElement? + public native fun deleteRow(index: Number): Unit } public native trait HTMLTableRowElement : HTMLElement { - public native val rowIndex: Double = js.noImpl - public native val sectionRowIndex: Double = js.noImpl - public native val cells: HTMLCollection = js.noImpl - public native var align: String = js.noImpl - public native var bgColor: String = js.noImpl - public native var ch: String = js.noImpl - public native var chOff: String = js.noImpl - public native var vAlign: String = js.noImpl - public native fun insertCell(index: Number): HTMLElement? = js.noImpl - public native fun deleteCell(index: Number): Unit = js.noImpl + public native val rowIndex: Double + public native val sectionRowIndex: Double + public native val cells: HTMLCollection + public native var align: String + public native var bgColor: String + public native var ch: String + public native var chOff: String + public native var vAlign: String + public native fun insertCell(index: Number): HTMLElement? + public native fun deleteCell(index: Number): Unit } public native trait HTMLTableCellElement : HTMLElement { - public native val cellIndex: Double = js.noImpl - public native var abbr: String = js.noImpl - public native var align: String = js.noImpl - public native var axis: String = js.noImpl - public native var bgColor: String = js.noImpl - public native var ch: String = js.noImpl - public native var chOff: String = js.noImpl - public native var colSpan: Double = js.noImpl - public native var headers: String = js.noImpl - public native var height: String = js.noImpl - public native var noWrap: Boolean = js.noImpl - public native var rowSpan: Double = js.noImpl - public native var scope: String = js.noImpl - public native var vAlign: String = js.noImpl - public native var width: String = js.noImpl + public native val cellIndex: Double + public native var abbr: String + public native var align: String + public native var axis: String + public native var bgColor: String + public native var ch: String + public native var chOff: String + public native var colSpan: Double + public native var headers: String + public native var height: String + public native var noWrap: Boolean + public native var rowSpan: Double + public native var scope: String + public native var vAlign: String + public native var width: String } public native trait HTMLFrameSetElement : HTMLElement { - public native var cols: String = js.noImpl - public native var rows: String = js.noImpl + public native var cols: String + public native var rows: String } public native trait HTMLFrameElement : HTMLElement { - public native var frameBorder: String = js.noImpl - public native var longDesc: String = js.noImpl - public native var marginHeight: String = js.noImpl - public native var marginWidth: String = js.noImpl - public native var name: String = js.noImpl - public native var noResize: Boolean = js.noImpl - public native var scrolling: String = js.noImpl - public native var src: String = js.noImpl + public native var frameBorder: String + public native var longDesc: String + public native var marginHeight: String + public native var marginWidth: String + public native var name: String + public native var noResize: Boolean + public native var scrolling: String + public native var src: String } public native trait HTMLIFrameElement : HTMLElement { - public native var align: String = js.noImpl - public native var frameBorder: String = js.noImpl - public native var height: String = js.noImpl - public native var longDesc: String = js.noImpl - public native var marginHeight: String = js.noImpl - public native var marginWidth: String = js.noImpl - public native var name: String = js.noImpl - public native var scrolling: String = js.noImpl - public native var src: String = js.noImpl - public native var width: String = js.noImpl - public native val contentDocument: Document = js.noImpl - public native val contentWindow: Window = js.noImpl + public native var align: String + public native var frameBorder: String + public native var height: String + public native var longDesc: String + public native var marginHeight: String + public native var marginWidth: String + public native var name: String + public native var scrolling: String + public native var src: String + public native var width: String + public native val contentDocument: Document + public native val contentWindow: Window } diff --git a/js/js.libraries/src/core/kotlin.kt b/js/js.libraries/src/core/kotlin.kt index ee186ee6f2c..37f5c26ce19 100644 --- a/js/js.libraries/src/core/kotlin.kt +++ b/js/js.libraries/src/core/kotlin.kt @@ -5,23 +5,33 @@ import java.util.* library("comparator") public fun comparator(f : (T, T) -> Int): Comparator = js.noImpl -public fun array(vararg value: T): Array = js.noImpl +library +public fun array(vararg value : T): Array = js.noImpl // "constructors" for primitive types array + +library public fun doubleArray(vararg content : Double): DoubleArray = js.noImpl +library public fun floatArray(vararg content : Float): FloatArray = js.noImpl +library public fun longArray(vararg content : Long): LongArray = js.noImpl +library public fun intArray(vararg content : Int): IntArray = js.noImpl +library public fun charArray(vararg content : Char): CharArray = js.noImpl +library public fun shortArray(vararg content : Short): ShortArray = js.noImpl +library public fun byteArray(vararg content : Byte): ByteArray = js.noImpl +library public fun booleanArray(vararg content : Boolean): BooleanArray = js.noImpl library("copyToArray") diff --git a/js/js.libraries/src/core/string.kt b/js/js.libraries/src/core/string.kt index 94d8ed84b44..c54e7d4a8d2 100644 --- a/js/js.libraries/src/core/string.kt +++ b/js/js.libraries/src/core/string.kt @@ -35,11 +35,13 @@ native public fun String.match(regex : String) : Array = js.noImpl native public fun String.trim() : String = js.noImpl -public val String.size: Int - get() = js.noImpl +library +public val String.size: Int = js.noImpl +library public fun String.length(): Int = js.noImpl +library public fun String.isEmpty(): Boolean = js.noImpl /* diff --git a/js/js.libraries/src/html5/canvas.kt b/js/js.libraries/src/html5/canvas.kt index 421f7b359ba..d462f1f9d18 100644 --- a/js/js.libraries/src/html5/canvas.kt +++ b/js/js.libraries/src/html5/canvas.kt @@ -6,97 +6,97 @@ import js.dom.html.HTMLElement import org.w3c.dom.Element public native trait HTMLCanvasElement : HTMLElement { - public native var width: Double = js.noImpl - public native var height: Double = js.noImpl - public native fun getContext(context: String): CanvasContext? = js.noImpl - public native fun toDataURL(string: String, args: Any): String = js.noImpl - public native fun toDataURL(): String = js.noImpl - public native fun toDataURL(string: String): String = js.noImpl + public native var width: Double + public native var height: Double + public native fun getContext(context: String): CanvasContext? + public native fun toDataURL(string: String, args: Any): String + public native fun toDataURL(): String + public native fun toDataURL(string: String): String } public native trait CanvasContext { - public native var canvas: HTMLCanvasElement = js.noImpl - public native fun save(): Unit = js.noImpl - public native fun restore(): Unit = js.noImpl - public native fun scale(x: Number, y: Number): Unit = js.noImpl - public native fun rotate(angle: Number): Unit = js.noImpl - public native fun translate(x: Number, y: Number): Unit = js.noImpl - public native fun transform(m11: Number, m12: Number, m21: Number, m22: Number, dx: Number, dy: Number): Unit = js.noImpl - public native fun setTransform(m11: Number, m12: Number, m21: Number, m22: Number, dx: Number, dy: Number): Unit = js.noImpl - public native var globalAlpha: Double = js.noImpl - public native var globalCompositeOperation: String = js.noImpl - public native var fillStyle: Any = js.noImpl - public native var strokeStyle: Any = js.noImpl - public native fun createLinearGradient(x0: Number, y0: Number, x1: Number, y1: Number): CanvasGradient? = js.noImpl - public native fun createRadialGradient(x0: Number, y0: Number, r0: Number, x1: Number, y1: Number, r1: Number): CanvasGradient? = js.noImpl - public native var lineWidth: Double = js.noImpl - public native var lineCap: String = js.noImpl - public native var lineJoin: String = js.noImpl - public native var miterLimit: Double = js.noImpl - public native var shadowOffsetX: Double = js.noImpl - public native var shadowOffsetY: Double = js.noImpl - public native var shadowBlur: Double = js.noImpl - public native var shadowColor: String = js.noImpl - public native fun clearRect(x: Number, y: Number, w: Number, h: Number): Unit = js.noImpl - public native fun fillRect(x: Number, y: Number, w: Number, h: Number): Unit = js.noImpl - public native fun strokeRect(x: Number, y: Number, w: Number, h: Number): Unit = js.noImpl - public native fun beginPath(): Unit = js.noImpl - public native fun closePath(): Unit = js.noImpl - public native fun moveTo(x: Number, y: Number): Unit = js.noImpl - public native fun lineTo(x: Number, y: Number): Unit = js.noImpl - public native fun quadraticCurveTo(cpx: Number, cpy: Number, x: Number, y: Number): Unit = js.noImpl - public native fun bezierCurveTo(cp1x: Number, cp1y: Number, cp2x: Number, cp2y: Number, x: Number, y: Number): Unit = js.noImpl - public native fun arcTo(x1: Number, y1: Number, x2: Number, y2: Number, radius: Number): Unit = js.noImpl - public native fun rect(x: Number, y: Number, w: Number, h: Number): Unit = js.noImpl - public native fun arc(x: Number, y: Number, radius: Number, startAngle: Number, endAngle: Number, anticlockwise: Boolean): Unit = js.noImpl - public native fun fill(): Unit = js.noImpl - public native fun stroke(): Unit = js.noImpl - public native fun clip(): Unit = js.noImpl - public native fun isPointInPath(x: Number, y: Number): Boolean = js.noImpl - public native fun drawFocusRing(element: Element, xCaret: Number, yCaret: Number, canDrawCustom: Boolean): Unit = js.noImpl - public native fun drawFocusRing(element: Element, xCaret: Number, yCaret: Number): Unit = js.noImpl - public native var font: String = js.noImpl - public native var textAlign: String = js.noImpl - public native var textBaseline: String = js.noImpl - public native fun fillText(text: String, x: Number, y: Number, maxWidth: Number): Unit = js.noImpl - public native fun fillText(text: String, x: Number, y: Number): Unit = js.noImpl - public native fun strokeText(text: String, x: Number, y: Number, maxWidth: Number): Unit = js.noImpl - public native fun strokeText(text: String, x: Number, y: Number): Unit = js.noImpl - public native fun measureText(text: String): TextMetrics? = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number, dy: Number, dw: Number, dh: Number): Unit = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number): Unit = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number): Unit = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number): Unit = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number): Unit = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number, dy: Number): Unit = js.noImpl - public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number, dy: Number, dw: Number): Unit = js.noImpl - public native fun createImageData(imagedata: ImageData, sh: Number): ImageData? = js.noImpl - public native fun createImageData(imagedata: ImageData): ImageData? = js.noImpl - public native fun createImageData(sw: Number, sh: Number): ImageData? = js.noImpl - public native fun createImageData(sw: Number): ImageData? = js.noImpl - public native fun getImageData(sx: Number, sy: Number, sw: Number, sh: Number): ImageData? = js.noImpl - public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number, dirtyY: Number, dirtyWidth: Number, dirtyHeight: Number): Unit = js.noImpl - public native fun putImageData(image_data: ImageData, dx: Number, dy: Number): Unit = js.noImpl - public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number): Unit = js.noImpl - public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number, dirtyY: Number): Unit = js.noImpl - public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number, dirtyY: Number, dirtyWidth: Number): Unit = js.noImpl + public native var canvas: HTMLCanvasElement + public native fun save(): Unit + public native fun restore(): Unit + public native fun scale(x: Number, y: Number): Unit + public native fun rotate(angle: Number): Unit + public native fun translate(x: Number, y: Number): Unit + public native fun transform(m11: Number, m12: Number, m21: Number, m22: Number, dx: Number, dy: Number): Unit + public native fun setTransform(m11: Number, m12: Number, m21: Number, m22: Number, dx: Number, dy: Number): Unit + public native var globalAlpha: Double + public native var globalCompositeOperation: String + public native var fillStyle: Any + public native var strokeStyle: Any + public native fun createLinearGradient(x0: Number, y0: Number, x1: Number, y1: Number): CanvasGradient? + public native fun createRadialGradient(x0: Number, y0: Number, r0: Number, x1: Number, y1: Number, r1: Number): CanvasGradient? + public native var lineWidth: Double + public native var lineCap: String + public native var lineJoin: String + public native var miterLimit: Double + public native var shadowOffsetX: Double + public native var shadowOffsetY: Double + public native var shadowBlur: Double + public native var shadowColor: String + public native fun clearRect(x: Number, y: Number, w: Number, h: Number): Unit + public native fun fillRect(x: Number, y: Number, w: Number, h: Number): Unit + public native fun strokeRect(x: Number, y: Number, w: Number, h: Number): Unit + public native fun beginPath(): Unit + public native fun closePath(): Unit + public native fun moveTo(x: Number, y: Number): Unit + public native fun lineTo(x: Number, y: Number): Unit + public native fun quadraticCurveTo(cpx: Number, cpy: Number, x: Number, y: Number): Unit + public native fun bezierCurveTo(cp1x: Number, cp1y: Number, cp2x: Number, cp2y: Number, x: Number, y: Number): Unit + public native fun arcTo(x1: Number, y1: Number, x2: Number, y2: Number, radius: Number): Unit + public native fun rect(x: Number, y: Number, w: Number, h: Number): Unit + public native fun arc(x: Number, y: Number, radius: Number, startAngle: Number, endAngle: Number, anticlockwise: Boolean): Unit + public native fun fill(): Unit + public native fun stroke(): Unit + public native fun clip(): Unit + public native fun isPointInPath(x: Number, y: Number): Boolean + public native fun drawFocusRing(element: Element, xCaret: Number, yCaret: Number, canDrawCustom: Boolean): Unit + public native fun drawFocusRing(element: Element, xCaret: Number, yCaret: Number): Unit + public native var font: String + public native var textAlign: String + public native var textBaseline: String + public native fun fillText(text: String, x: Number, y: Number, maxWidth: Number): Unit + public native fun fillText(text: String, x: Number, y: Number): Unit + public native fun strokeText(text: String, x: Number, y: Number, maxWidth: Number): Unit + public native fun strokeText(text: String, x: Number, y: Number): Unit + public native fun measureText(text: String): TextMetrics? + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number, dy: Number, dw: Number, dh: Number): Unit + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number): Unit + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number): Unit + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number): Unit + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number): Unit + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number, dy: Number): Unit + public native fun drawImage(img_elem: HTMLElement, dx_or_sx: Number, dy_or_sy: Number, dw_or_sw: Number, dh_or_sh: Number, dx: Number, dy: Number, dw: Number): Unit + public native fun createImageData(imagedata: ImageData, sh: Number): ImageData? + public native fun createImageData(imagedata: ImageData): ImageData? + public native fun createImageData(sw: Number, sh: Number): ImageData? + public native fun createImageData(sw: Number): ImageData? + public native fun getImageData(sx: Number, sy: Number, sw: Number, sh: Number): ImageData? + public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number, dirtyY: Number, dirtyWidth: Number, dirtyHeight: Number): Unit + public native fun putImageData(image_data: ImageData, dx: Number, dy: Number): Unit + public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number): Unit + public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number, dirtyY: Number): Unit + public native fun putImageData(image_data: ImageData, dx: Number, dy: Number, dirtyX: Number, dirtyY: Number, dirtyWidth: Number): Unit } public native trait CanvasGradient { - public native fun addColorStop(offset: Number, color: String): Unit = js.noImpl + public native fun addColorStop(offset: Number, color: String): Unit } public native trait ImageData { - public native var data: CanvasPixelArray = js.noImpl - public native var width: Double = js.noImpl - public native var height: Double = js.noImpl + public native var data: CanvasPixelArray + public native var width: Double + public native var height: Double } public native trait CanvasPixelArray { - public native var length: Double = js.noImpl + public native var length: Double } public native trait TextMetrics { - public native var width: Double = js.noImpl + public native var width: Double } diff --git a/js/js.libraries/src/jquery/common.kt b/js/js.libraries/src/jquery/common.kt index 4c3a13ca2e3..7fa61e43733 100644 --- a/js/js.libraries/src/jquery/common.kt +++ b/js/js.libraries/src/jquery/common.kt @@ -4,69 +4,68 @@ import org.w3c.dom.Element native public public class JQuery() { - public fun addClass(className : String) : JQuery = js.noImpl; - public fun addClass(f : Element.(Int, String)->String) = js.noImpl; + public fun addClass(className: String): JQuery = js.noImpl; + public fun addClass(f: Element.(Int, String) -> String): JQuery = js.noImpl; - public fun attr(attrName : String) = ""; - public fun attr(attrName : String, value : String) = this; + public fun attr(attrName: String): String = ""; + public fun attr(attrName: String, value: String): JQuery = this; - public fun html() : String = ""; - public fun html(s : String) = this; - public fun html(f : Element.(Int, String)->String) = this; + public fun html(): String = ""; + public fun html(s: String): JQuery = this; + public fun html(f: Element.(Int, String) -> String): JQuery = this; - public fun hasClass(className : String) = true - public fun removeClass(className : String) = this - public fun height() = 0 - public fun width() = 0 + public fun hasClass(className: String): Boolean = true + public fun removeClass(className: String): JQuery = this + public fun height(): Number = 0 + public fun width(): Number = 0 - public fun click() = this; + public fun click(): JQuery = this; - public fun mousedown(handler : Element.(MouseEvent)->Unit) = this; - public fun mouseup(handler : Element.(MouseEvent)->Unit) = this; - public fun mousemove(handler : Element.(MouseEvent)->Unit) = this; + public fun mousedown(handler: Element.(MouseEvent) -> Unit): JQuery = this; + public fun mouseup(handler: Element.(MouseEvent) -> Unit): JQuery = this; + public fun mousemove(handler: Element.(MouseEvent) -> Unit): JQuery = this; - public fun dblclick(handler : Element.(MouseClickEvent)->Unit) = this; - public fun click(handler : Element.(MouseClickEvent)->Unit) = this; + public fun dblclick(handler: Element.(MouseClickEvent) -> Unit): JQuery = this; + public fun click(handler: Element.(MouseClickEvent) -> Unit): JQuery = this; - public fun load(handler : Element.()->Unit) = this; - public fun change(handler : Element.()->Unit) = this; + public fun load(handler: Element.() -> Unit): JQuery = this; + public fun change(handler: Element.() -> Unit): JQuery = this; - public fun append(str : String) = this; - public fun ready(handler : ()->Unit) = this; - public fun text(text : String) = this; - public fun slideUp() = this; - public fun hover(handlerInOut : Element.() -> Unit) = this; - public fun hover(handlerIn : Element.() -> Unit, handlerOut : Element.() -> Unit) = this; - public fun next() : JQuery = js.noImpl - public fun parent() : JQuery = js.noImpl - public fun `val`() : String? = js.noImpl + public fun append(str: String): JQuery = this; + public fun ready(handler: () -> Unit): JQuery = this; + public fun text(text: String): JQuery = this; + public fun slideUp(): JQuery = this; + public fun hover(handlerInOut: Element.() -> Unit): JQuery = this; + public fun hover(handlerIn: Element.() -> Unit, handlerOut: Element.() -> Unit): JQuery = this; + public fun next(): JQuery = js.noImpl + public fun parent(): JQuery = js.noImpl + public fun `val`(): String? = js.noImpl } native open public class MouseEvent() { - public val pageX : Double = 0.0; - public val pageY : Double = 0.0; - public fun preventDefault() {} - public fun isDefaultPrevented() : Boolean = true; + public val pageX: Double = 0.0; + public val pageY: Double = 0.0; + public fun preventDefault() { + } + public fun isDefaultPrevented(): Boolean = true; } native public class MouseClickEvent() : MouseEvent() { - val which : Int = 0; + val which: Int = 0; } - - native("$") -public fun jq(selector : String) = JQuery(); +public fun jq(selector: String): JQuery = JQuery(); native("$") -public fun jq(selector : String, context : Element) = JQuery(); +public fun jq(selector: String, context: Element): JQuery = JQuery(); native("$") -public fun jq(callback : () -> Unit) = JQuery(); +public fun jq(callback: () -> Unit): JQuery = JQuery(); native("$") -public fun jq(obj : JQuery) = JQuery(); +public fun jq(obj: JQuery): JQuery = JQuery(); native("$") -public fun jq(el : Element) = JQuery(); +public fun jq(el: Element): JQuery = JQuery(); native("$") -public fun jq() = JQuery(); +public fun jq(): JQuery = JQuery();