----- Original Message -----
From: "Richard Otero" <rich...@gmail.com>
To: <use...@jna.dev.java.net>
Sent: Tuesday, November 13, 2007 4:29 AM
Subject: [jna-users] Attempting to access GNU Triangulated Surface Library
through JNA
I believe that I would have to create classes that extend Structure
for GtsSurface, GtsSurfaceClass, GtsFaceClass, GtsEdgeClass,
GtsVertexClass and onwards recursively until I get to inputs such as
double, int, char, etc. Wanted to make sure of this before I got too
deep.
Check carefully if you really need to map the internals of these structures,
or whether you can manipulate them as opaque pointers using the functions
provided by the library.
If you can use opaque pointers, you'd do something like this:
import com.sun.jna.Pointer;
import com.sun.jna.PointerType;
public class GtsWhateverPointer extends PointerType {
public EnginePointer() {
}
public EnginePointer(final Pointer p) {
super(p);
}
}
And then wrap your functions like this:
GtsSurfaceClassPointer gts_surface_class();
GtsSurfacePointer gts_surface_new(GtsSurfaceClassPointer klass, /* etc */);
Do I have to include the functions that I believe I would need a Callback
for?
Hopefully the library will allow you to set the pointers for which you need
to configure a callback using some other function in the library.
Hope this helps.
Cheers,
Albert