Given that there are compiled versions of the JavaFX SDK for mobile (iOS and Android), how feasible is it to generate Scala bindings from those files, and be able use them from a Scala-Native application?
2 Answers
I don;t have any specific knowledge on JavaFX in particular. Neither I've tried to compile it to a native library. However, there's a general answer:
Given you have a native library which adheres to
C
calling conventions (which means that you can call easily fromC
), you can call it easily fromScala Native
too.
In a nutshell, all you have to do is defining the bindings for it. And I suppose it is where problems start and (I suppose) it is the context of your question. Rephrasing your question:
Can I automagically generate bindings for JavaFX?
Well... it depends... if you have a header file (.h
)... the answer is: very probably yes. Otherwise: no, scala-bindgen
does not understand anything else.
Note: at the time of this writing, scala-bindgen
is still a work in progress and not yet really usable.

- 5,675
- 2
- 44
- 50
-
Eduardo: Please let me know if there's some sort of JavaFX.h or something like that. This use case would be very interesting in the testsuite of ``scala-bindgen``. – Richard Gomes Jul 17 '16 at 13:35
-
I have done a bit of digging and have found nothing. RoboVM was able to do it, but I have been unable to understand how by looking at their source code, or JavaFX's source code. – Eduardo Jul 17 '16 at 23:10
No, Scala Native currently doesn't provide JavaFX API.

- 436
- 1
- 6
- 10
-
1I know it is currently not possible to use the JavaFX library, as is, from a standard Java distribution. My question was about the library in its compiled form to native code, which already exists, and has been used before with RoboVM. – Eduardo Jul 13 '16 at 20:22