Time for a crazy java question. My goal is to do in Java/AWT/X11 what happens in vroot.h: find the ID of an existing window and use that ID to draw in that window. Easy to do in C. But Java necessarily covers that up. I believe all I need to do is take the line below and replace the call to XCreateWindow and just assign the window ID I have. https://github.com/openjdk/client/blob/master/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java#L380 The question is how to do that without patching AWT itself.
I think I can do that by extending all of the classes in this tree? Class XWindowPeer
sun.awt.X11.XBaseWindow <-- XCreateWindow happens here
sun.awt.X11.XWindow
sun.awt.X11.XComponentPeer
sun.awt.X11.XCanvasPeer
sun.awt.X11.XPanelPeer
sun.awt.X11.XWindowPeer Why not copy paste those classes and put a 2 on the end?
No need to be smart particuarly
I guess? I was going to call them, for example, XForeignBaseWindow
I've pretty much tried that but keep running into compile issues
symbol: class ForeignComponentPeer
/home/robbie/Wrkspc/jnatest/src/java/XForeignComponentPeer.java:112: error: cannot find symbol
XForeignComponentPeer (XCreateWindowParams params) {I put this in project.clj: *:java-source-paths* ["src/java","/home/robbie/Git/openjdk-client/src/java.desktop"]
Hrm I got some improvement by changing java source paths to:
openjdk-client/src/java.desktop/unix/classes
openjdk-client/src/java.desktop/unix/native
openjdk-client/src/java.desktop/share/classesKeep getting stuck on this:
src/java/XForeignComponentPeer.java:1162: error: cannot find symbol
protected boolean isEventDisabled(XEvent e) {
^
symbol: class XEvent
location: class XForeignComponentPeer
Here's an attempt to separate out just the Java parts https://github.com/robbieh/AWTForeignXWindow/