[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Mac OS X Port

> Correct me if i am wrong..

I will. :)

> Java-Cocoa is to Cocoa what SWT is to MFC.
> 
> Java-Cocoa  ----->    Cocoa
>          SWT       ------>   MFC
> 
> This means that Apple has done their own implementation of "SWT".

It's a little different. Apple decided to take Java as an important platform 
for Mac OS X. Therefore they wrote the Java bindings for the Cocoa library they 
already had from the NextStep (NS) world. That's the reason why all the Cocoa 
classes are prefixed 'NS'.

> 1) Replace Java-Cocoa by rewriting an SWT layer from scratch. (Most
> work)

Most work, but also most control over what we do! Although I don't know 
Objective-C and native Cocoa library, I already started reading the Objective-C 
tutorial that can be found on the Apple website.

> 2) Write SWT calls over JavaCocoa. (Least work but adds the extra
> layer).

... while inheriting possible bugs in the JavaCocoa layer.
One argument to decide against this approach: SWT widgets need to be disposed 
explicitely. In the Java Cocoa binding, I could not find explicit disposal 
functionality. This means that we have to release the Java Cocoa object when an 
SWT widget dispose method is invoked. Probably it is the Java VM garbage 
collector that invokes the finalize method on the Java Cocoa object wherein 
native resources are released. I do not want to take this approach. One 
forgotten reference to the Java Cocoa object and we have a memory leak...

> 3) Somehow get Apple involved to write SWT calls at the Java-Cocoa 
> level. ( Maybe a pipe dream... who knows, maybe they'll  open source JC
> )

Dreaming is part of a man's life... :)

Ringo
--
Ringo De Smet
ridesmet AT users.sourceforge.net

-------------------------------------------------
This mail sent through Tiscalinet Webmail (http://webmail.tiscali.be)