home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / src / term.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-17  |  4.2 KB  |  141 lines

  1. /*
  2.  * This file is part of the portable Forth environment written in ANSI C.
  3.  * Copyright (C) 1995  Dirk Uwe Zoller
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13.  * See the GNU Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public
  16.  * License along with this library; if not, write to the Free
  17.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  * This file is version 0.9.13 of 17-July-95
  20.  * Check for the latest version of this package via anonymous ftp at
  21.  *    roxi.rz.fht-mannheim.de:/pub/languages/forth/pfe-VERSION.tar.gz
  22.  * or    sunsite.unc.edu:/pub/languages/forth/pfe-VERSION.tar.gz
  23.  * or    ftp.cygnus.com:/pub/forth/pfe-VERSION.tar.gz
  24.  *
  25.  * Please direct any comments via internet to
  26.  *    duz@roxi.rz.fht-mannheim.de.
  27.  * Thank You.
  28.  */
  29. /*
  30.  * term.h ---    Declarations for terminal driver of pfe.
  31.  *        It doesn't matter how you supply these functions,
  32.  *          --- just do it!
  33.  *        For an example driver refer to term-ux.c.
  34.  * (duz 09May93)
  35.  */
  36.  
  37. #ifndef __TERM_H
  38. #define __TERM_H
  39.  
  40. enum ekey_codes            /* The function keys known to pfe */
  41. {
  42.   EKEY_k1 = 0x100,        /* function keys F1 through F10 */
  43.   EKEY_k2,
  44.   EKEY_k3,
  45.   EKEY_k4,
  46.   EKEY_k5,
  47.   EKEY_k6,
  48.   EKEY_k7,
  49.   EKEY_k8,
  50.   EKEY_k9,
  51.   EKEY_k0,
  52.  
  53.   /* "kl", "kr", "ku", "kd" */
  54.   EKEY_kl,            /* arrow key left */
  55.   EKEY_kr,            /* arrow key right */
  56.   EKEY_ku,            /* arrow key up */
  57.   EKEY_kd,            /* arrow key down */
  58.   /* "kh", "kH", "kN", "kP" */
  59.   EKEY_kh,            /* home key */
  60.   EKEY_kH,            /* home down key */
  61.   EKEY_kN,            /* next page key */
  62.   EKEY_kP,            /* previous page key */
  63.   /* "kb", "kD", "kM", "kI" */
  64.   EKEY_kb,            /* backspace key */
  65.   EKEY_kD,            /* delete character key */
  66.   EKEY_kM,            /* exit insert mode key */
  67.   EKEY_kI,            /* insert character key */
  68.   /* "kA", "kE", "kL", "kC" */
  69.   EKEY_kA,            /* insert line key */
  70.   EKEY_kE,            /* clear to end of line key */
  71.   EKEY_kL,            /* delete line key */
  72.   EKEY_kC,            /* clear screen key */
  73.   /* count the keys: */
  74.   EKEY_LAST,
  75.   NO_OF_KEYS = EKEY_LAST - EKEY_k1
  76. };
  77.  
  78. extern char
  79.   *rawkey_string [NO_OF_KEYS];    /* what all those keys really send */
  80.  
  81. /*
  82.  * These variables are defined in the term.c and initialized by
  83.  * term-xxx:prepare_terminal().  If window size can change, it would
  84.  * be nice if they were kept up to date.
  85.  */
  86. extern int rows, cols;        /* size of text screen */
  87. extern int xmax, ymax;        /* size of graphics window in pixels */
  88.  
  89. /* Refer to termcap.c for what these functions are expected to do: */
  90.  
  91. int tty_interrupt_key (char ch);
  92. int prepare_terminal (void);
  93. void interactive_terminal (void);
  94. void system_terminal (void);
  95. void query_winsize (void);
  96.  
  97. int c_keypressed (void);    /* I added the "c_"-prefix to avoid */
  98. int c_getkey (void);        /* name clashes */
  99.  
  100. void c_putc_noflush (char c);
  101. void c_flush (void);
  102. void c_putc (char c);
  103. void c_puts (const char *s);
  104. void c_gotoxy (int x, int y);
  105. void c_wherexy (int *x, int *y);
  106.  
  107. void c_goleft (void);
  108. void c_goright (void);
  109. void c_goup (void);
  110. void c_godown (void);
  111.  
  112. void c_home (void);
  113. void c_clrscr (void);
  114. void c_clreol (void);
  115. void c_clrdown (void);
  116. void c_bell (void);
  117.  
  118. void c_standout_on (void);
  119. void c_standout_off (void);
  120. void c_bright (void);
  121. void c_reverse (void);
  122. void c_blinking (void);
  123. void c_normal (void);
  124. void c_underline_on (void);
  125. void c_underline_off (void);
  126.  
  127. /* These are not part of the driver, but system independent, in term.c */
  128.  
  129. int printable (int c);        /* like isprint() for ISO-characters */
  130. void c_putc_printable (int c);    /* like cputc() but certainly visible */
  131. int change_case (int key);    /* exchange lower case with upper case char */
  132. int getekey (void);        /* get a character like EKEY */
  133. int ekeypressed (void);        /* check for extended key available */
  134. int getwskey (void);        /* get a character, for block editor */
  135.  
  136. extern void (*on_stop) (void);
  137. extern void (*on_continue) (void);
  138. extern void (*on_winchg) (void);
  139.  
  140. #endif
  141.