--  EmTTYDefs:  TTY Emulation Window

--  Last Revised for Star 3.3h by Kernaghan.PA:		20-Apr-84 16:39:15
--  Owner:  Kernaghan

--  Overview:
--  (Replace with overview from Functional Spec)


DIRECTORY
  CH USING [Name],
  IconDefs USING [Icon, Pvcreate, Pvmake],
  PswnDefs USING [Pvpsmgr],
  SchemaDefs USING [Lschema],
  System USING [NetworkAddress],
  TraitGlobalDefs USING [Pvregistertrait, Trt];


EmTTYDefs: DEFINITIONS =
  BEGIN 

  --===================
  --  Public Types
  --===================
  -- Trait TTYschema's data	(trtTTYschema)
  Lpttrtttyschemadata: TYPE = LONG POINTER TO Trtttyschemadata;
  Trtttyschemadata: TYPE = RECORD [
    icon: IconDefs.Icon, lptEmState: LONG POINTER TO UNSPECIFIED];
    
  -- Trait TTYicon's data		(trtTTYicon)
  Lpttrtttyicondata: TYPE = LONG POINTER TO Trtttyicondata;
  Trtttyicondata: TYPE = RECORD [
    junk: CARDINAL,  -- ?? not used: flush this next time a rewrite is done
    sysNetAddrECS: System.NetworkAddress,  -- ?? and move this into EmIconData, too
    lptMoreState: LONG POINTER TO UNSPECIFIED]; 
    
  -- Define the structure to hold initial default data in for the two TTY traits.
  TrtTTYschemadatainit: PRIVATE TYPE = Trtttyschemadata;  -- do this for conformity sake only (could omit)
  TrtTTYicondatainit: PRIVATE TYPE = Trtttyicondata;
  
  --===================
  --  Constants
  --===================

  
  --===================
  --  Global Variables
  --===================
  lschemaTTYWn: PUBLIC SchemaDefs.Lschema;  -- handle to entire TTY window

  --===================
  --  Public Procedures
  --===================
  Create: IconDefs.Pvcreate;  -- called by IconPack when TTY icon is created to make an instance of trtTTYicon
  Make: IconDefs.Pvmake;  -- call by Directory3Pack when icon is created to make a file object behind the icon

  -- Procedure to write any TTY data which must "live" forever (i.e., between boots) onto TTY icon's backing file
  PvSetFileParms: TYPE = PROCEDURE [
    icontty: IconDefs.Icon, emttydata: CH.Name, isFakeTTY:BOOLEAN ← FALSE];
  SetResourceParms: PvSetFileParms;
  
  EmGTTYpsMgr: PswnDefs.Pvpsmgr;
  -- Called when TTY window is opened and selected or if a terminal icon is selected and the property key is pressed. It builds a generic property sheet for the terminal.

  -- Any Trait with trait data should provide a PROC which will initialize that data for a new instance.  This data may, of course, be over-written at any time.  Initialize the two TTY traits' datas provided here.
  PvInitTrtTTYschemaData: TYPE = PROCEDURE [
    lschema: SchemaDefs.Lschema, ptdatainit: POINTER TO TrtTTYschemadatainit];
  InitTrtTTYschemaData: PvInitTrtTTYschemaData;

  PvInitTrtTTYiconData: TYPE = PROCEDURE [
    lschema: SchemaDefs.Lschema, icon: IconDefs.Icon,
    ptdatainit: POINTER TO TrtTTYicondatainit];
  InitTrtTTYiconData: PvInitTrtTTYiconData;


  --===================
  --  Trait Registration (Private)
  --===================

  -- These procedures are used to register the TTY traits "trtTTYschema" and "trtTTYicon"
  RegisterTrtTTYschema: TraitGlobalDefs.Pvregistertrait = INLINE
    BEGIN
    RETURN[
      [
        trt: trtTTYschema, trtcomponents: [trt1: trtlistschema, trt2: trtinstallee], szOpsForTrt: 0,
        szDataForTrt: SIZE[Trtttyschemadata], bvIsClass: TRUE]];
    END;  -- of RegisterTrtTTYschema

  RegisterTrtTTYicon: TraitGlobalDefs.Pvregistertrait = INLINE
    BEGIN
    RETURN[
      [
        trt: trtTTYicon, trtcomponents: [trt1: trticon], szOpsForTrt: 0,
        szDataForTrt: SIZE[Trtttyicondata], bvIsClass: TRUE]];
    END;  -- of RegisterTrtTTYicon

  --===================
  --  Modules
  --===================

  EmTTYWnPack: PRIVATE PROGRAM;

  END.	-- of EmTTYDefs
LOG
February 1, 1982 - Woods - Created from Em3270Defs
15-Jun-82 11:04:08 - PThomas - Deleted trtunused9 and 10; defined those traits as constants because of capitalization differences (temporary fix).
24-Jun-82 15:55:04 - Lui   - removed trtttyschema, trtttyicon equated to trtTTYschema, trtTTYicon.
18-Aug-82 17:11:53 - Lui   - added "trt2: trtinstallee" to RegisterTrtTTYschema.
15-Sep-82 10:47:59 - Gleason.es - Convert to Filing 5.0
 2-Feb-84 15:40:28 - Moursellas - Changed CHLookup.RS232CPort to CHEntries.RS232CData
 2-Apr-84 15:50:57- Lui - Added EmGTTYpsMgr to support the new GTTY property sheet brought up by DtwmPack.
10-Apr-84 17:23:06 - Kernaghan - Redefined EmTTYData to reflect the new way of doing buisness with the 8.0 Clearinghouse.
13-Apr-84 12:57:10 - Kernaghan - Added new parameter to SetResourceParms so it can be used also by the Remote System Administrator (Network Management) divider.
20-Apr-84 15:24:30 - Kernaghan - Removed PtDirTTYRowData & DirTTYRowData since TTY only needs one piec of data of type Ch.Name. Modified PvSetFileParms.emttydata.