File: term.h

package info (click to toggle)
hf 0.7.3-4etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 3,684 kB
  • ctags: 3,156
  • sloc: ansic: 26,447; cpp: 4,909; sh: 3,785; makefile: 309
file content (58 lines) | stat: -rw-r--r-- 1,606 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 *    term.cc  --  simple split mode terminal
 *
 *    Copyright (C) 1999-2004 Pawel Jalocha, SP9VRC
 *
 *    This file is part of MT63.
 *
 *    MT63 is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    MT63 is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with MT63; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifdef __MSDOS__
#include <conio.h>
#else
#include <curses.h>
#endif

class SplitTerm
{ public:
   SplitTerm(); ~SplitTerm();
   int Preset(int TxLines=0);
   void Close(void);
   int UserInp(int &key);
   void RxOut(char ch);
   void RxStr(char *str);
   void TxOut(char ch);
   void Status(int Stat, char *Str);
   inline void RxStatUpp(char *Str) { Status(0,Str); }
   inline void RxStatLow(char *Str) { Status(1,Str); }
   inline void TxStatUpp(char *Str) { Status(2,Str); }
   inline void TxStatLow(char *Str) { Status(3,Str); }

  private:
   int Init;
   int Width,Height;

   int RxPos, RxLen;
   int RxCurX, RxCurY, RxAct;

   int TxPos, TxLen;
   int TxCurX, TxCurY, TxAct;

   int StatPos[4];

   void ChOut(char ch);
} ;