On Sep 16, 2011, at 7:44 AM, Kurt Miller wrote: > On Friday 16 September 2011 03:23:10 am Konstantin Tokarev wrote: > >> Seems like I've found possible reason for crash: JNA uses >> JAWT_MacOSXDrawingSurfaceInfo struct, but we don't provide it. Unmodified >> JNA just fails to compile. >> >> Code fragment from JNA: >> >> #elif __APPLE__ >> // WARNING: the view ref is not guaranteed to be stable except during >> // component paint (see jni_md.h) >> JAWT_MacOSXDrawingSurfaceInfo* mdsi = >> (JAWT_MacOSXDrawingSurfaceInfo*)dsi->platformInfo; >> if (mdsi != NULL) { >> handle = (unsigned long)mdsi->cocoaViewRef; >> if (!handle) { >> throwByName(env, EIllegalState, "Can't get Cocoa View"); >> } >> } >> else { >> throwByName(env, EError, "Can't get OS X platform info"); >> } >> #else >> JAWT_X11DrawingSurfaceInfo* xdsi = >> (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo; >> if (xdsi != NULL) { >> handle = xdsi->drawable; >> if (!handle) { >> throwByName(env, EIllegalState, "Can't get Drawable"); >> } >> } >> else { >> throwByName(env, EError, "Can't get X11 platform info"); >> } >> #endif > > Check the Max OS X port for that function. Mac OS X is built on-top > of bsd-port, meaning they merge bsd-port changes into their tree from > time to time and then add Cocoa based UI on top. > > I'm thinking that we've not gotten far enough into loading jna to hit > that missing function. We're crashing very earily. The code for > JNI_OnLoad in jna is here: > > https://github.com/twall/jna/blob/master/native/dispatch.c
Actually, the macosx-port doesn't have the JAWT API implemented yet, and it won't be vending a Cocoa NSView* when we do get around to implementing it. We actually won't be providing an pointer to the underlying window or view hierarchy, because it could exist in a separate process. Instead, JAWT clients will be expected to provide a CoreAnimation layer that they want placed on top the AWT component they are covering. We will then take that and link it up across processes to form a coherent render tree. FYI, Mike Swingler Java Engineering Apple Inc.