[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] natives with project builder.
|
Can some kind soul send me a working project builder project with a
java class which defines a native and the matching C code? I'm sorry
for being such a dolt, but I'm still wrestling with PB, and I'd
rather be hacking Carbon. ;-)
OK, after lots of experimenting with a
- Cocoa
- Carbon & JDirect
- Carbon & JNI
based SWT version I'm pretty sure that "Carbon & JNI" is the way to go.
At first SWT in Cocoa seemed to be simple because everything is Java,
however there were quite a few issues for which I had no good
solution. The most important ones: performance and robustness. I will
post the Cocoa version together with some analysis in the next couple
of days.
After working on the Cocoa version (and getting major parts of
StyledText and Tree to work), I started a JDirect based Carbon
version of SWT.
JDirect seemed to be easier to use than JNI because Carbon natives
can be called without
writing any C code. However, when writing an event loop based
application I got some strange interaction with an AWT (?) event
thread and event delivery was not reliable. In addition getting all
the C constant definitions on the Java side is a major pain.
So a week ago I gave up and started a JNI based Carbon version.
First I wrote the enclosed (WaitNextEvent based) application and
everythings seems to work faster,
more reliable, more predictable, and I don't get any interaction with
AWT event processing.
Today I got something similar to SWT Composites and Scrollables up
and running in Carbon (using UserPartControl and a Control embedding
hierarchy). After some cleanup I'll post that on the weekend.
--andre
Attachment:
SWT_MacOSX.sit
Description: Mac BinHex archive