I have a silly question... Why it is not possible ...
# tornadofx
v
I have a silly question... Why it is not possible to create Kotlin's own graphical platform like JavaFX? How does it work under the hood? To make some code for widgets work, I had to add
fxrt.jar
. I suspect that it's just a tip of the iceberg. All those classes inside
fxrt.jar
they do call some specific code in JVM, don't they?
c
Of course it's possible, it's just noone is interested enough to actually do it 🙂
v
No commercial interest? Android uses it's own graphical system, servers do not need it as well as JS, right?
But I wonder, how difficult is it? It would be good to have some graphical toolkit, that could be used in JVM as well as in native
c
Well, difficulty is relative, thing is JFX is pretty good at what it does and is cross-platform enough. For native people frequently prefer native toolkits, like QT for example. So I'd say yeah, no commercial interest (at least I haven't heard about anyone interested).
c
There's native code too like javafx_font.dll, javafx_iio.dll, jfxmedia.dll, and jfxwebkit.dll
v
Hmm, so bytecode in JVM calls functions from native libraries. The code from
fxrt.jar
compiles into that bytecode, right? Or there's one more layer between `dll`s/`so`s and
fxrt.jar
contents, like some compiler features?
I have missed something... JARs already contain bytecode in .class, so no compiler features are required
c
there's a windowing layer. something needs to translate the JavaFX "new Stage" into the Window's DLL call CreateWindow() or the Linux .so GTK call gtk_application_window_new() or the .so showWindow in a Mac
v
Aren't those `j*fx*.dll`s? Not sure what're their names in Linux Found in
java-openjfx
package, but no name gives a clue what lib is responsible for calling Gtk+ functions
c
These are linux dynamically linked libraries (Shared Object files)
v
I've found that
libglass.so
deals with Gtk+ windowing functions in OpenJFX