%FOREIGN DEFINITION MODULE HP7221;

(* Interface with the Plot21 Fortran Subroutine package for
   the Hp 7221B,c Plotters. Note: The routines that work with
   7221/S plotter are not implemented ( e.g Plotter with continous
   paper feed )  
                    Sohail Aslam CS Dept. 
*)

EXPORT QUALIFIED  
             ArcRel          ,
             ArcTol          ,
             Axes            ,
             ForAxis         ,
             Cdir            ,
             Cfont           ,
             Cframe          ,
             Clip            ,
             ClipOf          ,
             ClipOn          ,
             Cplot           ,
             Cshade          ,
             Csize           ,
             Csizea          ,
             DasLna          ,
             Draw            ,
             Digit           ,
             Factor          ,
             Frame           ,
             Fxd             ,
             Grid            ,
             Iplot           ,
             LabOff          ,
             LabOn           ,
             Laxes           ,
             LbTerm          ,
             Lgrid           ,
             Limit           ,
             Line            ,
             Locate          ,
             Lorg            ,
             Mapuu           ,
             Margin          ,
             Mask            ,
             MaskOf          ,
             MaskOn          ,
             Mframe          ,
             Move            ,
             Mscale          ,
             NewPen          ,
             Number          ,
             Oerror          ,
             Oerr1           ,
             Ostats          ,
             Pdir            ,
             PenDn           ,
             PenSpd          ,
             PenUp           ,
             Plot            ,
             PlotOf          ,
             PlotOn          ,
             Plots           ,
             Pshade          ,
             RangOf          ,
             RangOn          ,
             Res             ,
             Rplot           ,
             Scale           ,
             SetGU           ,
             SetIn           ,
             SetUU           ,
             Shade           ,
             Show            ,
             ForSymbol       ,
             Vframe          ,
             Where           ,
             WhereA          ;

  PROCEDURE ArcRel
    (    %REF      X:                  REAL;
         %REF      Y:                  REAL;
         %REF      Radius:             REAL;
         %REF      AngSt:              REAL;
         %REF      AngEnd:             REAL  );
    
  PROCEDURE ArcTol
    (    %REF      Numb:               INTEGER  );
    
  PROCEDURE Axes
    (    %REF      Xtic:               REAL;
         %REF      Ytic:               REAL;
         %REF      Xorg:               REAL;
         %REF      Yorg:               REAL;
         %REF      NxMaj:              INTEGER;
         %REF      NyMaj:              INTEGER;
         %REF      TicSiz:             REAL     );
    
  PROCEDURE ForAxis
    (    %REF      X:                  REAL;
         %REF      Y:                  REAL;
         %STDESCR  Text:               ARRAY OF CHAR;
         %REF      AxisLen:            REAL;
         %REF      Angle:              REAL;
         %REF      MinAxisValue:       REAL;
         %REF      AxisIncrValue:      REAL;
         %REF      Olen:               REAL  );
    
  PROCEDURE Cdir
    (    %REF      Angle:              REAL  );
    
  PROCEDURE Cfont
    (    %REF      NsFont:             INTEGER;
         %REF      Nafont:             INTEGER  );
    
  PROCEDURE Cframe;
    
  PROCEDURE Clip
    (    %REF      Xmin:               REAL;
         %REF      Xmax:               REAL;
         %REF      Ymin:               REAL;
         %REF      Ymax:               REAL  );
    
  PROCEDURE ClipOf;
  
  PROCEDURE ClipOn;
  
  PROCEDURE Cplot
    (    %REF      Xcell:              REAL;
         %REF      Ycell:              REAL  );
    
  PROCEDURE Cshade
    (    %REF      Yld:                REAL;
         %REF      Angle:              REAL  );
    
  PROCEDURE Csize
    (    %REF      Cline:              REAL;
         %REF      Cratio:             REAL;
         %REF      Slant:              REAL  );

  PROCEDURE Csizea
    (    %REF      Height:             REAL;
         %REF      Ratio:              REAL;
         %REF      Slant:              REAL  );

  PROCEDURE DasLna
    (    %REF      LineType:           INTEGER;
         %REF      PatternLen:         REAL     );
    
  PROCEDURE Draw
    (    %REF      Xcoor:              REAL;
         %REF      Ycoor:              REAL  );
    
  PROCEDURE Digit
    (VAR %REF      Xvalue:             REAL;
     VAR %REF      Yvalue:             REAL;
     VAR %REF      PenStatus:          INTEGER;
     VAR %REF      PenNumber:          INTEGER  );
    
  PROCEDURE Factor
    (    %REF      Fact:               REAL  );

  PROCEDURE Frame;
  
  PROCEDURE Fxd
    (    %REF      Number:             INTEGER  );
    
  PROCEDURE Grid
    (    %REF      Xtic:               REAL;
         %REF      Ytic:               REAL;
         %REF      Xorg:               REAL;
         %REF      Yorg:               REAL;
         %REF      NxMaj:              INTEGER;
         %REF      NyMaj:              INTEGER  );
    
  PROCEDURE Iplot
    (    %REF      X:                  REAL;
         %REF      Y:                  REAL;
         %REF      PenCont:            INTEGER  );
    
  PROCEDURE LabOff;
  
  PROCEDURE LabOn
    (    %REF      NumChars:           INTEGER  );
    
  PROCEDURE Laxes
    (    %REF      Xtic:               REAL;
         %REF      Ytic:               REAL;
         %REF      Xorg:               REAL;
         %REF      Yorg:               REAL;
         %REF      NxMaj:              INTEGER;
         %REF      NyMaj:              INTEGER;
         %REF      TicSize:            REAL     );
    
  PROCEDURE LbTerm
    (    %REF      NtChar:             INTEGER  );
    
  PROCEDURE Lgrid
    (    %REF      Xtic:               REAL;
         %REF      Ytic:               REAL;
         %REF      Xorg:               REAL;
         %REF      Yorg:               REAL;
         %REF      NxMaj:              INTEGER;
         %REF      NyMaj:              INTEGER  );
    
  PROCEDURE Limit
    (    %REF      Xmin:          REAL;
         %REF      Xmax:          REAL;
         %REF      Ymin:          REAL;
         %REF      Ymax:          REAL  );

  PROCEDURE Line
    (    %REF      Xarray:             REAL;
         %REF      Yarray:             REAL;
         %REF      Nscale:             INTEGER;
         %REF      Npoint:             INTEGER;
         %REF      Lplot:              INTEGER;
         %REF      Isymbol:            INTEGER  );
    
  PROCEDURE Locate
    (    %REF      Xmin:          REAL;
         %REF      Xmax:          REAL;
         %REF      Ymin:          REAL;
         %REF      Ymax:          REAL  );

  PROCEDURE Lorg
    (    %REF      LorgMode:           INTEGER  );
    
  PROCEDURE Mapuu
    (    %REF      Xmin:          REAL;
         %REF      Xmax:          REAL;
         %REF      Ymin:          REAL;
         %REF      Ymax:          REAL  );

  PROCEDURE Margin
    (    %REF      Xleft:              REAL;
         %REF      Xright:             REAL;
         %REF      Ylower:             REAL;
         %REF      Ytop:               REAL  );
    
  PROCEDURE Mask
    (    %REF      Xmin:               REAL;
         %REF      Xmax:               REAL;
         %REF      Ymin:               REAL;
         %REF      Ymax:               REAL  );
    
  PROCEDURE MaskOf;
  
  PROCEDURE MaskOn;
  
  PROCEDURE Mframe;
  
  PROCEDURE Move
    (    %REF      Xcoor:              REAL;
         %REF      Ycoor:              REAL  );

  PROCEDURE Mscale
    (    %REF      Xoffset:            REAL;
         %REF      Yoffset:            REAL  );
    
  PROCEDURE NewPen
    (    %REF      PenPort:       INTEGER );

  PROCEDURE Number
    (    %REF      X:                  REAL;
         %REF      Y:                  REAL;
         %REF      Height:             REAL;
         %REF      Fnumb:              REAL;
         %REF      Angle:              REAL;
         %REF      Ndigit:             INTEGER  );
    
  PROCEDURE Oerror
    (VAR %REF      Ncode:              INTEGER;
     VAR %REF      Ncommand:           INTEGER;
     VAR %REF      Ncount:             INTEGER  );
    
  PROCEDURE Oerr1
    (VAR %REF      Ncode:              INTEGER;
     VAR %REF      Ncommand:           INTEGER;
     VAR %REF      Ncount:             INTEGER  );
    
  PROCEDURE Ostats
    (VAR %REF      Nstat:              INTEGER  );
    
  PROCEDURE Pdir
    (    %REF      Angle:              REAL  );

  PROCEDURE PenDn;
  
  PROCEDURE PenSpd
    (    %REF      Speed:              INTEGER  );
    
  PROCEDURE PenUp;
  
  PROCEDURE Plot
    (    %REF      Xcoor:              REAL;
         %REF      Ycoor:              REAL;
         %REF      PenControl:         INTEGER );

  PROCEDURE PlotOf;

  PROCEDURE PlotOn;

  (* Initialize the plotter *)
  PROCEDURE Plots
    (    %REF      InitType:           INTEGER;
         %REF      Stdin:              INTEGER;
         %REF      Stdout:             INTEGER   );

  PROCEDURE Pshade
    (    %REF      Npts:               INTEGER;
         %REF      Parray:             REAL;
         %REF      Yld:                REAL;
         %REF      Angle:              REAL;
         %REF      Nopt:               INTEGER  );
    
  PROCEDURE RangOf
    (VAR %REF      Xmin:               REAL;
     VAR %REF      Xmax:               REAL;
     VAR %REF      Ymin:               REAL;
     VAR %REF      Ymax:               REAL;
     VAR %REF      Tpts:               REAL  );
    
  PROCEDURE RangOn;
  
  PROCEDURE Res
    (    %REF      Xres:               REAL;
         %REF      Yres:               REAL  );
    
  PROCEDURE Rplot
    (    %REF      X:                  REAL;
         %REF      Y:                  REAL;
         %REF      Ipen:               INTEGER  );
    
  PROCEDURE Scale
    (VAR %REF      Aray:               REAL;
     VAR %REF      Alen:               REAL;
         %REF      Nscale:             INTEGER;
         %REF      Npoint:             INTEGER  );
    
  PROCEDURE SetGU;
  
  PROCEDURE SetIn;
  
  PROCEDURE SetUU;
  
  PROCEDURE Shade
    (    %REF      Xmin:               REAL;
         %REF      Xmax:               REAL;
         %REF      Ymin:               REAL;
         %REF      Ymax:               REAL  );
    
  PROCEDURE Show
    (    %REF      Xmin:               REAL;
         %REF      Xmax:               REAL;
         %REF      Ymin:               REAL;
         %REF      Ymax:               REAL  );
    
  (* Symbol in the plot21 package expects an integer array holding the
     character string. The fortran routine ForSymbol does the conversion
     from ARRAY OF CHAR to and integer or byte array.
  *)
  PROCEDURE ForSymbol
    (    %REF      X:                  REAL;
         %REF      Y:                  REAL;
         %REF      Height:             REAL;
         %STDESCR  Text:               ARRAY OF CHAR;
         %REF      Angle:              REAL;
         %REF      CharCount:          INTEGER  );

  PROCEDURE Vframe;
  
  PROCEDURE Where
    (VAR %REF      X:                  REAL;
     VAR %REF      Y:                  REAL;
     VAR %REF      Fact:               REAL  );
    
  PROCEDURE WhereA
    (VAR %REF      X:                  REAL;
     VAR %REF      Y:                  REAL;
     VAR %REF      PenStatus:          INTEGER  );
    
END HP7221.
