doppio
doppio copied to clipboard
DOM API for Doppio
We should have a set of APIs for manipulating the DOM and its elements from within a Java program that is executing in Doppio. We should look at the following APIs for inspiration:
- GWT's DOM API
- Mozilla's Java DOM API: Apparently there is an official Java binding specification in the DOM specification.
- dom4j
This includes things such as the canvas element. When we start working on this, we should break it up into sub-issues.
Original Issue Post
This is an amazing project, it really deserves way more users than it has.
Adding some basic graphics support such as a simple wrapper around html5 canvas would go along way toward achieving that goal. Imho this is greatly preferable to trying to wrap an api (awt) that no one uses.
Thanks for the compliment, but we still have a lot of work to do! :smile:
I'm unfamiliar with D2SE, and can't find much information on what that is. The reason we are trying to support awt/Swing is that all Java programs with a GUI (as far as I know) are built on top of it. Without awt/Swing, we won't be able to support any existing Java applications that have a GUI.
D2SE=Lame joke for the Doppio 2 Standard Edition. I guess my point is that I don't use or know of anyone who actually uses a java program with a gui, besides eclipse, I suppose. I understand what you are saying. It is a laudable goal, but I could imagine a doppio specific canvas primitive (perhaps with a native impl) becoming more popular than swing/awt the way that for example, android.graphics.Canvas has.
What about something like a JNI type system for doppio, in the vein of GWTs JSNI, for your users?
You bring up good points.
- GUI Java Applications: Actually, many Java applications are GUIs. Any applet in the browser is a GUI, and there are plenty of legacy applets out there that have not been converted to something like Flash. Java IDEs such as Netbeans and Eclipse are GUI applications. Applet support is the main "killer app" for Doppio, since it would enable people to forgo the Java plugin for most applets.
- JNI: We have yet to think much about JNI, but it's on the roadmap. I'm sure we will look at how GWT has handled this feature, and will determine a suitable approach.
- Canvas primitive: You mean an object that represents the canvas and an API for manipulating it, correct? That is on the roadmap for when we eventually add DOM manipulation APIs to Doppio, but it is not something we will complete soon.
Right now, our main goal is accuracy. Primarily, we are trying to make sure our JVM logic is correct before proceeding to add more non-JVM features to Doppio (such as a Canvas API) or enhancing Doppio's speed. We've had to go back and rewrite various things due to unforeseen correctness bugs, and this is much easier to do when there's less stuff around to switch over. :smile:
In any case, here's what we will need to do before we tackle a Canvas API:
- Make it easier to write native methods (#114). I'm sure this will be used somehow for JNI stuff.
- Determine how we will tackle the boundary between JavaScript/Java, since we should probably use this API for our DOM APIs (canvas included). It's always good to dogfood, and it gives people using Doppio an example to look at.
- Actually implement the API.
Once we accomplish the first two bullets, then it will be much easier for external contributors (such as yourself!) to submit pull requests with potential APIs for browser features. However, fixing correctness bugs are number one on our priority list right now, so we will not get to this for some time.
I'd like to write more, but I have to run. I hope this gives you a decent idea of where development is headed. If you ever feel like contributing somehow, we always welcome pull requests, and I'd be happy to give guidance if you have any questions about Doppio.
That makes sense. Thanks for the detailed response!
No problem! I've modified the issue to one that encapsulates your request, so you'll receive notifications when we start working on it. If you ever feel like contributing, though, don't hesitate to fork and poke at it! :smile: