Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

textview.h

Go to the documentation of this file.
00001 /*
00002  * textview.h
00003  *
00004  * Turbo Vision - Version 2.0
00005  *
00006  * Copyright (c) 1994 by Borland International
00007  * All Rights Reserved.
00008  *
00009  * Modified by Sergio Sigala <sergio@sigala.it>
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;   // Added horizontal cursor tracking
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

Generated at Sat Sep 22 20:19:12 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001