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

  1. /* ------------------------------------------------------------------------*/
  2. /*                                                                         */
  3. /*   DRAWBUF.H                                                             */
  4. /*                                                                         */
  5. /*   Copyright (c) Borland International 1991                              */
  6. /*   All Rights Reserved.                                                  */
  7. /*                                                                         */
  8. /*   defines the class TDrawBuffer, which provides the high-level          */
  9. /*   interface to the Screen Manager.                                      */
  10. /*                                                                         */
  11. /* ------------------------------------------------------------------------*/
  12.  
  13. #pragma option -Vo-
  14. #if defined( __BCOPT__ )
  15. #pragma option -po-
  16. #endif
  17.  
  18. #if defined( Uses_TDrawBuffer ) && !defined( __TDrawBuffer )
  19. #define __TDrawBuffer
  20.  
  21. class TDrawBuffer
  22. {
  23.  
  24.     friend class TSystemError;
  25.     friend class TView;
  26.     friend void genRefs();
  27.  
  28. public:
  29.  
  30.     void moveChar( ushort indent, char c, ushort attr, ushort count );
  31.     void moveStr( ushort indent, const char far *str, ushort attrs );
  32.     void moveCStr( ushort indent, const char far *str, ushort attrs );
  33.     void moveBuf( ushort indent, const void far *source,
  34.                   ushort attr, ushort count );
  35.  
  36.     void putAttribute( ushort indent, ushort attr );
  37.     void putChar( ushort indent, ushort c );
  38.  
  39. protected:
  40.  
  41.     ushort data[maxViewWidth];
  42.  
  43. };
  44.  
  45. #define loByte(w)    (((uchar *)&w)[0])
  46. #define hiByte(w)    (((uchar *)&w)[1])
  47.  
  48. inline void TDrawBuffer::putAttribute( ushort indent, ushort attr )
  49. {
  50.     hiByte(data[indent]) = uchar(attr);
  51. }
  52.  
  53. inline void TDrawBuffer::putChar( ushort indent, ushort c )
  54. {
  55.     loByte(data[indent]) = uchar(c);
  56. }
  57.  
  58. #endif  // Uses_TDrawBuffer
  59.  
  60. #pragma option -Vo.
  61. #if defined( __BCOPT__ )
  62. #pragma option -po.
  63. #endif
  64.  
  65.