2 messages in net.java.dev.jna.usersRe: [jna-users] Calling Mac Carbon AP...
FromSent OnAttachments
Alan SnyderAug 21, 2008 3:04 pm 
Timothy WallAug 21, 2008 3:48 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Calling Mac Carbon APIs with JNA.Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Aug 21, 2008 3:48:51 pm
List:net.java.dev.jna.users

On Aug 21, 2008, at 6:04 PM, Alan Snyder wrote:

I'd like to use JNA to call the Carbon APIs on the Mac. (OS X 10.3 and later).

I'm stuck on two items currently and would like some advice.

#1) What Native.loadLibrary() call is needed to get Carbon which (with my brief use of Mac) doesn't seem to have an equivalent of dll or so.

"Carbon" (which is found in /System/Library/Frameworks/ Carbon.framework/Carbon).

#2) The Win32 had lots of good utility classes, but I don't know if they are there on the Mac side. For example to call user32.dll in Win32 this seems to be the best way.

public interface GCP_User32 extends StdCallLibrary{

What would be the equivalent for Carbon? Would the following work? Is "extends NativeLibrary" below correct or is there a Mac equivalent of win32's "StdCallLibrary"?

All libraries extend com.sun.jna.Library, although technically this isn't absolutely required.

You should also look at http://rococoa.dev.java.net, which provides for accessing ObjC libraries on OSX.

BTW, recent JVMs provide a java.awt.MouseInfo class (since 1.5) which you can use to query the pointer location.