Skip to content

Instantly share code, notes, and snippets.

@iffy

iffy/sample.nim Secret

Created November 30, 2018 17:54
Show Gist options
  • Save iffy/1515cda0c1bc1af77ae2cf6c61fdfe2b to your computer and use it in GitHub Desktop.
Save iffy/1515cda0c1bc1af77ae2cf6c61fdfe2b to your computer and use it in GitHub Desktop.
jclass org.wiish.wiishexample.WiishActivity of JVMObject:
proc evalJavaScript(js: string)
type
WebviewWindow = ref object of BaseWindow
wiishActivity: WiishActivity
proc nimwin() : WebviewWindow {.exportc.} = app.window
proc executeSomeJS(js:string) =
app.window.wiishActivity.evalJavaScript("somefunc();")
{.emit: """
JNIEXPORT void JNICALL Java_org_wiish_exampleapp_WiishActivity_wiish_1init
(JNIEnv * env, jobject obj) {
NimMain();
nimwin()->wiishActivity = obj;
}
""" .}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment