DIRECTORY CD, CDDirectory, CDIO, CDMenus, CDProperties, CDRemote, CDSequencer, PW, Rope, TerminalIO; CDBringoverCmd: CEDAR PROGRAM IMPORTS CDDirectory, CDIO, CDMenus, CDProperties, CDRemote, PW, Rope, TerminalIO = BEGIN ROPE: TYPE = Rope.ROPE; libraryProp: ATOM _ PW.RegisterProp[$CDBringoverLibraryName, TRUE]; Bringover: PROC [comm: CDSequencer.Command] = { libFileName: ROPE _ TerminalIO.RequestRope["Library Name: "]; lib: CD.Design _ CDIO.ReadDesign[libFileName]; designName: ROPE _ lib.name; ForEachLibOb: CDDirectory.EachEntryAction = { -- ob from lib found: BOOL; targetOb: CD.Object; [found, targetOb] _ CDDirectory.Fetch[comm.design, name]; IF ~found THEN { copyOfLibObject: CD.Object _ CDRemote.Get[comm.design, designName, name]; PW.AppendProps[copyOfLibObject, ob]; CDProperties.PutPropOnObject[copyOfLibObject, libraryProp, libFileName]; TerminalIO.WriteRopes["Adding ", name, "\n"]; } ELSE { prop: ROPE _ NARROW [CDProperties.GetPropFromObject[targetOb, libraryProp]]; IF prop=NIL THEN RETURN; -- ob does not carry the prop IF Rope.Equal[libFileName, prop, FALSE] OR TerminalIO.Confirm["Replace object?", Rope.Cat[name, " not from same library"]] THEN { copyOfLibObject: CD.Object _ CDRemote.Get[comm.design, designName, name]; PW.AppendProps[copyOfLibObject, ob]; CDProperties.PutPropOnObject[copyOfLibObject, libraryProp, libFileName]; CDDirectory.ReplaceObject[comm.design, targetOb, copyOfLibObject]; IF ~CDDirectory.Remove[comm.design, name, targetOb] THEN ERROR; IF ~CDDirectory.Rename[comm.design, copyOfLibObject, name, FALSE] THEN ERROR; TerminalIO.WriteRopes["Replacing ", name, "\n"]; }; }; }; IF lib=NIL THEN ERROR; -- can't find the file, turkey [] _ CDDirectory.Enumerate[lib, ForEachLibOb]; TerminalIO.WriteRope["Done\n"]; }; CDMenus.ImplementEntryCommand[menu: $IOMenu, entry: "Bringover", p: Bringover, key: $SelectGroup, queue: doQueueAndMark]; END. \CDBringoverCmd.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Pradeep Sindhu February 10, 1986 7:13:45 pm PST Louis Monier February 7, 1986 7:45:03 pm PST Bertrand Serlet February 11, 1986 0:36:01 am PST This property hangs on an object. Its value is the name of the library (.dale file). Public functions Initialization Κk– "cedar" style˜codešœ™Kšœ Οmœ1™