Nib translator program You build this program using NeXT's cc. However, it links against the libgnuarchive library which must be built separately. See the gnuarchive directory. The syntax for using the program is: ./trnib <.nib directory> [<outputfile>] If outputfile is not given, the n input file name with suffix changed to .xmib is used. e.g, .trnib MatrixTest.nib This program has no documentation apart from this file. The purpose of this program is to translate an object archive file created by the InterfaceBuilder into an object archive file that can be read with the objcX class library for X/Motif with GNU Objective-C archiving format. The way it works is the following... - For each class we wish to capture, a category extension has been written. These are the Xmxxxx.m files. These categories overwrite some methods in the NeXT classes so we can capture information. These will include objc/typedstream.h from /usr/include AND objc/typedstream.h from GNU runtime. The former will come from NeXT's Object.h, while the later is needed for the category. - NXApp reads the .nib file. The -awake method is sent to each object so we can capture the list of Windows, Panels, and CustomObjects in one list and the IBConnectors in another. The idea to do this came from someone on usenet after we posted a question on how to do it. Regretfully, we've forgotten his name. - We then send to the list of objects, a message -convertCoordToMotif if the object implements it. This method is in the category. This method converts the y coordinate to one that works with Motif coordinate system where x,y =0,0 is upper left. Also, any minor adjustments in size is taken care of. - We then write out with GNU archiving the list of objects and the list of IBConnenctors using the -write: method implemented in the Category extension. - flush the output stream, close the file and it's done. The created GNU object archive file can be read by the -loadNibFile: method of the Application class in the objcX class library using the -read: method of each of the classes of that library. Obviously, changes to the -write: methods here need to have corresponding changes to the -read: methods in objcX. One compiles this program with cc or gcc. There are a few warning messages about not being able to use precompiled header files with cc. The translator links to the library ../m68k_obj/libgnuarchive.a which can be built separately. Questions and comments on this program can be directed to me: Paul Kunz Paul_Kunz@slac.stanford.edu Stanford Linear Accelerator Center Stanford University
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.