Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] MacOS X port status?

Hey,

On 11/22/01 2:34 PM, "ilyanov@xxxxxxx" <ilyanov@xxxxxxx> wrote:

> Hi Ringo,
> 
> I am just waiting till the week end before we tally up the vote. It
> seems there is substantial interest in doing the CarbonSWT port. However
> I do feel that Cocoa is an option that should be considered. I think we
> need to work out the details of how the two approaches would map to SWT
> and conclude firmly which approach is the best. I still do feel that
> Carbon would map best to SWT. And I am willing to devote time (a day or
> two a week) to detailing how well it maps. Could some one else do the
> same for Cocoa?

If you want to do a straight port of SWT, Carbon is probably the easiest
path to getting that done.  That's because the current SWT implementation
are designed to work with a procedural API.  The amount of work involved
would be roughly the same as any port of a medium sized program from Windows
to the Mac.  This doesn't mean that this is the best way to get SWT on the
Mac.

But let's think outside the realm of a traditional SWT port.

    The SWT component is designed to provide efficient,
    portable access to the user-interface facilities of
    the operating systems on which it is implemented.

Full definition here:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/ma
in.html

The Cocoa API's in their current form supply 2 out of 3 of the most basic
SWT design elements.  The missing one is "portable".  Portable is a big one
for me.  I want to run Eclipse on Mac OS X.  What is the best way to get
there?  Write a SWT compatibility layer for Cocoa.

This has the advantage providing a thinner Java layer than your typical SWT
port.  This is because Cocoa is an advanced Object Oriented API that maps
very closely to SWT. (In most cases the mapping is a one-to-one match.  For
example Display maps to NSApplication and Shell maps to NSWindow.)  The
thinner layer means less code to write, less code to maintain, and less code
to debug.

http://www.vineyardenterprise.com/BlackMoon.tar.gz

The above link is source code for a Cocoa/SWT compatibility layer that can
run HelloWorld2 from the SWT Examples.  It is a proof-of-concept that
demonstrates how the Cocoa API's can make the task of getting Eclipse on Mac
OS X faster and easier.  I wrote all the code in Java and had no previous
experience with either Cocoa or SWT.

You need Project Builder installed to build the above code.  The code is
still very rough and there are some know problems.  The HelloWorld
ResourceBundle can't be found in the classpath.  This is a packaging problem
that I didn't want to waste a lot of time on yet.  The other problem is that
the label retains a reference to NSTextField when the Window is destroyed by
the OS.  This will cause the program to segfault.  This issue will be
resolved when the full dispose() infrastructure is in place.

-Maurice




Back to the top