Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] How to return NSSize from a Cocoa callback?


Hi Mikhail,

I think the following will work:

-> add native method OS.memmove(int, NSPoint, int)
    -> (just copy the existing OS.memmove(int, NSRect, int) method and change the type of the second parameter)
-> regenerate the natives with the JNIGenerator tool
    -> (get the tool from CVS HEAD project: org.eclipse.swt.tools)
    -> (tool description: http://www.eclipse.org/swt/jnigen.php)
-> compile the swt libraries:
    -> remove target $(XULRUNNER_LIB) from the "all" target in /org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
    -> invoke /org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.xml target: build_cocoa_lib
-> in your method:
    -> int result = OS.malloc(NSPoint.sizeof);
    -> OS.memmove(result, <yourNSPoint>, NSPoint.sizeof);
    -> return result;

If one of these steps gives you a problem then please follow up.

HTH,
Grant

Back to the top