Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] OSX port

Hi Greg,
Yes, I've tried JDirect for my MacOSX port of SWT.

I dropped it because I could not reliably and completely control
the Carbon event handling from Java.
For example menu bar events were processed even if I stopped my
classic (WNE based) event loop in Java.

This did not happen when running the same application under JNI.
It seems that the use of JDirect triggers some event handling
that interferes with any attempts to control the event loop solely from Java.

On a Mac mailing list I found some information that the best way to get
event processing right when using JDirect was to include the statement
"new java.awt.Frame().pack()" at the very beginning of your program.
This did not increase my confidence in JDirect for use in non-AWT applications.

After a week of investigation I gave up with JDirect and switched to JNI.
Since then I had no further problems whatsoever. In addition writing a few
very thin C-stubs is probably the smallest problem when porting SWT :-)

BTW: Tomorrow I will make the latest version of my port available.

--andre


Question to those working on the Carbon implementation of the OSX SWT port.
I know that the guidelines recommend using JNI and thin C passthrough calls
to native libraries to implement the SWT, but I was wondering if you had
considered using JDirect. I've been reading up on it, and it seems like it
might be an quicker and easier way to port SWT to OSX since it doesn't
require writing any native code at all. If you did consider it, I'd like to
know what you see as the disadvantages, since the current port does not
appear to use it. If not, do you think it is worth looking into further?
Greg

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top