<> <> <> <> <> <<>> DIRECTORY AMTypes USING [TV], AMModel USING [Context, Section], AMModelBridge USING [LoadedSection], FileViewerOps USING [SelectionOption], Rope USING [ROPE], ViewerClasses USING [Viewer], WorldVM USING [World]; AMViewerOps: CEDAR DEFINITIONS = BEGIN OPEN AMTypes, Rope, WorldVM; Section: TYPE = AMModel.Section; LoadedSection: TYPE = AMModelBridge.LoadedSection; SelectionOption: TYPE = FileViewerOps.SelectionOption; < use primary selection>> < use feedback selection>> <> ViewerFromSection: PROC [section: AMModel.Section, report: ReportProc] RETURNS [viewer: ViewerClasses.Viewer]; <<... returns an open viewer for the given Section; Reports through report if not possible.>> SectionFromSource: PROC [world: World _ NIL, name: ROPE _ NIL, index: INT _ 0] RETURNS [section: AMModel.Section, contexts: LIST OF AMModel.Context]; <<... returns a section for the given source (the name can be a long path name); !AMTypes.Error if this cannot be done. If world = NIL then world _ LocalWorld. warn = TRUE => the version of the source file for the given location does not correspond to the viewer (although this is no guarantee that the wrong thing happened). The name given MUST be for an open viewer, and the index given MUST be in the proper source range.>> SectionFromSelection: PROC [world: World _ NIL, which: SelectionOption _ primary] RETURNS [section: AMModel.Section, contexts: LIST OF AMModel.Context]; <<... returns a loaded section for the given viewer; !AMTypes.Error if this cannot be done. If world = NIL then world _ LocalWorld. warn = TRUE => the version of the source file for the given location does not correspond to the viewer (although this is no guarantee that the wrong thing happened). The name given MUST be for an open viewer, and the index given MUST be in the proper source range.>> SourceFromTV: PROC [tv: TV, report: ReportProc] RETURNS [name: ROPE, index: INT]; <<... gets the source file name and the source index for the given TV, which must be a local frame or global frame; if not successful, then name = NIL & index < 0.>> <> Severity: TYPE = {success, comment, warning, fatal}; < operation is completed>> < intermediate information>> < something is wrong, but not fatal>> < operation is completed, but did not succeed>> ReportProc: TYPE = PROC [msg: ROPE, severity: Severity]; <<... is the type of user-supplied procedure used to report results in above operations>> END.