Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!cbmvax!carolyn From: carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) Newsgroups: comp.sys.amiga Subject: Re: Need help with .info files Message-ID: <1260@cbmvax.cbmvax.cbm.UUCP> Date: Tue, 20-Jan-87 17:44:48 EST Article-I.D.: cbmvax.1260 Posted: Tue Jan 20 17:44:48 1987 Date-Received: Wed, 21-Jan-87 04:01:17 EST References: <2269@jade.BERKELEY.EDU> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner) Organization: Commodore Technology, West Chester, PA Lines: 73 In article <2269@jade.BERKELEY.EDU> spencer@eris.BERKELEY.EDU () writes: >Well, perhaps I am behind the times, but I don't know where to go in the >manuals to find information on the .info file structure. I don't know >what is wrong with me, I just don't ever remember coming across it. I >am trying to read the icon files and display their graphic on my own screen. See the "Workbench" chapter of the Rom Kernel manual. It describes .info's. I was originally apprehensive about working with them but it was all MUCH easier than I thought it would be. Basically... ... #include #include ... ULONG IconBase = NULL; struct DiskObject *obj; ... main() { char *filename; ... if(!(IconBase=OpenLibrary("icon.library",0))) yourabort(); filename = "whatever"; /* name of file minus '.info' */ if(!(obj=(struct DiskObject *)GetDiskObject(filename))) yourabort(); /* If successful, GetDiskObject() has allocated a struct DiskObject * and filled it in from the .info file. See workbench.h for a * description of the DiskObject structure. The DiskObject structure * contains a whole embedded Gadget structure. The GadgetRender * field of the Gadget points to the Image structure for the icon. * The really nice thing is how simple it is to modify DiskObjects. * All you have to do is use the obj pointer returned by GetDiskObject() * to modify the pointers, flags etc. in the structure. Then use * PutDiskObject(filename,obj) to write out the .info. Filename * can be the same name, or the name of a different file you wish * to create an icon for. The magic part is that PutDiskObject() * grabs all of the things pointed to by the DiskObject structure * and drags them along into the .info file. This is how I did * IconMerge (1.2 Extras disk). I just Get two DiskObjects, * put the GadgetRender pointer of the second in the SelectRender * field of the first, replace any existing highlighting flags * for the first with GADGHIMAGE, and Put the first one back out * under a new name. Then FreeDiskObject(obj) the original two. */ ... /* do your stuff, PutDiskObject(filename,obj) if you wish */ cleanup() } yourabort() { cleanup(); exit(0); } cleanup() { if(obj) FreeDiskObject(obj); if(IconBase) CloseLibrary(IconBase); ... } -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CBM >>Amiga Technical Support<< UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=