<> <> <> <<>> DIRECTORY Menus USING [MenuProc], TextNode USING [Ref], TiogaOps USING [Location, Offset, Ref], TiogaFileOps USING [Ref], ViewerClasses USING [ViewerRec, Viewer], Rope USING [ROPE]; TiogaButtons: CEDAR DEFINITIONS = { ROPE: TYPE ~ Rope.ROPE; <> TiogaButton: TYPE = REF TiogaButtonRec; TiogaButtonRec: TYPE = RECORD [ startLoc: TiogaOps.Location, endLoc: TiogaOps.Location, proc: TiogaButtonProc, clientData: REF ANY, fork: BOOLEAN]; <> NodeItself: TiogaOps.Offset ~ -1; TiogaButtonAtom: ATOM ~ $TiogaButtonList; -- here mainly for documentation TiogaButtonsAtom: ATOM ~ $TiogaButtons; -- compiler won't let you import atoms! TiogaButtonList: TYPE = LIST OF TiogaButton; TiogaButtonProc: TYPE = Menus.MenuProc; <> <> <> <> <<>> CreateViewer: PROC [info: ViewerClasses.ViewerRec] RETURNS [v: ViewerClasses.Viewer]; <> <> <<>> LoadViewer: PROC [viewer: ViewerClasses.Viewer, fileName: ROPE]; <> <<>> CreateButton: PROC [viewer: ViewerClasses.Viewer, rope: ROPE _ NIL, format: ROPE _ NIL, looks: ROPE _ NIL, proc: TiogaButtonProc _ NIL, clientData: REF ANY _ NIL, fork: BOOLEAN _ TRUE] RETURNS [button: TiogaButton]; <> <> <<(Client must provide nesting through TiogaOps)>> <> WrongViewerClass: ERROR; CreateButtonFromNode: PROC [node: TiogaOps.Ref, start: TiogaOps.Offset _ 0, end: TiogaOps.Offset _ LAST[TiogaOps.Offset], proc: TiogaButtonProc _ NIL, clientData: REF ANY _ NIL, fork: BOOLEAN _ TRUE] RETURNS [button: TiogaButton]; <> <> <> <<>> AppendToButton: PROC [button: TiogaButton, rope: ROPE _ NIL, looks: ROPE _ NIL, proc: TiogaButtonProc _ NIL, clientData: REF ANY _ NIL, fork: BOOLEAN _ TRUE] RETURNS [TiogaButton]; <> <> <> <<>> DeleteButton: PROC [button: TiogaButton]; <> <> <> <> <<>> GetRope: PROC [button: TiogaButton] RETURNS [rope: ROPE]; <> <<>> SetStyleFromRope: PROC [v: ViewerClasses.Viewer, styleRope: ROPE]; <> <<>> <<>> <> <<>> TextNodeRef: PROC [node: TiogaOps.Ref] RETURNS [TextNode.Ref] ~ TRUSTED INLINE { RETURN [LOOPHOLE[node]] }; TiogaOpsRef: PROC [node: TextNode.Ref] RETURNS [TiogaOps.Ref] ~ TRUSTED INLINE { RETURN [LOOPHOLE[node]] }; TiogaFileOpsRef: PROC [node: TiogaOps.Ref] RETURNS [TiogaFileOps.Ref] ~ TRUSTED INLINE { RETURN [LOOPHOLE[node]] }; TiogaOpsRefFromFileOps: PROC [node: TiogaFileOps.Ref] RETURNS [TiogaOps.Ref] ~ TRUSTED INLINE { RETURN [LOOPHOLE[node]] }; }.