WebviewLibrary

interface WebviewLibrary : Library

All 15 C functions in webview.h

Types

Link copied to clipboard
interface webview_bind_fn_callback : Callback

The callback interface for webview_bind due to JNA's function mapping rules.

Link copied to clipboard
interface webview_dispatch_fn_callback : Callback

Functions

Link copied to clipboard
abstract fun webview_bind(    webview: Pointer?,     name: String,     callback: WebviewJNA.WebviewLibrary.webview_bind_fn_callback,     arg: Pointer? = Pointer.NULL)

Binds a Kotlin or Java callback so that it will appear under the given name as a global JavaScript function.

Link copied to clipboard
abstract fun webview_create(debug: Int = 0, window: Pointer? = Pointer.NULL): Pointer?

Creates a new webview instance.

Link copied to clipboard
abstract fun webview_destroy(webview: Pointer?)
Link copied to clipboard
abstract fun webview_dispatch(    webview: Pointer?,     fn: WebviewJNA.WebviewLibrary.webview_dispatch_fn_callback,     args: Pointer? = Pointer.NULL)

Posts a function to be executed on the main thread.

Link copied to clipboard
abstract fun webview_eval(webview: Pointer?, js: String)

Evaluates arbitrary JavaScript code.

Link copied to clipboard
abstract fun webview_get_window(webview: Pointer?): Pointer?

Returns a native window handle pointer.

Link copied to clipboard
abstract fun webview_init(webview: Pointer?, js: String)

Injects JavaScript code at the initialization of the new page.

Link copied to clipboard
abstract fun webview_navigate(webview: Pointer?, url: String)

Navigates webview to the given URL

Link copied to clipboard
abstract fun webview_return(    webview: Pointer?,     seq: String?,     status: Int,     result: String)

Allows to return a value from the Kotlin/Java binding.

Link copied to clipboard
abstract fun webview_run(webview: Pointer?)

Runs the main loop until it's terminated.

Link copied to clipboard
abstract fun webview_set_html(webview: Pointer?, html: String)

Set webview HTML directly.

Link copied to clipboard
abstract fun webview_set_size(    webview: Pointer?,     width: Int,     height: Int,     hints: Int = WEBVIEW_HINT_NONE)

Updates the size of the native window.

Link copied to clipboard
abstract fun webview_set_title(webview: Pointer?, title: String)

Updates the title of the native window.

Link copied to clipboard
abstract fun webview_terminate(webview: Pointer?)

Stops the main loop.

Link copied to clipboard
abstract fun webview_unbind(webview: Pointer?, name: String)

Removes a Kotlin/Java callback that was previously set by webview_bind.