DEFINITION Wind; (* Stephan Junker *)


(* The module Wind is reduced to the call of the according AES procedures
*)


CONST (* element bits *)
  TITLE* = 0; CLOSER* = 1; FULLER* = 2; MOVER* = 3; INFOLINE* = 4;
  SIZER* = 5; UPARROW* = 6; DNARROW* = 7; VSLIDER* = 8; LFARROW* = 9;
  RTARROW* = 10; HSLIDER* = 11;

  (* get/set types *)
  ELEMENTS* = 1; NAME* = 2; INFO* = 3; WORK* = 4; CURR* = 5; PREV* = 6;
  FULL* = 7; HSLIDE* = 8; VSLIDE* = 9; TOP* = 10; FIRST* = 11; NEXT* = 12;
  NEWDESK* = 14; HSLSIZE* = 15; VSLSIZE* = 16; SCREEN* = 17;

  (* update type *)
  ENDUPD* = 0; BEGUPD* = 1; ENDMCTRL* = 2; BEGMCTRL* = 3;

  (* calc type *)
  WHOLE* = 0; WORKSP* = 1;


PROCEDURE Create*(Elements : SET; X,Y,W,H : INTEGER; VAR Handle : INTEGER) : BOOLEAN;
 (* tells AES to create a new window. If it has no windows left, an error
    message is shown and FALSE returned. The AES handle is returned in Handle *)


PROCEDURE Open*(Handle,X,Y,W,H : INTEGER);
  (* opens the window with handle Handle *)


PROCEDURE Close*(Handle : INTEGER);
  (* closes the window with handle Handle *)


PROCEDURE Delete*(Handle : INTEGER);
  (* deletes the window with handle Handle *)


(* The Get?/Set? procedures are derived from the AES wind_get/wind_set
   procedures *)

PROCEDURE GetXYWH*(Handle,Type : INTEGER; VAR x,y,w,h : INTEGER);
 (* Type can be WORK, CURR, PREV, FULL, FIRST or NEXT *)


PROCEDURE GetVal*(Handle,Type : INTEGER) : INTEGER;
 (* Type can be HSLIDE, VSLIDE, HSLSIZE or VSLSIZE. Returns position or size *)


PROCEDURE GetTop*(VAR Handle : INTEGER) : BOOLEAN;
 (* returns the top window. FALSE means no window open *)


PROCEDURE SetElements*(Handle : INTEGER; Elements : SET);
 (* set the elements of a window *)


PROCEDURE SetAddress*(Handle,Type : INTEGER; Address : S.PTR);
 (* Type can be NAME,INFO or NEWDESK *)


PROCEDURE SetCurr*(Handle,x,y,w,h : INTEGER);
 (* set current size of a window *)


PROCEDURE SetVal*(Handle,Type,Val : INTEGER);
 (* Type can be HSLIDE,VSLIDE,HSLSIZE or VSLSIZE *)


PROCEDURE SetTop*(Handle : INTEGER);
 (* Type can be HSLIDE,VSLIDE,HSLSIZE or VSLSIZE *)


PROCEDURE Find*(X,Y : INTEGER; VAR Handle : INTEGER) : BOOLEAN;
 (* finds window under the position X,Y. Returns FALSE if no window there *)


PROCEDURE Update*(Type : INTEGER);


PROCEDURE Calc*(Type : INTEGER; Elements : SET; InX,InY,InW,InH : INTEGER;
                VAR OutX,OutY,OutW,OutH : INTEGER);
  (* calculates the whole or work space of a window *)


END Wind.
