-- NodeProps.Mesa
-- written by Paxton.  January 1981
-- last written by Paxton.  March 18, 1981  4:14 PM

DIRECTORY
TextNode,
NodeNameTable,
TiogaPGSupport,
CardAddrs,
Rope;

NodeProps: DEFINITIONS =

BEGIN
OPEN
	nodeI:TextNode,
	nameI:NodeNameTable,
	pgsI:TiogaPGSupport,
	addrsI:CardAddrs; 

PutStyleName: PROCEDURE
	[n: nodeI.Ref, stylename: nodeI.StyleName];

GetStyleName: PROCEDURE
	[n: nodeI.Ref, remove: BOOLEAN ← FALSE]
	RETURNS [nodeI.StyleName];

PutNameTable: PROCEDURE
	[n: nodeI.Ref, table: nameI.NameTable];

GetNameTable: PROCEDURE
	[n: nodeI.Ref, remove: BOOLEAN ← FALSE]
	RETURNS [nameI.NameTable];

PutSavedPGS: PROCEDURE
	[n: nodeI.Ref, pgs: pgsI.PGS];

GetSavedPGS: PROCEDURE
	[n: nodeI.Ref, remove: BOOLEAN ← FALSE]
	RETURNS [pgsI.PGS];

PutTextAddrs: PROCEDURE
	[n: nodeI.Ref, addrs: addrsI.Ref];

GetTextAddrs: PROCEDURE
	[n: nodeI.Ref, remove: BOOLEAN ← FALSE]
	RETURNS [addrsI.Ref];

PutChildAddrs: PROCEDURE
	[n: nodeI.Ref, addrs: addrsI.Ref];

GetChildAddrs: PROCEDURE
	[n: nodeI.Ref, remove: BOOLEAN ← FALSE]
	RETURNS [addrsI.Ref];

PutFileName: PROCEDURE
	[n: nodeI.Ref, filename: Rope.Ref];

GetFileName: PROCEDURE
	[n: nodeI.Ref, remove: BOOLEAN ← FALSE]
	RETURNS [Rope.Ref];

PutProp: PROCEDURE
	[n: nodeI.Ref, name, value: REF];

GetProp: PROCEDURE
	[n: nodeI.Ref, name: REF, remove: BOOLEAN ← FALSE]
	RETURNS [REF];

RemProp: PROCEDURE [n: nodeI.Ref, name: REF] RETURNS [REF] = INLINE {
	-- removes name & val from property list for node
	-- returns old value, if any
	RETURN [GetProp[n, name, TRUE]] };

MapProps: PROC [n: nodeI.Ref, action: MapPropsAction] RETURNS [BOOLEAN];
	-- apply the action to each name & value pair for the node
	-- returns true if&when an action returns true
	MapPropsAction: TYPE = PROC [name, value: REF] RETURNS [BOOLEAN];

END.