home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 2.ddi / TVINC.ZIP / TEXTVIEW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.6 KB  |  112 lines

  1. /* ------------------------------------------------------------------------*/
  2. /*                                                                         */
  3. /*   TEXTVIEW.H                                                            */
  4. /*                                                                         */
  5. /*   Copyright (c) Borland International 1991                              */
  6. /*   All Rights Reserved.                                                  */
  7. /*                                                                         */
  8. /*   defines the classes TTextDevice and TTerminal                         */
  9. /*                                                                         */
  10. /* ------------------------------------------------------------------------*/
  11.  
  12. #pragma option -Vo-
  13. #if defined( __BCOPT__ )
  14. #pragma option -po-
  15. #endif
  16.  
  17. #if defined( Uses_TTextDevice ) && !defined( __TTextDevice )
  18. #define __TTextDevice
  19.  
  20. #include <iostream.h>
  21. #pragma option -Vo-
  22. #if defined( __BCOPT__ )
  23. #pragma option -po-
  24. #endif
  25.  
  26. class far TRect;
  27. class far TScrollBar;
  28.  
  29. class TTextDevice : public TScroller, public streambuf
  30. {
  31.  
  32. public:
  33.  
  34.     TTextDevice( const TRect& bounds,
  35.                  TScrollBar *aHScrollBar,
  36.                  TScrollBar *aVScrollBar
  37.                );
  38.  
  39.     virtual int do_sputn( const char *s, int count ) = 0;
  40.     virtual int overflow( int = EOF );
  41.  
  42. };
  43.  
  44. #endif  // Uses_TTextDevice
  45.  
  46. #if defined( Uses_TTerminal ) && !defined( __TTerminal )
  47. #define __TTerminal
  48.  
  49. class far TRect;
  50. class far TScrollBar;
  51.  
  52. class TTerminal: public TTextDevice
  53. {
  54.  
  55. public:
  56.  
  57.     friend void genRefs();
  58.  
  59.     TTerminal( const TRect& bounds,
  60.                TScrollBar *aHScrollBar,
  61.                TScrollBar *aVScrollBar,
  62.                ushort aBufSize
  63.              );
  64.     ~TTerminal();
  65.  
  66.     virtual int do_sputn( const char *s, int count );
  67.  
  68.     void bufInc( ushort& val );
  69.     Boolean canInsert( ushort amount );
  70.     short calcWidth();
  71.     virtual void draw();
  72.     ushort nextLine( ushort pos );
  73.     ushort prevLines( ushort pos, ushort lines );
  74.     Boolean queEmpty();
  75.  
  76. protected:
  77.  
  78.     ushort bufSize;
  79.     char *buffer;
  80.     ushort queFront, queBack;
  81.     void bufDec(ushort& val);
  82. };
  83.  
  84. #endif  // Uses_TTerminal
  85.  
  86. #if defined( Uses_otstream ) && !defined( __otstream )
  87. #define __otstream
  88.  
  89. #include <iostream.h>
  90. #pragma option -Vo-
  91. #if defined( __BCOPT__ )
  92. #pragma option -po-
  93. #endif
  94.  
  95.  
  96. class otstream : public ostream
  97. {
  98.  
  99. public:
  100.  
  101.     otstream( TTerminal * );
  102.  
  103. };
  104.  
  105.  
  106. #endif
  107.  
  108. #pragma option -Vo.
  109. #if defined( __BCOPT__ )
  110. #pragma option -po.
  111. #endif
  112.