DIRECTORY Rope USING [ROPE]; ClientStateInfo: CEDAR DEFINITIONS = BEGIN State: TYPE = REF; -- State = NIL => "no state"; our convention is that brush interiors have (non-NIL) state, and their exteriors do not have state. StateCombiner: TYPE = PROC[currentregionstate, inputregionstate: State] RETURNS [combinedregionstate: State]; -- note well the order of arguments. defaultState: State; -- client is to provide a default (brush interior) state stateCombiner: StateCombiner; -- client is to provide a default StateCombiner. StateEqual: PROC [state1, state2: State] RETURNS [BOOL]; -- test for equality of states. RopeFromState: PROC [state: State] RETURNS [Rope.ROPE]; StateFromRope: PROC [in: Rope.ROPE] RETURNS [State]; END. μClientStateInfo.mesa Last Edited by: Arnon, January 25, 1985 12:27:34 pm PST IF currentregionstate=NIL THEN RETURN[ inputregionstate ]; IF inputregionstate=NIL THEN RETURN[ currentregionstate ]; -- all StateCombiner's should contain these lines: our convention is that NIL state combined with any state returns that state. IF state1=NIL OR state2=NIL THEN RETURN[state1=NIL AND state2 = NIL]; -- all StateEqual's should contain this test State-encoding Ropes should not contain blanks, commas, colons, or semicolons, since the IDProc breakProc which procedures to read stateRopes will probably use considers them separators. IF state=NIL THEN RETURN["NIL"] ELSE RETURN[ ... -- all RopeFromState's should do this Remember to catch "NIL" Κ”˜šœ™J™7J™—šΟk ˜ Jšœœœ˜—J˜šœœ œ˜*J˜JšœœœΟcƒ˜—J˜š Οn œœœ.œ ž$˜“Jšœœœœ™:Jš œœœœžJž2™»J˜—J˜Jšœž8˜NJ˜JšŸ œž0˜NJ˜codeš Ÿ œœœœž˜XJšœœœœœœœœ œž,™sK˜—J˜šŸ œœœœ˜7KšœΊ™ΊKš œœœœœœž%™VK™—K˜šŸ œœ œœ ˜4Kšœ™—K˜Jšœ˜——…—κj