There can only be one JNI_OnLoad callback per JNI library, and the
Gio program may need it for its own purposes.
Gio only used JNI_OnLoad for explicitly registering native methods. Switch
to implicit name based registration and get rid of JNI_OnLoad.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
We're about to remove the global JNI_OnLoad constructor, and the
JavaVM singleton is just as easily fetched from a Java JNI callback.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
While we're here,
- replace the registerFragment trampoline with a general variadic
CallVoidMethod trampoline.
- Use UTF-16 for passing strings to Java. Java's modified UTF-8 encoding differ
from Go's in corner cases.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
RegisterFragment creates an instance of a Java class and registers
it as a Fragment in the window's Context.
Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>