TEditInputExtras.mesa
Copyright Ó 1987, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, October 23, 1987 4:13:25 pm PDT
~
BEGIN
CommandClosure: TYPE ~ RECORD [name: ATOM, proc: CommandClosureProc, data: REF ANY];
CommandClosureProc:
TYPE ~
PROC [data:
REF
ANY, viewer: ViewerClasses.Viewer ¬
NIL, param:
REF ¬
NIL]
RETURNS [recordAtom:
BOOL ¬
TRUE, quit:
BOOL ¬
FALSE];
A CommandClosure is like a CommandProc, but has a data field (typically immutable) so that the same procedure may implement a number of distinct commands, and an optional param for encapsulating parameters. Refer to impl for details of param handling.
RegisterClosure:
PROC [commandClosure: CommandClosure, before:
BOOL ¬
TRUE];
Registers a command implemented by a CommandClosure
UnRegisterClosure:
PROC [name:
ATOM, proc: CommandClosureProc, match:
PROC [data:
REF]
RETURNS [
BOOL] ¬
NIL];
Enumerates the registered CommandClosures that have the given name and proc, and unregisters those for which match returns TRUE; match=NIL is equivalent to match={RETURN [TRUE]};
GetCommandNames:
PROC
RETURNS [
LIST
OF
ATOM];
Returns a list of the names of all registered commands.