home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tv20cpp.zip
/
tvision
/
textview.h
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-19
|
2KB
|
104 lines
/*
* textview.h
*
* Turbo Vision - Version 2.0
*
* Copyright (c) 1994 by Borland International
* All Rights Reserved.
*
* Modified by Sergio Sigala <ssigala@globalnet.it>
*/
#if defined( Uses_TTextDevice ) && !defined( __TTextDevice )
#define __TTextDevice
#include <iostream.h>
class TRect;
class TScrollBar;
class TTextDevice : public TScroller
{
public:
TTextDevice( const TRect& bounds,
TScrollBar *aHScrollBar,
TScrollBar *aVScrollBar
);
virtual int do_sputn( const char *s, int count ) = 0;
};
#endif // Uses_TTextDevice
#if defined( Uses_TTerminal ) && !defined( __TTerminal )
#define __TTerminal
class TRect;
class TScrollBar;
class TTerminal: public TTextDevice
{
public:
friend void genRefs();
TTerminal( const TRect& bounds,
TScrollBar *aHScrollBar,
TScrollBar *aVScrollBar,
ushort aBufSize
);
~TTerminal();
virtual int do_sputn( const char *s, int count );
void bufInc( ushort& val );
Boolean canInsert( ushort amount );
short calcWidth();
virtual void draw();
ushort nextLine( ushort pos );
ushort prevLines( ushort pos, ushort lines );
Boolean queEmpty();
protected:
ushort bufSize;
char *buffer;
ushort queFront, queBack;
void bufDec(ushort& val);
#ifndef __UNPATCHED
ushort curLineWidth; // Added horizontal cursor tracking
#endif
};
#endif // Uses_TTerminal
#if defined( Uses_otstream ) && !defined( __otstream )
#define __otstream
#include <iostream.h>
class TerminalBuf: public streambuf
{
protected:
TTerminal *term;
public:
TerminalBuf(TTerminal *tt);
virtual int overflow( int = EOF );
virtual int sync();
};
class otstream : public ostream
{
protected:
TerminalBuf buf;
public:
otstream( TTerminal *tt );
};
#endif