DEFINITION MODULE CursorMouse; (*J. Gutknecht, 17.11.83*)

  CONST ML = 15; MM = 14; MR = 13;

  TYPE
    Pattern = RECORD
      height: CARDINAL;
      raster: ARRAY [0..15] OF BITSET
    END;

    ReadProc = PROCEDURE(VAR BITSET, VAR CARDINAL, VAR CARDINAL);

  PROCEDURE SetMouse(x, y: CARDINAL);
  (*Set Mouse to point (x, y)*)

  PROCEDURE GetMouse(VAR s: BITSET; VAR x, y: CARDINAL);
  (*Get current mousestate
    ML IN s = "Left mouseKey pressed";
    MM IN s = "Middle mouseKey pressed";
    MR IN s = "Right mouseKey pressed"*)

  PROCEDURE ReadMouse(VAR s: BITSET; VAR x, y: CARDINAL);
  (*Read mouse. Reroutable*)

  PROCEDURE Assign(p: ReadProc);
  (*Route ReadMouse to p*)

  PROCEDURE MoveCursor(x, y: CARDINAL);
  (*Move cursor to specified location*)

  PROCEDURE EraseCursor;

  PROCEDURE SetPattern(VAR p: Pattern);
  (*Activate private cursor pattern*)

  PROCEDURE ResetPattern;
  (*Reactivate standard arrow pattern*)

END CursorMouse.