home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / cddk9605.zip / HEADERS.ARJ / IO.INT < prev    next >
Text File  |  1996-05-17  |  24KB  |  715 lines

  1.  
  2. { ───────────────────────────────────────────────────────────────────────── }
  3. {  Name        : IO.PAS                                                     }
  4. {  Description : Concerto Input/Output Engine                               }
  5. { ───────────────────────────────────────────────────────────────────────── }
  6.  
  7. UNIT IO;
  8.  
  9. {         (outbound characters)                                             }
  10. {                  ││                                                       }
  11. {            ┌─────┴┴─────┐                                                 }
  12. {            │ Zero-State │                                                 }
  13. {            │   Driver   │                                                 }
  14. {            └─┬────────┬─┘                       ┌────────┐                }
  15. {              │        │                ┌───────>│ Driver │  (FOSSIL)      }
  16. {          (HotChar) (Other)             │        └────────┘                }
  17. {              │        │                │        ┌────────┐                }
  18. {     ┌────────┴─┐      │    ┌───────────┴┐    ┌─>│ Driver │  (CRT)         }
  19. {     │ External │      └───>│   Driver   ├────┘  └────────┘                }
  20. {     │  Driver  ├──────────>│ Collection ├────┐  ┌────────┐                }
  21. {     └──────────┘           └───────────┬┘    └─>│ Driver │  (ImageLog)    }
  22. {                                        │        └────────┘                }
  23. {                                        │        ┌────────┐                }
  24. {                                        └───────>│ Driver │  (Other)       }
  25. {                                                 └────────┘                }
  26.  
  27.  
  28. {$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
  29. {$F+} { . . . . . . . . . . . . . . . . . . . .  Force far calls for safety }
  30. {$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
  31. {$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
  32. {$Q-} { . . . . . . . . . . . . . .  Do not generate overflow-checking code }
  33. {$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
  34. {$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
  35. {$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
  36.  
  37. INTERFACE
  38.  
  39. USES
  40.   Objects;
  41.  
  42. CONST
  43.   MaxStateDrivers = 50;
  44.  
  45. TYPE
  46.  
  47.   tColorScheme = RECORD
  48.     Lower : Byte;                     { . . . . . . . .  Lower case letters }
  49.     Upper : Byte;                     { . . . . . . . .  Upper case letters }
  50.     Digit : Byte;                     { . . . . . . . . .  Digits (numbers) }
  51.     HiBit : Byte;                     { . . . IBM Extended ASCII characters }
  52.     Punct : Byte;                     { .  Punctuation and misc. characters }
  53.     END;
  54.  
  55.   pColorScheme = ^tColorScheme;
  56.  
  57.  
  58.   { ┌─────────────────────────────────────────────────────────────────────┐ }
  59.   { │▒▒▒ tIODriver ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
  60.   { └─────────────────────────────────────────────────────────────────────┘ }
  61.   {                                                                         }
  62.   { The I/O Driver is one of the fundamental concepts of Concerto.  The     }
  63.   { stream of outbound characters is multiplexed (sprinkled) through all of }
  64.   { the I/O drivers registered with the system. Each I/O driver is merely a }
  65.   { descendent of tIODriver.                                                }
  66.  
  67.   tIODriver = OBJECT(tObject)
  68.  
  69.     Active  : Boolean;               { . . Is this driver currently active? }
  70.     NameCRC : LongInt;               { The 32-bit CRC of the driver's name. }
  71.  
  72.     CONSTRUCTOR Init(p:pChar);
  73.  
  74.     { Default behavior of each method                                       }
  75.     {                                                                       }
  76.     {     Abstract : run-time error 211                                     }
  77.     {     Ignore   : no operation                                           }
  78.     {     Other    : calls other methods                                    }
  79.  
  80.     PROCEDURE ClrEOL;                               VIRTUAL;     { Ignore   }
  81.     PROCEDURE ClrScr;                               VIRTUAL;     { Ignore   }
  82.     PROCEDURE Color(c:Byte);                        VIRTUAL;     { Ignore   }
  83.     PROCEDURE CursorDown(n:Byte);                   VIRTUAL;     { Ignore   }
  84.     PROCEDURE CursorLeft(n:Byte);                   VIRTUAL;     { Ignore   }
  85.     PROCEDURE CursorRight(n:Byte);                  VIRTUAL;     { Ignore   }
  86.     PROCEDURE CursorUp(n:Byte);                     VIRTUAL;     { Ignore   }
  87.     PROCEDURE GotoXY(x,y:Byte);                     VIRTUAL;     { Ignore   }
  88.     PROCEDURE Home;                                 VIRTUAL;     { Other    }
  89.     PROCEDURE PurgeInbound;                         VIRTUAL;     { Ignore   }
  90.     PROCEDURE PurgeOutbound;                        VIRTUAL;     { Ignore   }
  91.     PROCEDURE ReadChar(VAR c:Char);                 VIRTUAL;     { Abstract }
  92.     PROCEDURE SendChar(c:Char);                     VIRTUAL;     { Abstract }
  93.     PROCEDURE SendData(p:Pointer; s:Word);          VIRTUAL;     { Other    }
  94.     PROCEDURE SendpChar(p:pChar);                   VIRTUAL;     { Other    }
  95.     PROCEDURE SendString(CONST s:OpenString);       VIRTUAL;     { Other    }
  96.     FUNCTION  Waiting:Boolean;                      VIRTUAL;     { Abstract }
  97.     END;
  98.  
  99.   pIODriver = ^tIODriver;
  100.  
  101.  
  102.   { ┌─────────────────────────────────────────────────────────────────────┐ }
  103.   { │▒▒▒ tIODriverTextGfx ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
  104.   { └─────────────────────────────────────────────────────────────────────┘ }
  105.  
  106.   { This descendent of tIODriver overrides the color/cursor procedures.     }
  107.   { The calls are converted to ASCII/ANSI/AVATAR text codes.                }
  108.  
  109.   tIODriverTextGfx = OBJECT(tIODriver)
  110.  
  111.     Graphics : Byte;
  112.  
  113.     PROCEDURE ClrEOL;               VIRTUAL;
  114.     PROCEDURE ClrScr;               VIRTUAL;
  115.     PROCEDURE Color(c:Byte);        VIRTUAL;
  116.     PROCEDURE CursorLeft(n:Byte);   VIRTUAL;
  117.     PROCEDURE CursorRight(n:Byte);  VIRTUAL;
  118.     PROCEDURE GotoXY(x,y:Byte);     VIRTUAL;
  119.     END;
  120.  
  121.   pIODriverTextGfx = ^tIODriverTextGfx;
  122.  
  123.  
  124.   { ┌─────────────────────────────────────────────────────────────────────┐ }
  125.   { │▒▒▒ tIODriverRemote ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
  126.   { └─────────────────────────────────────────────────────────────────────┘ }
  127.   {                                                                         }
  128.   { This object provides additional support for I/O drivers used in a       }
  129.   { communications setting.  You will still need to override the IO-        }
  130.   { specific methods.  Since many remote terminals use ANSI and other color }
  131.   { protocols, this object is a descendent of tIODriverTextGfx.             }
  132.  
  133.   tIODriverRemote = OBJECT(tIODriverTextGfx)
  134.  
  135.     Baud    : LongInt;
  136.     ComPort : Word;
  137.     Locked  : LongInt;
  138.  
  139.     CONSTRUCTOR Init(p:pChar; c:Word; b,l:LongInt);
  140.  
  141.     FUNCTION  CarrierDetect:Boolean;  VIRTUAL;
  142.     PROCEDURE LowerDTR;               VIRTUAL;
  143.     PROCEDURE RaiseDTR;               VIRTUAL;
  144.     PROCEDURE SetBaud(b,l:LongInt);   VIRTUAL;
  145.     END;
  146.  
  147.   pIODriverRemote = ^tIODriverRemote;
  148.  
  149.  
  150.   { ┌─────────────────────────────────────────────────────────────────────┐ }
  151.   { │▒▒▒ tStateDriver ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
  152.   { └─────────────────────────────────────────────────────────────────────┘ }
  153.  
  154.   { The state driver system allows you to install any color protocol without
  155.     recompiling the IO unit.  This system will be documented in the next
  156.     release. }
  157.  
  158.   tStateDriver = RECORD
  159.     Active  : Boolean;             { . . . . . Is this state driver active? }
  160.     Handler : PROCEDURE (c:Char);  { . . Who gets the stream of characters? }
  161.     NameCRC : LongInt;             { The 32-bit CRC of the driver's family. }
  162.     END;
  163.  
  164.   pStateDriver = ^tStateDriver;
  165.  
  166. CONST
  167.  
  168.   ColorScheme    : pColorScheme = NIL;    { . . . . .  Current color scheme }
  169.   DBS            : Boolean     = False;   { . . . .  Destructive backspaces }
  170.   IOState        : Byte        = 0;       { . . . . . . . Current I/O state }
  171.   LastChar       : Char        = #0;      { . . .  Last character processed }
  172.   LastPrinted    : Char        = #0;      { . . .  Last character displayed }
  173.   LastTime       : LongInt     = 0;       { . Clock ticks at last keystroke }
  174.   NoTimeProc     : PROCEDURE   = NIL;     { . . . . . Called if out of time }
  175.   Origin         : pIODriver   = NIL;     { Origin of the last inbound char }
  176.   SaveX          : Byte        = 0;       { . . . Saved cursor position (x) }
  177.   SaveY          : Byte        = 0;       { . . . Saved cursor position (y) }
  178.   StartedAt      : LongInt     = 0;       { . . Activation time of the unit }
  179.   TextAttr       : Byte        = 0;       { . . . . . .  Current text color }
  180.   TextBufferSize : Word        = 1024;    {  Buffer size when loading files }
  181.   TextDir        : pChar       = NIL;     { . . . .  Location of text files }
  182.   Threshold      : Word        = 500;     { . . . . .  Timeslicer threshold }
  183.   TimeLeft       : Word        = 60;      { . .  Minutes before forced halt }
  184.   TimeOut        : Word        = 180;     { .  Seconds before timeout error }
  185.   TimeOutProc    : PROCEDURE   = NIL;     { . . .  Called if timeout occurs }
  186.  
  187. CONST
  188.  
  189.   IceChatColors : tColorScheme =
  190.     ( Lower : 15;
  191.       Upper : 07;
  192.       Digit : 11;
  193.       HiBit : 01;
  194.       Punct : 09 );
  195.  
  196. VAR
  197.  
  198.   { The following structures will be documented in the next version! }
  199.  
  200.   StateChars   : ARRAY[#0..#255] OF Byte;
  201.   StateDrivers : ARRAY[1..MaxStateDrivers] OF tStateDriver;
  202.   Drivers      : tCollection;
  203.  
  204.  
  205. PROCEDURE ActivateAll;
  206.   {
  207.   PURPOSE  : Activates every I/O driver.
  208.  
  209.   NOTES    : This procedure is generally used after you have temporarily
  210.              suspended one or more drivers (such as when displaying a
  211.              sysop-only screen).
  212.  
  213.   SEE ALSO : DeactivateAllExceptPtr
  214.   }
  215.  
  216.  
  217. PROCEDURE DeactivateAllExceptPtr(p:pIODriver);
  218.   {
  219.   PURPOSE  : Deactivates a specific I/O driver.
  220.  
  221.   NOTES    : The driver is suspended, not deallocated.
  222.  
  223.   SEE ALSO : ActivateAll
  224.   }
  225.  
  226.  
  227. FUNCTION DecTimeLeft(n:Word):Word;
  228.   {
  229.   PURPOSE  : Subtracts the number of minutes remaining in the session.
  230.  
  231.   SEE ALSO : IncTimeLeft
  232.   }
  233.  
  234.  
  235. FUNCTION FirstOpenState:Byte;
  236.   { INTERNAL USE ONLY UNTIL THE JUNE/JULY RELEASE OF CONCERTO!              }
  237.  
  238.  
  239. FUNCTION IncTimeLeft(n:Word):Word;
  240.   {
  241.   PURPOSE  : Adds to the number of minutes remaining in this session.
  242.  
  243.   SEE ALSO : DecTimeLeft
  244.   }
  245.  
  246.  
  247. PROCEDURE RegisterAmpersand;
  248.   {
  249.   PURPOSE  : Registers the Ampersand state driver.
  250.  
  251.   NOTES    : The ampersand driver handles both PCBoard @Xxx codes and
  252.              WildCat! @xx@ codes.
  253.  
  254.   SEE ALSO : RegisterANSI, RegisterAVATAR, RegisterControlK, RegisterHexPipe,
  255.              RegisterLORD
  256.   }
  257.  
  258.  
  259. PROCEDURE RegisterANSI;
  260.   {
  261.   PURPOSE  : Registers the ANSI state driver.
  262.  
  263.   NOTES    : The driver implements a subset of the full ANSI standard.
  264.  
  265.   SEE ALSO : RegisterAmpersand, RegisterAVATAR, RegisterControlK,
  266.              RegisterHexPipe, RegisterLORD
  267.   }
  268.  
  269.  
  270. PROCEDURE RegisterAVATAR;
  271.   {
  272.   PURPOSE  : Registers the AVATAR/0+ state driver.
  273.  
  274.   NOTES    : The driver does not handle AVATAR scrolling functions.
  275.  
  276.   SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterControlK,
  277.              RegisterHexPipe, RegisterLORD
  278.   }
  279.  
  280.  
  281. PROCEDURE RegisterControlK;
  282.   {
  283.   PURPOSE  : Registers the ^K state driver.
  284.  
  285.   NOTES    : Control-K codes are in the format ^K[xx, where ^K is ASCII
  286.              character #11 and xx is the hexadecimal representation of
  287.              a color.  These codes are used by RemoteAccess.
  288.  
  289.   SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterAVATAR,
  290.              RegisterHexPipe, RegisterLORD
  291.   }
  292.  
  293.  
  294. PROCEDURE RegisterHexPipe;
  295.   {
  296.   PURPOSE  : Registers the HexPipe state driver.
  297.  
  298.   NOTES    : HexPipe codes are in the format |xx, where xx is the
  299.              hexadecimal representation of a color.  This is similar to
  300.              RemoteAccess's control-k code system.
  301.  
  302.   SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterAVATAR,
  303.              RegisterControlK, RegisterLORD
  304.   }
  305.  
  306.  
  307. PROCEDURE RegisterLORD;
  308.   {
  309.   PURPOSE  : Registers the LORD (Legend of the Red Dragon) color system.
  310.  
  311.   SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterAVATAR,
  312.              RegisterControlK, RegisterHexPipe
  313.   }
  314.  
  315.  
  316. PROCEDURE RegisterState(Family:pChar; VAR Index:Byte; Handler:Pointer);
  317.   {                                                                         }
  318.   { INTERNAL USE ONLY UNTIL THE JUNE/JULY RELEASE!                          }
  319.   {                                                                         }
  320.   { Registers a handler with the state-driver.                              }
  321.   {                                                                         }
  322.   { Family    The family name of the handler.  The 32-bit CRC of the name   }
  323.   {           is stored in an internal record.  This allows an external     }
  324.   {           facility (outside of IO.TPU) to reference a group of          }
  325.   {           related handlers -- such as all of the handlers used to       }
  326.   {           interpret ANSI sequences.                                     }
  327.   {                                                                         }
  328.   { Index     An arbitrary number assigned to this handler.  This number    }
  329.   {           is used to identify this particular driver in the future.     }
  330.   {                                                                         }
  331.   { Handler   A pointer to a procedure.                                     }
  332.  
  333.  
  334. FUNCTION SetColorScheme(p:pColorScheme):pColorScheme;
  335.   {
  336.   PURPOSE  : Changes to the specified color scheme.
  337.  
  338.   RETURN   : The current color scheme.  You should save this value for
  339.              later restoration.
  340.   }
  341.  
  342.  
  343. PROCEDURE SetHotChar(c:Char; s:Byte);
  344.   {
  345.   INTERNAL USE ONLY UNTIL THE JUNE/JULY RELEASE!
  346.   }
  347.  
  348.  
  349. FUNCTION SetNoTimeProcedure(p:Pointer):Pointer;
  350.   {
  351.   PURPOSE  : Changes the no-time-left procedure.
  352.  
  353.   RETURNS  : A pointer to the current procedure, or NIL.
  354.   }
  355.  
  356.  
  357. FUNCTION SetTimeOutProcedure(p:Pointer):Pointer;
  358.   {
  359.   PURPOSE  : Changes the time-out procedure.
  360.  
  361.   RETURNS  : A pointer to the current time-out procedure, or NIL.
  362.   }
  363.  
  364.  
  365. FUNCTION SI_Boolean(Prompt:pChar; Default:Boolean):Boolean;
  366.   {
  367.   PURPOSE  : This is a high-level boolean-entry routine.
  368.  
  369.   NOTES    : The prompt and a color-coded selection-bar is displayed.  The
  370.              user may press Y (true) or N (false).  The screen is updated
  371.              with the response ("Yes" or "No").
  372.   }
  373.  
  374.  
  375. PROCEDURE SI_Char(VAR c:Char);
  376.   {
  377.   PURPOSE  : Reads a single character.
  378.  
  379.   NOTES    : The character is retrieved from the first IO driver with
  380.              a character waiting.  Use the Origin pointer if you need to
  381.              know the exact driver.
  382.  
  383.              This is the master keyboard polling routine.  All input
  384.              routines ultimately call this procedure.
  385.  
  386.   SEE ALSO : SI_KeyPressed, Origin
  387.   }
  388.  
  389.  
  390. PROCEDURE SI_DefaultMorePrompt;
  391.   {
  392.   PURPOSE  : Waits for the enter key (ASCII #13).
  393.  
  394.   NOTES    : Nothing is displayed.
  395.  
  396.   SEE ALSO : SO_ReadChar
  397.   }
  398.  
  399.  
  400. FUNCTION SI_KeyPressed:Boolean;
  401.   {
  402.   PURPOSE  : Returns TRUE if a character is waiting.
  403.  
  404.   NOTES    : This is a non-destructive read.  That is, you will need to
  405.              use SO_ReadChar to remove the character from the buffer.
  406.  
  407.   SEE ALSO : SO_ReadChar
  408.   }
  409.  
  410.  
  411. PROCEDURE SI_LORDMorePrompt;
  412.   {
  413.   PURPOSE  : Simulates the LORD (Legend of the Red Dragon) <MORE> prompt.
  414.  
  415.   SEE ALSO : SI_DefaultMorePrompt;
  416.   }
  417.  
  418.  
  419. FUNCTION SI_pChar(p:pChar; MaxLen:Byte):pChar;
  420.   {
  421.   PURPOSE  : Provides a simple string input routine.
  422.  
  423.   NOTES    : MaxLen specifies the maximum length of the string.  It is up
  424.              to you to make sure that the input field does not wrap across
  425.              the screen.  If p is not empty, the user will be able to
  426.              edit the characters.  No range checking is performed.
  427.  
  428.   SEE ALSO : SI_Char
  429.   }
  430.  
  431.  
  432. PROCEDURE SI_Purge;
  433.   {
  434.   PURPOSE  : Removes any characters from the inbound buffer.
  435.  
  436.   SEE ALSO : SO_Purge
  437.   }
  438.  
  439.  
  440. FUNCTION SI_Randomize(p:pChar):Word;
  441.   {
  442.   PURPOSE  : Initializes the random number generator.
  443.  
  444.   NOTES    : If p is 'Timer', then the random number seed is obtained
  445.              from the system clock.  If p is 'Ask', then the user is
  446.              prompted for the number.  Anything other string is
  447.              converted to a numeric value.
  448.   }
  449.  
  450.  
  451. PROCEDURE SO_Char(c:Char);
  452.   {
  453.   PURPOSE  : Displays a single character.
  454.  
  455.   SEE ALSO : SO_pChar, SO_SendString
  456.   }
  457.  
  458.  
  459. PROCEDURE SO_ClearRegion(x,y1,y2:Byte);
  460.   {
  461.   PURPOSE  : Clears the region within the box.
  462.  
  463.   PARAMS   : x    Left-column of box
  464.              y1   Top row
  465.              y2   Bottom row
  466.  
  467.   NOTES    : This procedure uses the SO_ClrEOL procedure to quickly
  468.              clear the region.  The cursor is moved to the upper-left
  469.              corner of the box when finished.
  470.  
  471.   SEE ALSO : SO_ClrScr, SO_ClrScrWith
  472.   }
  473.  
  474.  
  475. PROCEDURE SO_ClrEOL;
  476.   {
  477.   PURPOSE  : Erases all of the characters between the cursor and the left
  478.              side of the screen, inclusively.
  479.  
  480.   SEE ALSO : SO_ClrEOLWith, SO_ClrScr, SO_ClrScrWith
  481.   }
  482.  
  483.  
  484. PROCEDURE SO_ClrEOLWith(c:Byte);
  485.   {
  486.   PURPOSE  : Changes the color and calls SO_ClrEOL at the same time.
  487.  
  488.   SEE ALSO : SO_ClrEOL, SO_ClrScr, SO_ClrScrWith, SO_Color
  489.   }
  490.  
  491.  
  492. PROCEDURE SO_ClrScr;
  493.   {
  494.   PURPOSE  : Clears the screen using the current color.
  495.  
  496.   NOTES    : The status line (if visible) is not affected.  The cursor is
  497.              moved to the upper-left corner of the screen.
  498.  
  499.   SEE ALSO : SO_ClearRegion, SO_ClrEOL, SO_ClrScrWith, SO_Color, SO_GotoXY,
  500.              SO_Home
  501.   }
  502.  
  503.  
  504. PROCEDURE SO_ClrScrWith(c:Byte);
  505.   {
  506.   PURPOSE  : Clears the screen using the specified color.
  507.  
  508.   NOTES    : The color change is permanent.
  509.  
  510.   SEE ALSO : SO_ClearRegion, SO_ClrEOL, SO_ClrScr, SO_Color, SO_GotoXY,
  511.              SO_Home
  512.   }
  513.  
  514.  
  515. FUNCTION SO_Color(c:Byte):Byte;
  516.   {
  517.   PURPOSE  : Changes the current color.
  518.  
  519.   RETURNS  : The current color (before the change).
  520.  
  521.   NOTES    : You should never modify TextAttr directly, since the IO drivers
  522.              will not be aware of the change.  Use this procedure instead,
  523.              which sends the color change to each driver.
  524.  
  525.   SEE ALSO : SO_ClrEOLWith, SO_ClrScrWith
  526.   }
  527.  
  528.  
  529. PROCEDURE SO_CRLF;
  530.   {
  531.   PURPOSE  : Outputs a carriage-return/line-feed sequence.
  532.  
  533.   NOTES    : This is essentially the same as SO_pChar(#13#10).
  534.  
  535.   SEE ALSO : SO_pChar, SO_pCharLn
  536.   }
  537.  
  538.  
  539. PROCEDURE SO_CursorDown(n:Byte);
  540.   {
  541.   PURPOSE  : Moves the cursor down.
  542.  
  543.   SEE ALSO : SO_CursorLeft, SO_CursorRight, SO_CursorUp, SO_GotoXY, SO_Home
  544.   }
  545.  
  546.  
  547. PROCEDURE SO_CursorLeft(n:Byte);
  548.   {
  549.   PURPOSE  : Moves the cursor left.
  550.  
  551.   SEE ALSO : SO_CursorDown, SO_CursorRight, SO_CursorUp, SO_GotoXY, SO_Home
  552.   }
  553.  
  554.  
  555. PROCEDURE SO_CursorRight(n:Byte);
  556.   {
  557.   PURPOSE  : Moves the cursor right.
  558.  
  559.   SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorUp, SO_GotoXY, SO_Home
  560.   }
  561.  
  562.  
  563. PROCEDURE SO_CursorUp(n:Byte);
  564.   {
  565.   PURPOSE  : Moves the cursor up.
  566.  
  567.   SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight, SO_GotoXY, SO_Home
  568.   }
  569.  
  570.  
  571. FUNCTION SO_DetectANSI(p:pIODriverRemote; Msg:pChar):Boolean;
  572.   {
  573.   PURPOSE  : Checks for ANSI capabilities on the remote system.
  574.  
  575.   NOTES    : The procedure first sends the special sequence ESC[6n, which
  576.              is normally used to request the current position of the cursor.
  577.              The procedure is not actually interested in the cursor position,
  578.              but rather the response of the terminal.
  579.  
  580.              ANSI-capable terminals will return the cursor position in
  581.              the format ESC[#;#R.  A valid response implies ANSI support.
  582.  
  583.              If ANSI is not detected, the procedure will ask the user
  584.              for his/her preference.
  585.   }
  586.  
  587.  
  588. FUNCTION SO_DisplayFile(p:pChar):Boolean;
  589.   {
  590.   PURPOSE  : Displays the specified file.
  591.  
  592.   NOTES    : Concerto loads the specified file and sends it to SO_pChar for
  593.              processing.  TRUE is returned if the operation was successful.
  594.              FALSE is returned if the procedure could not load the file.
  595.  
  596.              Concerto will check the contents of TextDir.  If this string
  597.              is not nil, then Concerto will use this directory rather then
  598.              the one specified by the programmer.
  599.  
  600.   SEE ALSO : SO_pChar, TextDir
  601.   }
  602.  
  603.  
  604. PROCEDURE SO_GotoXY(x,y:Byte);
  605.   {
  606.   PURPOSE  : Changes the position of the the cursor.
  607.  
  608.   NOTES    : This procedure changes the position of the cursor in ANSI or
  609.              AVATAR mode.  The upper-left corner of the screen has the
  610.              coordinates (1,1).  Invalid coordinates are ignore.
  611.  
  612.   SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight,
  613.              SO_CursorUp, SO_Home
  614.  
  615.   EXAMPLE  : FOR n:=1 TO Random(200) DO
  616.                BEGIN
  617.                SO_GotoXY(Random(80)+1,Random(23)+1);
  618.                SO_Color(Random(16));
  619.                SO_SendChar(#219);
  620.                END;
  621.  
  622.   SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight,
  623.              SO_CursorUp, SO_Home
  624.   }
  625.  
  626.  
  627. PROCEDURE SO_Home;
  628.   {
  629.   PURPOSE  : Moves the cursor to the home position.
  630.  
  631.   NOTES    : This procedure moves the cursor to the upper-left corner
  632.              of the screen.  This is essentially the same as calling
  633.              SO_GotoXY(1,1).
  634.  
  635.   SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight,
  636.              SO_CursorUp, SO_GotoXY
  637.   }
  638.  
  639.  
  640. PROCEDURE SO_Noise;
  641.   {
  642.   PURPOSE  : Generates fake line noise.
  643.   }
  644.  
  645.  
  646. PROCEDURE SO_Purge;
  647.   {
  648.   PURPOSE  : Removes any characters from the outbound buffer.
  649.  
  650.   SEE ALSO : SI_Purge;
  651.   }
  652.  
  653.  
  654. PROCEDURE SO_pChar(p:pChar);
  655.   {
  656.   PURPOSE  : Displays the null-terminated string.  Color-codes are processed.
  657.  
  658.   NOTES    : This is the Master display routine.  All other output procedures
  659.              ultimately call this procedure, except for the raw-output set
  660.              of procedures.
  661.  
  662.   SEE ALSO : SO_pCharLn
  663.   }
  664.  
  665.  
  666. PROCEDURE SO_pCharLn(p:pChar);
  667.   {
  668.   PURPOSE  : Displays the null-terminated string.
  669.  
  670.   NOTES    : A carriage-return/line-feed sequence is also sent.
  671.  
  672.   SEE ALSO : SO_CRLF, SO_pChar
  673.   }
  674.  
  675.  
  676. PROCEDURE SO_RawChar(c:Char);
  677. PROCEDURE SO_RawpChar(s:pChar);
  678. PROCEDURE SO_RawString(CONST s:OpenString);
  679.   { These procedures bypass the state-driver system; text is sent to each   }
  680.   { driver with no processing.  HotChars are not intercepted.               }
  681.  
  682.  
  683. PROCEDURE SO_ShadeBar(Selection:Byte);
  684.   {
  685.   PURPOSE  : Displays a shaded bar for general use.
  686.  
  687.   NOTES    : This procedure is used by SO_DetectANSI when inquiring the
  688.              caller about his/her ANSI capabilities.  The bar is six
  689.              characters long.  Future versions will support scaling.
  690.  
  691.              Selection = 0 : Random color palette
  692.  
  693.                          1 : Darkgray  ->  White
  694.                          2 : Green     ->  Yellow
  695.                          3 : Red       ->  Yellow
  696.                          4 : Cyan      ->  White
  697.                          5 : Blue      ->  Light Cyan
  698.                          6 : Magenta   ->  White
  699.  
  700.   SEE ALSO : SO_DetectANSI
  701.   }
  702.  
  703.  
  704. PROCEDURE SO_String(CONST s:OpenString);
  705.   {
  706.   PURPOSE  : Displays a classic Turbo Pascal string.
  707.  
  708.   NOTES    : The string is converted to a pChar and sent to SO_pChar.
  709.  
  710.   SEE ALSO : SO_pChar
  711.   }
  712.  
  713.  
  714.  
  715.