Skip to main content

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

Hey,

On 11/13/01 1:24 PM, "Veronika Irvine/OTT/OTI" <Veronika_Irvine@xxxxxxx>
wrote:

> 
> Checked out JDirect at
> http://developer.apple.com/techpubs/java/pdf/JDirect_MRJ2.1.pdf.
> JDirect looks like a classic Platform Interface implementation - very much
> like what SWT has implemented on other platforms.

I think your looking at pre-OS X documentation.  Look here for notes on the
differences between JDirect2 and JDirect3.

http://developer.apple.com/technotes/tn/tn2002.html

> The things I would be interested to know are:
>       Is it tied to one VM or does it use JNI under the covers? - How many
> Java VMs are available for the Mac?

According to the link I gave you it does really use JNI (at least JDirect3
for OS X).  The only VM that I am aware of is licensed from Sun.  Straight
from the commandline:

% java -version
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.3.1-root-010902-18:51)
Java HotSpot(TM) Client VM (build 1.3.1, mixed mode)

 
>       Will it give us access to the Aqua API?

I think you can use JDirect3 or JNI to access the procedural Carbon API's.
These are the API's that Apple added to NextSTEP (which became Mac OS X) to
aid in migrating legacy Mac applications and to give C programmers an
Application API.

The original NextSTEP API's are now called Cocoa.  They are an Object
Oriented API coded in Objective-C.  Apple provides the Java Bridge which
allows Java developers to access Objective-C code using JNI. Details on how
this works can be found here:

http://developer.apple.com/techpubs/macosx/Cocoa/ProgrammingTopics/JavaBridg
e/JavaBridge.html

And the release notes:

http://developer.apple.com/techpubs/macosx/ReleaseNotes/JavaCocoaAPIs.html

Apple supplies the stubs for the Cocoa API's so that you don't have to
generate them yourself.  If I were to create the stubs myself I couldn't get
them any thinner.  I don't think you can get around the fact that you need
the Java Bridge to talk to Objective-C through JNI.

Cocoa and Carbon are peer API's on Mac OS X.  Cocoa is the original API for
the core Mac OS X and is the most stable and mature of the two API's.
Carbon is an older API, but is more recently implemented on the core of Mac
OS X.  Since Mac OS X 10.1, both are production API's.

To recap:
  
--Cocoa is an Object Oriented API and it's native language is Objective-C.
--Carbon is a procedural API and it's native language is C.

--Cocoa can be accessed from Java using the Java Bridge (which utilizes JNI)
and the pre-generated stubs.
--Carbon can be accessed from Java using JDirect (which utilizes JNI) or JNI
itself using SWT-style stubs.

--When programming Cocoa, skills related to the NextSTEP/OpenSTEP family
would be beneficial.  Only Java skills are needed.
--When programming Carbon, skills related to the Classic Mac OS family would
be beneficial.  C & Java programming skills would be required.

-Maurice



Back to the top