embedding xpcom browser in osx awt
Scott Cytacki <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Message-ID | <1177090860.8954.22.camel__27928.2880634584$1177090907$gmane$org@localhost> |
Has anyone been able to embed the xpcom browser in an awt component on osx? I worked on this a bit about 1 month ago. Here a page I created at the time: http://confluence.concord.org/display/CCTR/Embedding+XPCOM+in+OSX Sorry it is probably too confusing to be useful. In the end I was trying to get it to work with a debug version of the 1.8 xpcom. I found assertions happening because the DeviceContext was not created on the NS event thread. The NS event thread I'm referring to is the one which handles native OSX paint events. The DeviceContext is created when XPCOM code is initialized. (I don't remember the exact method that caused it to be created) I was doing XPCOM initialization in the java application main method but the main method is run on a different thread than the NS event thread (in AWT). I could not see a simple way to execute the XPCOM initialzation code on the NS event thread. The best way I came up with was writing a NSView which was used by a CocoaComponent in Java. This NSView would be written to call back to Java in response to messages sent to it from the CocoaComponent. This would allow me to run the XPCOM initialization code on the NS event thread. I haven't got around to trying this. Scott