Preliminary review for MACOSX_PORT-176: AWT Splashscreen support

Anthony Petrov anthony.petrov at oracle.com
Wed Dec 7 07:52:39 PST 2011


Hi Mike and team,

Here's what I've coded up so far:

http://cr.openjdk.java.net/~anthony/x-3-splashAndOSXGUILib.0/

Note that instead of moving the NSApplicationAWT code to the libosxui, I 
instead introduced a new libosxapp. This is because osxui has too many 
dependencies on the AWT while we start the splashscreen even before 
calling user's main() method. Perhaps we could move some code from osxui 
to osxapp eventually, but not at this time.

So, in a nutshell, the libosxapp is now responsible for creating and 
setting up an NSApplicationAWT instance. Note that since the splash 
screen takes off too early, user's code (e.g. SWT) won't be able to 
initialize their own application yet, and as such our application 
instance will be installed. Which means that our splash screen 
implementation is incompatible with SWT-based apps. By this reason I 
also didn't move the start up code from awt.m to the new libosxapp - 
it's simply isn't needed in case the osxapp is used from the splash 
screen code. Is this OK with everyone? Or are there suggestions on how 
to improve this part?

In NSApplicationAWT.m there is an outstanding TODO item: we need to be 
able to install a "caching app delegate" so that we could catch all the 
openFile and other start-up notification, and then call the necessary 
methods manually once a proper application delegate is installed from 
the awt.m code. Note that we need this caching only when the splash 
screen is used. If an app doesn't use the splash screen, then the 
correct delegate is installed right from the start.

Please take a brief look at the fix. Does it look good overall?

I could push it now actually, and continue to work on the mentioned 
above issues separately, or I could complete them first, and then push 
my fix. Note that I'm not sure if the SWT-related issue has any 
reasonable solution at all, but the delegate callbacks caching mechanism 
needs to be implemented sooner or later anyway.

What would be the best to do now?

--
best regards,
Anthony


More information about the macosx-port-dev mailing list