DIRECTORY AtomButtons, GGCoreTypes, Imager, ImagerColor, ImagerTransformation, Rope; GGCoreOps: CEDAR DEFINITIONS = BEGIN EventListt: TYPE = GGCoreTypes.EventListt; -- spelled with two t's for "List and a Tail pointer" Event: TYPE = GGCoreTypes.Event; RopeListt: TYPE = GGCoreTypes.RopeListt; -- spelled with two t's for "List and a Tail pointer" ScalarButton: TYPE = AtomButtons.ScalarButton; NewEventListt: PROC [] RETURNS [listt: EventListt]; FlushEventListt: PROC [listt: EventListt]; AppendEvent: PROC [event: Event, listt: EventListt]; NoEvents: PROC [listt: EventListt] RETURNS [BOOL]; ForEachEvent: PROC [listt: EventListt, eachEventProc: EachEventProc]; EachEventProc: TYPE = PROC [thisEvent: Event] RETURNS [done: BOOL ¬ FALSE]; NewRopeListt: PROC [] RETURNS [listt: RopeListt]; FlushRopeListt: PROC [listt: RopeListt]; AppendRope: PROC [rope: Rope.ROPE, listt: RopeListt]; NoRopes: PROC [listt: RopeListt] RETURNS [BOOL]; ForEachRope: PROC [listt: RopeListt, eachRopeProc: EachRopeProc]; EachRopeProc: TYPE = PROC [thisRope: Rope.ROPE] RETURNS [done: BOOL ¬ FALSE]; StartList: PROC [] RETURNS [entityList, ptr: LIST OF REF ANY]; AddEntity: PROC [entity: REF ANY, entityList, ptr: LIST OF REF ANY] RETURNS [newList, newPtr: LIST OF REF ANY]; List: PROC [ref1, ref2, ref3: REF ANY ¬ NIL] RETURNS [LIST OF REF ANY]; StartRealList: PROC [] RETURNS [entityList, ptr: LIST OF REAL]; AddReal: PROC [entity: REAL, entityList, ptr: LIST OF REAL] RETURNS [newList, newPtr: LIST OF REAL]; AppendRealList: PROC [list1, list2: LIST OF REAL] RETURNS [result: LIST OF REAL]; SortRealList: PROC [list: LIST OF REAL, ascending: BOOL ¬ TRUE] RETURNS [sortedList: LIST OF REAL]; StartBoolList: PROC [] RETURNS [entityList, ptr: LIST OF BOOL]; AddBool: PROC [entity: BOOL, entityList, ptr: LIST OF BOOL] RETURNS [newList, newPtr: LIST OF BOOL]; AppendBoolList: PROC [list1, list2: LIST OF BOOL] RETURNS [result: LIST OF BOOL]; StartNATList: PROC [] RETURNS [entityList, ptr: LIST OF NAT]; AddNAT: PROC [entity: NAT, entityList, ptr: LIST OF NAT] RETURNS [newList, newPtr: LIST OF NAT]; AppendNATs: PROC [list1, list2: LIST OF NAT] RETURNS [result: LIST OF NAT]; StartScalarButtonList: PROC [] RETURNS [entityList, ptr: LIST OF ScalarButton]; AddScalarButton: PROC [entity: ScalarButton, entityList, ptr: LIST OF ScalarButton] RETURNS [newList, newPtr: LIST OF ScalarButton]; AppendScalarButtons: PROC [list1, list2: LIST OF ScalarButton] RETURNS [result: LIST OF ScalarButton]; PUChoiceList: PROC [r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19: AtomButtons.PopUpChoice ¬ [] ] RETURNS [list: AtomButtons.PopUpChoices]; BreakIntervalMOD: PROC [start, end, mod: NAT] RETURNS [s1, e1, s2, e2: INT]; BreakIntervalMODLen: PROC [start, len, mod: NAT] RETURNS [s1, len1, s2, len2: INT]; InMODRegion: PROC [test: NAT, start, end, mod: NAT] RETURNS [BOOL]; ExtractRGB: PROC [color: ImagerColor.ConstantColor] RETURNS [r,g,b: REAL]; EquivalentColors: PROC [color1, color2: Imager.Color] RETURNS [BOOL]; SetColor: PROC [dc: Imager.Context, color: Imager.Color, m: Imager.Transformation ¬ NIL]; TransformColor: PROC [color: Imager.Color, viewView: ImagerTransformation.Transformation] RETURNS [newColor: Imager.Color]; CopyColor: PROC [color: Imager.Color] RETURNS [copy: Imager.Color]; BoolToRope: PROC [bool: BOOL] RETURNS [rope: Rope.ROPE]; RopeToBool: PROC [rope: Rope.ROPE] RETURNS [bool: BOOL]; END.  GGCoreOps.mesa Copyright Σ 1986, 1992 by Xerox Corporation. All rights reserved. Last edited by Bier on September 12, 1987 1:30:46 pm PDT Contents: Utility routines extracted from GGUtility and SVUtility and other places. Listt Operations Operations on LIST OF REF ANY Builds a LIST of up to three things. Used because the built-in LIST function compiles the code in-line making for large BCDs and broken compilers. (see GGMenuImplB.mesa for examples of use). Operations on LIST OF REAL Sorts the list of REAL using the MergeSort algorithm from ListImpl. Operations on LIST OF BOOL Operations on LIST OF NAT Operations on LIST OF ScalarButton Builds a list of PopUpChoice. Used because the built-in LIST function compiles the code in-line making for large BCDs and broken compilers. (see GGMenuImplB.mesa for examples of use). Modular Arithmetic Given an interval of a circular buffer whose elements are numbered 0 .. mod -1, we break up the interval into one or two pieces, neither of which crosses the mod-1 to 0 boundary. Examples: BreakIntervalMOD[6, 2, 7] => [6, 6, 0, 2]; BreakIntervalMOD[2, 6, 7] => [2, 6, -1, -1]; Lile BreakIntervalMOD except that both the original interval and the results are expressed in the form (start of interval, length of interval) instead of [start..end]. Non-destructive (copies the first list). Colors Calls Imager.SetColor, Imager.SetSampledColor, or Imager.SetSampledBlack as appropriate. Conversions Returns "T" or "F". Takes "T" or "F". Raises an Error if rope is anything else. Κ"•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ6™BKšœ8™8KšœT™TK™—šΟk ˜ KšœJ˜J—K˜Kšœ žœž œ˜Kšž˜K˜Kšœ žœΟcΠczŸ Ÿ ˜`Kšœžœ˜ Kšœ žœŸ Ÿ Ÿ ˜^Kšœžœ˜.K˜™K™—KšΟn œžœžœ˜3Kš‘œžœ˜*Kš‘ œžœ#˜4Kš‘œžœžœžœ˜2K˜Kš‘ œžœ3˜EKš ‘ œžœžœžœžœžœ˜KK˜Kš‘ œžœžœ˜1Kš‘œžœ˜(Kš‘ œžœ žœ˜5Kš‘œžœžœžœ˜0K˜Kš‘ œžœ0˜AKš‘ œžœžœžœžœžœžœ˜MK™šœžœžœžœž™K™—Kš‘ œžœžœžœžœžœžœ˜>Kš‘ œžœ žœžœžœžœžœžœžœžœžœžœžœ˜oš‘œžœžœžœžœžœžœžœžœžœ˜GK™ΐ—K™šœžœžœž™K™—Kš ‘ œžœžœžœžœžœ˜?Kš‘œžœ žœžœžœžœžœžœžœžœ˜dKš‘œžœžœžœžœžœ žœžœžœ˜Qš‘ œžœžœžœžœ žœžœžœžœžœžœ˜cK™C—K˜šœžœžœ™K™—Kš ‘ œžœžœžœžœžœ˜?Kš‘œžœ žœžœžœžœžœžœžœžœ˜dKš‘œžœžœžœžœžœ žœžœžœ˜QK˜šœžœžœž™K™—Kš ‘ œžœžœžœžœžœ˜=Kš‘œžœ žœžœžœžœžœžœžœžœ˜`Kš‘ œžœžœžœžœžœ žœžœžœ˜KK™šœžœžœ ™"K™—Kš ‘œžœžœžœžœ˜OKš‘œžœ)žœžœžœžœžœ˜„Kš‘œžœžœžœžœ žœžœ˜fK™š‘ œžœ{žœ"˜ΆKšœΉ™ΉK™—K™šœ™K™—š ‘œžœžœžœžœ˜LK™²Kš‘œ-™5Kšœ,™,—š ‘œžœžœžœžœ˜SKšœ§™§—š ‘ œžœžœžœžœžœ˜CK™(—K™™K™—Iprocš‘ œžœ$žœ žœ˜JLš‘œžœ žœžœ˜Eš‘œžœFžœ˜YL™X—Kš‘œžœΟuœ'žœ˜{Kš‘ œžœžœ˜CK˜™ L™—š ‘ œžœžœžœ žœ˜8L™—š ‘ œžœ žœžœžœ˜8L™<—K˜Kšžœ˜K˜—…— n