Friends of Eclipse,
Eclipse is an open source community that benefits millions of developers around the world each and every day! During the month of September, we are asking you to give back to our wonderful open source community. All donations will be used to improve Eclipse technology. Your contribution counts!
We thank you for this gesture, and for giving back to our community.
All of the C code used by SWT is generated by the JNIGeneratorApp application included in the SWT Tools bundle and available on the SWT Tools Update Sites. This page describes how to use this tool when fixing bugs or adding features to SWT.Note that this process has changed for SWT 3.5. For older versions see Generating the SWT JNI Code for SWT 3.4.
Often, methods return values or require parameters as a C struct. To add a new structure, simply add a new class in the same package as the OS.java file which matches the definition of the C structure. This will be picked up and correctly handled by JNIGeneratorApp.
If a struct is input-only or output-only, this information can be used by JNIGeneratorApp to generate more efficient C code. Use the flags attribute of the native function to indicate this in the metadata.
And there you go! If you're having trouble, please post to the SWT mailing list or file a new bug in bugzilla.
Back to the top