ButtonClassesCommon.mesa
Copyright Ó 1989, 1991, 1992 by Xerox Corporation. All rights reserved.
Aaron Goodisman, August 11, 1989 1:44:29 pm PDT
Bier, June 13, 1991 3:36 pm PDT
Doug Wyatt, April 15, 1992 5:24 pm PDT
DIRECTORY Rope;
ButtonClassesCommon:
CEDAR
DEFINITIONS ~
BEGIN
CountMatches:
PROC [a, b:
LIST
OF
REF]
RETURNS [result:
INT ¬ 0];
Counts the matches in the lists a and b. If a contains the atom $Up and b contains the atom $Down or vice versa, returns 0.
ExactMatch:
PROC [a, b:
LIST
OF
REF]
RETURNS [
BOOL];
Returns TRUE iff a and b contain the same REFS in the same order. The atom $Mouse matches any of $Red, $Yellow, $Blue, $Left, $Middle, or $Right. The atom $Highlight matches ($Mouse $Down) or $Enter, where $Mouse matches all the patterns just mentioned. The atom $UnHighlight matches ($Mouse $Up) or $Exit.
Subset:
PROC [a, b:
LIST
OF
REF]
RETURNS [
BOOL];
Returns TRUE iff all REFs of a (or their equivalents, see ExactMatch) are also in b.
GenerateUniqueRope:
PROC []
RETURNS [rope:
ROPE];
Just what it sounds like.
IsGeneratedRope:
PROC [rope:
ROPE]
RETURNS [
BOOL];
Returns TRUE if rope was generated by GenerateUniqueRope.
KeyValueExtract:
PROC [object:
LIST
OF
REF, key:
ATOM, screenError, fileError:
ROPE]
RETURNS [val:
REF ¬
NIL, success:
BOOL ¬
FALSE];
Looks for key in object, assuming object is a list of pairs of keys and values. If object is malformed, calls EBTypes.Error with screenError and fileError. Returns the value associated with key and a success flag.
END.