home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D3.DMS / in.adf / Interfaces / Console.mod < prev    next >
Encoding:
Text File  |  1993-05-22  |  3.4 KB  |  123 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Interface Module:                    Date: 21-May-93      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Fridtjof Siebert                                            *)
  6. (*   updated for V39 by hartmut Goebel                                     *)
  7. (*                                                                         *)
  8. (*-------------------------------------------------------------------------*)
  9.  
  10. MODULE Console;
  11.  
  12. IMPORT e  * := Exec,
  13.        ie * := InputEvent,
  14.        km * := KeyMap,
  15.        u  * := Utility;
  16.  
  17. CONST
  18.  
  19.   consoleName * = "console.device";
  20.  
  21. (****** Console commands ******)
  22.   askKeyMap         * = e.nonstd+0;
  23.   setKeyMap         * = e.nonstd+1;
  24.   askDefaultKeyMap  * = e.nonstd+2;
  25.   setDefaultKeyMap  * = e.nonstd+3;
  26.  
  27. (****** SGR parameters ******)
  28.  
  29.   primary     * = 0;
  30.   bold        * = 1;
  31.   italic      * = 3;
  32.   underscore  * = 4;
  33.   negative    * = 7;
  34.  
  35.   normal        * = 22;      (* default foreground color, not bold *)
  36.   notItalic     * = 23;
  37.   notUnderscore * = 24;
  38.   positive      * = 27;
  39.  
  40. (* these names refer to the ANSI standard, not the implementation *)
  41.   blank       * = 30;
  42.   red         * = 31;
  43.   green       * = 32;
  44.   yellow      * = 33;
  45.   blue        * = 34;
  46.   magenta     * = 35;
  47.   cyan        * = 36;
  48.   white       * = 37;
  49.   default     * = 39;
  50.  
  51.   blackBg     * = 40;
  52.   redBg       * = 41;
  53.   greenBg     * = 42;
  54.   yellowBg    * = 43;
  55.   blueBg      * = 44;
  56.   magentaBg   * = 45;
  57.   cyanBg      * = 46;
  58.   whiteBg     * = 47;
  59.   defaultBg   * = 49;
  60.  
  61. (* these names refer to the implementation, they are the preferred *)
  62. (* names for use with the Amiga console device. *)
  63.   clr0        * = 30;
  64.   clr1        * = 31;
  65.   clr2        * = 32;
  66.   clr3        * = 33;
  67.   clr4        * = 34;
  68.   clr5        * = 35;
  69.   clr6        * = 36;
  70.   clr7        * = 37;
  71.  
  72.   clr0Bg      * = 40;
  73.   clr1Bg      * = 41;
  74.   clr2Bg      * = 42;
  75.   clr3Bg      * = 43;
  76.   clr4Bg      * = 44;
  77.   clr5Bg      * = 45;
  78.   clr6Bg      * = 46;
  79.   clr7Bg      * = 47;
  80.  
  81.  
  82. (****** DSR parameters ******)
  83.  
  84.   dsrCpr      * = 6;
  85.  
  86. (****** CTC parameters ******)
  87.   ctcHSetTab     * = 0;
  88.   ctcHClrTab     * = 2;
  89.   ctcHClrTabsAll * = 5;
  90.  
  91. (****** TBC parameters ******)
  92.   tbcHClrTab     * = 0;
  93.   tbcHClrTabsAll * = 3;
  94.  
  95. (****** SM and RM parameters ******)
  96.   mLNM   * = 20;      (* linefeed newline mode *)
  97.   mASM   * = ">1";    (* auto scroll mode *)
  98.   mAWM   * = "?7";    (* auto wrap mode *)
  99.  
  100.  
  101. VAR
  102. (*
  103.  *  You have to put a pointer to the console.device here to use the input
  104.  *  procedures:
  105.  *)
  106.  
  107.   base * : e.DevicePtr;
  108.  
  109. PROCEDURE CDInputHandler*{base,- 42}(events{8}        : ie.InputEventPtr;
  110.                                      consoleDevice{9} : e.LibraryPtr): ie.InputEventPtr;
  111. PROCEDURE RawKeyConvert *{base,- 48}(events{8}        : e.APTR;
  112.                                      VAR buffer{9}    : ARRAY OF e.BYTE;
  113.                                      length{1}        : LONGINT;
  114.                                      keyMap{10}       : km.KeyMapPtr): LONGINT;
  115. (*--- functions in V36 or higher (distributed as Release 2.0) ---*)
  116. PROCEDURE GetConSnip    *{base,- 54}(): LONGINT;
  117. PROCEDURE SetConSnip    *{base,- 60}(snip{8}          : LONGINT);
  118. PROCEDURE AddConSnipHook*{base,- 66}(hook{8}          : u.HookPtr);
  119. PROCEDURE RemConSnipHook*{base,- 72}(hook{8}          : u.HookPtr);
  120.  
  121. END Console.
  122.  
  123.