00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #if defined( Uses_TTextDevice ) && !defined( __TTextDevice )
00013 #define __TTextDevice
00014
00019 #include <iostream.h>
00020
00021 class TRect;
00022 class TScrollBar;
00023
00035 class TTextDevice : public TScroller
00036 {
00037 public:
00044 TTextDevice( const TRect& bounds,
00045 TScrollBar *aHScrollBar,
00046 TScrollBar *aVScrollBar
00047 );
00054 virtual int do_sputn( const char *s, int count ) = 0;
00055 };
00056
00057 #endif // Uses_TTextDevice
00058
00059 #if defined( Uses_TTerminal ) && !defined( __TTerminal )
00060 #define __TTerminal
00061
00062 class TRect;
00063 class TScrollBar;
00064
00070 class TTerminal: public TTextDevice
00071 {
00072 public:
00084 TTerminal( const TRect& bounds,
00085 TScrollBar *aHScrollBar,
00086 TScrollBar *aVScrollBar,
00087 ushort aBufSize
00088 );
00092 ~TTerminal();
00099 virtual int do_sputn( const char *s, int count );
00104 void bufInc( ushort& val );
00110 Boolean canInsert( ushort amount );
00114 short calcWidth();
00121 virtual void draw();
00126 ushort nextLine( ushort pos );
00131 ushort prevLines( ushort pos, ushort lines );
00135 Boolean queEmpty();
00136 protected:
00140 ushort bufSize;
00144 char *buffer;
00148 ushort queFront;
00152 ushort queBack;
00157 void bufDec(ushort& val);
00158 #ifndef __UNPATCHED
00159
00162 ushort curLineWidth;
00163 #endif
00164 };
00165
00166 #endif // Uses_TTerminal
00167
00168 #if defined( Uses_otstream ) && !defined( __otstream )
00169 #define __otstream
00170
00171 class ostream;
00172
00173 #include <iostream.h>
00174
00178 class TerminalBuf: public streambuf
00179 {
00180 protected:
00184 TTerminal *term;
00185 public:
00189 TerminalBuf(TTerminal *tt);
00201 virtual int overflow( int c = EOF );
00205 virtual int sync();
00206 };
00207
00211 class otstream : public ostream
00212 {
00213 protected:
00217 TerminalBuf buf;
00218 public:
00222 otstream( TTerminal *tt );
00223 };
00224
00225 #endif