skrypton-api / com.waicool20.skrypton.jni.objects / SKryptonApp

SKryptonApp

object SKryptonApp : NativeInterface

A singleton app instance for this library and is the main entry point for any program that wants to use any of the SKrypton APIs. This object is in charge of initializing the native components and managing it.

Properties

APP_DIRECTORY

val APP_DIRECTORY: Path

Holds a Path pointing to the directory used by SKrypton, this directory contains all the native libraries and resources that SKrypton will use.

handle

lateinit var handle: CPointer

Native pointer, initialized in initialize.

Functions

close

fun close(): Unit

Closes the SKryptonApp instance explicitly.

exec

fun exec(exit: Boolean = false): Int

Blocking function which starts the execution of the SKryptonApp.

getEnv

fun getEnv(key: String): String

Gets the value of the native environment variable.

initialize

fun initialize(args: Array<String> = emptyArray(), remoteDebugPort: Int = -1, action: SKryptonApp.() -> Unit = {}): SKryptonApp

Initializes the native components.

putEnv

fun putEnv(key: String, value: String): Unit

Puts an variable into the native environment, it is lost when the SKryptonApp is done executing.

runOnMainThread

fun runOnMainThread(action: () -> Unit): Unit

Executes the given action on the thread where SKryptonApp exists. This is similar to the Platform.runLater method.

Inherited Functions

dispose

fun dispose(): Unit

Disposes this object, usually same action as close

Extension Functions

screen

fun SKryptonApp.screen(url: String, showCursor: Boolean = true, width: Int = 1280, height: Int = 720, action: SKryptonScreen.() -> Unit = {}): SKryptonScreen

Creates a SKryptonScreen under this SKryptonApp instance

webView

fun SKryptonApp.webView(url: String, action: SKryptonWebView.() -> Unit = {}): SKryptonWebView

Creates a SKryptonWebView under this SKryptonApp instance.