DEFINITION MODULE Windows;

(* (C) Copyright 1987 Fitted Software Tools. All rights reserved. *)

(*
    This module provides a simple implementation of overlapping text
    windows.

    The procedures in this module assume that the display is in text mode.

    This module installs the procedures Write and Goto from module Display
    in TermBase.
*)

FROM SYSTEM IMPORT ADDRESS;

TYPE Window;

PROCEDURE OpenWindow( VAR w :Window; l1, c1, l2, c2 :CARDINAL;
                      frame :BOOLEAN; header :ARRAY OF CHAR
                    );
(*
    Open a new window with top left corner at l1,c1 and bottom right
    corner at l2,c2.

    IF frame THEN the window is framed.

    The header string is centered on the top edge of the window.
*)

PROCEDURE SelectWindow( w :Window; mustSave :BOOLEAN );
(*
    Make w the current window; w is moved to the top.

    mustSave allows for faster window switches when using non overlapping
    windows. If mustSave is FALSE, the contents of the current window is
    not saved, and the contents of the new current window is not restored.
*)

PROCEDURE CloseWindow( w :Window );
(*
    close (destroy) window w.
*)

PROCEDURE CloseCurWindow;
(*
    close the top window.

    The previously current window becomes current.
*)

PROCEDURE NewWindowTitle( header :ARRAY OF CHAR );
(*
    display a new window title.
*)

END Windows.