DEFINITION Styles; (* portable *)

 IMPORT Display, Fonts, Objects, Texts;

 CONST
  left = 0; right = 1;
  fmode = 0; leftmarg = 1; width = 2; tabs = 3;
  Adjust = {left, right};
  break = 3;
  grid = 2;
  get = 0; set = 1;
  mm = 36000;
  pageW = 160*mm;
  scnW = pageW DIV  10000;

 TYPE
  Style = POINTER TO StyleDesc;
  StyleDesc = RECORD ( Objects.ObjDesc ) 
   opts: SET;
   paraW: LONGINT;
   left: LONGINT;
   lsp, dsr: LONGINT;
   gap: LONGINT;
   nTabs: SHORTINT;
   tab: ARRAY  32 OF LONGINT
  END;

  Frame = POINTER TO FrameDesc;
  FrameDesc = RECORD ( Display.FrameDesc ) 
   style: Style;
   sel, col: INTEGER;
  END;

  UpdateMsg = RECORD ( Display.FrameMsg ) 
   id: INTEGER;
   obj: Style;
   dX: INTEGER
  END;

  ParamMsg = RECORD ( Objects.ObjMsg ) 
   id: INTEGER;
   S: Texts.Scanner;
   T: Texts.Text;
  END;

 VAR 
  defStyle: Style;
 PROCEDURE MetricFnt (fnt: Fonts.Font; VAR unit: LONGINT; VAR mfnt: Fonts.Font);
 PROCEDURE Tab (style: Style; fnt: Fonts.Font; x, X: LONGINT; VAR dx: INTEGER; VAR dX: LONGINT);
 PROCEDURE Height (fnt: Fonts.Font; VAR asr, dsr: LONGINT);
 PROCEDURE Similar (s0, s1: Style): BOOLEAN;
 PROCEDURE SelStyle (VAR style: Style);
 PROCEDURE NewStyle (): Objects.Object;
 PROCEDURE NewFrame (style: Style): Display.Frame;
 PROCEDURE New;
 PROCEDURE Gimme;
END Styles.