Re: Any news about Cocoa Java ?
Re: Any news about Cocoa Java ?
- Subject: Re: Any news about Cocoa Java ?
- From: Mike Hall <email@hidden>
- Date: Sun, 03 Oct 2004 13:18:01 -0500
From: Dominik Pich <email@hidden>
>
Will itbe /Is it possible to use cocoa from java without having an ObjC
>
root?
>
>
Now I can:
>
ObjC (main)
>
-> java
>
-> cocoa
>
>
I'd prefer
>
java (main)
>
-> cocoa
>
>
Thanks,
>
Dominik
For my interface I assume you're talking about? My last post contained about everything I know about the standard Cocoa Java interface.
For mine. Yes, it is pretty much driven from the java side. My bias and the nature of JNIDirect. It allows you to basically indicate the native you want to glue to on the java side and then correct JNI direct dynamic libraries are compiled on the file using gcc to link against.
So if I'm understanding you correctly it is the
java (main)
-> cocoa
you say you'd prefer.
Simple example I used in debugging/development.
import macnative.jnidirect.ns.struct.objc_class;
public class nsclass {
public static void main(String [] args) {
System.out.println(new objc_class(objc_getClass((args[0]+"\0").getBytes())));
}
private static native int objc_getClass(byte[] name);
static { jnidirect.Linker.link(nsclass.class, new String[] { "Foundation" }); }
}
So this is a simple java line command run something like...
java -cp jnidirect.jar:linker.jar nsclass NSApplication
glue to the objc_getClass method is generated and goes into a little jnilib for this class in /tmp.
When run I take the returned pointer and construct a new java class with it that knows about the ObjectiveC class should look and gives me a nice display to see what a real one like NSApplication looks like or how close a made up Cocoa class of mine looks like a real one.
Being able to make ones up that Cocoa will work with is about the biggest addition I have made to what the JNIDirect author Patrick Beard already had defined. At least as far as what I have added as quality. I have also added a fair amount of just quantity in classes mapping to Cocoa defined. Cocoa is a large API though and that is still a long ways from all of Cocoa mapped or anywhere near what the Apple Cocoa Java defines.
If you want more information specific to my stuff off-list might be best. I can't really do much with it right now as my one personally owned Mac is down and I can't do anything about it for the moment.
Mike Hall mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden