DIRECTORY AdobeCommon, AdobeCommonInternal, AdobeOps, IO, Rope USING [Cat, Equal, ROPE], ViewerClasses USING [Viewer]; AdobeCommonImplA: CEDAR MONITOR IMPORTS AdobeCommon, IO, Rope EXPORTS AdobeCommon, AdobeOps = { FormIndex: TYPE = {tool, another, destroy, change, newSystem}; ToolState: TYPE = {active, inactive}; ToolStateProc: TYPE = PROCEDURE[inState: BOOLEAN] RETURNS [didIt: BOOLEAN]; ToolStateHandle: TYPE = REF ToolStateType; ToolStateType: TYPE = MONITORED RECORD[ lock: MONITORLOCK, activeTools: CARDINAL ¬ 0, toolList: ToolList ¬ NIL, inactiveTools: CARDINAL ¬ 0]; ToolList: TYPE = REF WindowOfTool; WindowOfTool: TYPE = RECORD [ w: AdobeCommon.Handle ¬ NIL, next: ToolList ¬ NIL]; stateInfo: ToolStateHandle ¬ NIL; --Public herald names editHeraldName: PUBLIC Rope.ROPE ¬ NIL; editCkdOutHeraldName: PUBLIC Rope.ROPE ¬ NIL; submitHeraldName: PUBLIC Rope.ROPE ¬ NIL; reportHeraldName: PUBLIC Rope.ROPE ¬ NIL; queryHeraldName: PUBLIC Rope.ROPE ¬ NIL; sortHeraldName: PUBLIC Rope.ROPE ¬ NIL; queryListHeraldName: PUBLIC Rope.ROPE ¬ NIL; sentinal: AdobeCommon.LockedSysDescPtr ¬ NIL; GetDescList: PUBLIC PROCEDURE[] RETURNS [descListHead: AdobeCommon.LockedSysDescPtr] = { RETURN[sentinal]}; GetData: PUBLIC PROCEDURE [w: REF ANY] RETURNS [AdobeCommon.Handle] = { RETURN [NIL]}; GetDataSW: PUBLIC PROCEDURE [sw: REF ANY] RETURNS [AdobeCommon.Handle] = { RETURN [NIL]}; PostMessage: PUBLIC PROCEDURE[handle: AdobeCommon.Handle, postCR: BOOL, message: Rope.ROPE] = { IF handle.messageViewer.reportStream # NIL THEN { handle.messageViewer.reportStream.PutF1["%g", IO.rope[message]]; IF postCR THEN handle.messageViewer.reportStream.PutRope["\n"]; }; }; SetTinyName: PUBLIC PROCEDURE [toolData: AdobeCommon.Handle] = { SetEditLine: PROCEDURE RETURNS [Rope.ROPE ¬ NIL] = INLINE { instanceData: AdobeCommonInternal.InstanceDataHandle ¬ NARROW[toolData.instanceData]; WITH instanceData SELECT FROM editData: REF AdobeCommonInternal.InstanceData.edit => IF editData.checkedOut THEN RETURN["**Edit**"] ELSE RETURN["Edit"]; ENDCASE; }; name: Rope.ROPE ¬ "Adobe"; name2: Rope.ROPE ¬ SELECT toolData.tool FROM edit => IF toolData.instanceData = NIL THEN "Edit" ELSE SetEditLine[], submit => "Submit", report => "Report", query => "Query", sort => "Sort", queryList => "QueryList", ENDCASE => NIL; toolData.setMainName[toolData.outer, Rope.Cat[name, " ", name2]] }; PostNumber: PUBLIC PROCEDURE [sw: AdobeCommon.Handle, postCR: BOOLEAN, number: CARD] = { IF sw.messageViewer.reportStream # NIL THEN { sw.messageViewer.reportStream.PutF1["%g", IO.card[number]]; IF postCR THEN sw.messageViewer.reportStream.PutRope["\n"]; }; }; MakeHeraldNames: PROCEDURE = { editHeraldName ¬ "Adobe Edit "; editCkdOutHeraldName ¬ "Adobe Edit **checked out** "; submitHeraldName ¬ "Adobe Submit "; reportHeraldName ¬ "Adobe Report "; queryHeraldName ¬ "Adobe Query "; sortHeraldName ¬ "Adobe Sort "; queryListHeraldName ¬ "Adobe Query List "; }; ChangeTools: PROCEDURE [toolData: AdobeCommon.Handle] RETURNS [did: BOOL ¬ TRUE]= { arSH: AdobeOps.ARSystemHandle; instanceData: AdobeCommonInternal.InstanceDataHandle ¬ NARROW[toolData.instanceData]; IF toolData.isBusy THEN { AdobeCommon.PostMessage[toolData, TRUE, "Can't change tools while busy!"]; RETURN[FALSE]}; WITH instanceData SELECT FROM inst: REF AdobeCommonInternal.InstanceData.edit => IF inst.checkedOut THEN { AdobeCommon.PostMessage[toolData, TRUE, "Can't change tools while AR checked out!"]; RETURN[FALSE]}; inst: REF AdobeCommonInternal.InstanceData.submit => IF inst.formDirty THEN { AdobeCommon.PostMessage[toolData, TRUE, "Form has been edited! Click to confirm!"]; RETURN[FALSE] } ENDCASE; IF toolData.context # NIL THEN { --there is something to free arSH ¬ toolData.context.arSH; }; }; RemoveSystemFromKnownSystems: PUBLIC PROCEDURE[name: Rope.ROPE, systems: AdobeCommon.SystemsHandle] = { FOR i: CARD IN [0..systems.next) DO IF Rope.Equal[systems.system[i], name, FALSE] THEN { FOR j: CARD IN [i+1..systems.next) DO systems.system[j-1] ¬ systems.system[j]; ENDLOOP; systems.next ¬ systems.next - 1; EXIT; }; ENDLOOP; }; nilPossibilities: PUBLIC AdobeOps.EnumeratedSequence; Init: PROCEDURE = { nilPossibilities ¬ NEW[AdobeOps.EnumeratedSequenceType[1]]; nilPossibilities[0] ¬ ["Nil", AdobeOps.nilEnum]; }; Init[]; }. r AdobeCommonImplA.mesa Copyright Σ 1990, 1991, 1992 by Xerox Corporation. All rights reserved. Philip James, March 10, 1992 10:59 am PST Christian Jacobi, April 7, 1992 5:49 pm PDT Foote, June 24, 1992 9:16 am PDT Type declarations Global Variable declarations linked list of current system descriptions Provide the sentinal to outside clients (never used by us) Find the instance data, given a window handle Find the instance data, given a subwindow handle , v1, v2, v3: IO.Value _ [null[]]] toolData.outer.label _ Rope.Cat[name, " ", name2]; formItem: FormSW.ItemHandle; formItem _ FormSW.FindItem[instanceData.formSW, index]; formItem.flags.invisible _ TRUE; toolData.tool _ oldValue; formItem.flags.invisible _ FALSE; FormSW.DisplayItem[sw, index]; formItem ¬ FormSW.FindItem[instanceData.formSW, index]; formItem.flags.invisible ¬ TRUE; toolData.tool ¬ oldValue; formItem.flags.invisible ¬ FALSE; FormSW.DisplayItem[sw, index]; oldCursor: Cursor.Type _ Cursor.GetInfo[].type; Cursor.Set[mouseRed]; IF UserInput.WaitForConfirmation[].okay THEN Cursor.Set[oldCursor] ELSE { formItem _ FormSW.FindItem[instanceData.formSW, index]; formItem.flags.invisible _ TRUE; toolData.tool _ oldValue; formItem.flags.invisible _ FALSE; FormSW.DisplayItem[sw, index]; Cursor.Set[oldCursor]; } MsgSW.Clear[toolData.msgSW]; AdobeCommon.DestroyOtherSWs[toolData]; want to hang on to same ARSystemHandle AdobeToolContext.FreeUserContext[@toolData.context, toolData.heap]; toolData.context _ AdobeToolContext.InitializeUserContext[arSH, toolData.tool, toolData.heap] AdobeCommon.CreateOtherSWs[toolData]; EnableAdobeAborts[toolData.window]; Mainline code Κx–(cedarcode) style•NewlineDelimiter ™šœ™Jšœ Οeœ=™HJ™)J™+J™ —Icode˜šΟk ˜ Kšœ ˜ Kšœ˜K˜ Kšžœ˜Kšœžœžœ˜Kšœžœ ˜—K˜šΟnœžœžœ˜ Kšžœžœ˜Kšžœ˜!K˜Jšœ™Kšœ žœ/˜>Kšœ žœ˜%Kš œžœž œ žœžœžœ˜KKšœžœžœ˜*šœžœž œžœ˜'Kšœž œ˜Kšœ žœ˜Kšœžœ˜Kšœžœ˜—Kšœ žœžœ˜"šœžœžœ˜Kšœžœ˜Kšœžœ˜K˜—Jšœ™Kšœžœ˜!K˜K˜K˜'K˜-K˜)K˜)K˜(K˜'K˜,K˜Jšœ*™*Kšœ)žœ˜-K˜Jšœ:™:šŸ œžœž œžœ1˜YKšžœ ˜—K˜Jšœ-™-š Ÿœžœž œžœžœžœ˜GKšžœžœ˜—K˜Jšœ0™0š Ÿ œžœž œžœžœžœ˜JKšžœžœ˜—K˜KšŸ œžœž œ:ž˜\Jšœžœ™#šœ˜šžœ%žœžœ˜1Kšœ.žœ˜@šžœž˜K˜0—K˜—K˜K˜—KšŸ œžœž œ#˜@˜š Ÿ œž œžœžœžœžœ˜;Kšœ7žœ˜Ušžœžœžœ˜šœ žœ*˜7Kšžœžœžœ ˜.Kšžœžœ ˜—Kšžœ˜—K˜K˜—Kšœ žœ ˜šœ žœ˜šžœž˜Kš œžœžœžœžœ˜FK˜K˜K˜K˜K˜Kšžœžœ˜——K˜@J™2K˜—K˜š Ÿ œžœž œ"žœ žœ˜Yšžœ!žœžœ˜-Kšœ*žœ˜;šžœž˜K˜,—K˜—K˜K˜—šŸœž œ˜K˜K˜5K˜#K˜#K˜!K˜K˜*K˜—K˜š Ÿ œž œ žœžœžœ˜SK˜J™Kšœ7žœ˜Ušžœžœ˜Kšœ"žœ$˜JJ™7Jšœžœ™ J™Jšœžœ™!J™Kšžœžœ˜—šžœžœž˜šœžœ*˜3šžœžœ˜Kšœ"žœ/˜U—J™7Jšœžœ™ J™Jšœžœ™!J™Kšžœžœ˜—šœžœ,˜5šžœžœ˜J™/Kšœ"žœ.˜TJ™šžœ&žœ™-J™—Jšžœ™J™7Jšœžœ™ J™Jšœžœ™!J™J™Kšžœžœ˜ Jšœ™Kšœ˜——Kšžœ˜—J™J™&šžœžœžœΟc˜=Jšœ&™&K˜J™CJ™]K˜—J™%J™#K˜—K˜šŸœžœž œ žœ*˜hšžœžœžœž˜#šžœ%žœžœ˜4šžœžœžœž˜%K˜(Kšžœ˜—K˜ Kšžœ˜K˜—Kšžœ˜—Kšœ˜K˜—Kšœžœ˜5K˜šŸœž œ˜Kšœžœ%˜;K˜0K˜—K˜Jšœ ™ K˜K˜——…—ΜΆ