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

drawbuf.h

Go to the documentation of this file.
00001 /*
00002  * drawbuf.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_TDrawBuffer ) && !defined( __TDrawBuffer )
00013 #define __TDrawBuffer
00014 
00044 class TDrawBuffer
00045 {
00046     friend class TFrame;
00047     friend class TView;
00048 public:
00059     void moveChar( ushort indent, char c, ushort attr, ushort count );
00070     void moveStr( ushort indent, const char *str, ushort attrs );
00081     void moveCStr( ushort indent, const char *str, ushort attrs );
00090     void moveBuf( ushort indent, const void *source, ushort attr, ushort count );
00097     void putAttribute( ushort indent, ushort attr );
00105     void putChar( ushort indent, ushort c );
00106 protected:
00110     ushort data[maxViewWidth];
00111 };
00112 
00113 #include <myendian.h>
00114 
00115 #if (BYTE_ORDER == LITTLE_ENDIAN)
00116         #define loByte(w)    (((uchar *)&w)[0])
00117         #define hiByte(w)    (((uchar *)&w)[1])
00118 #elif (BYTE_ORDER == BIG_ENDIAN)
00119         #define loByte(w)    (((uchar *)&w)[1])
00120         #define hiByte(w)    (((uchar *)&w)[0])
00121 #else
00122         #error architecture not supported by this library
00123 #endif
00124 
00125 inline void TDrawBuffer::putAttribute( ushort indent, ushort attr )
00126 {
00127     hiByte(data[indent]) = uchar(attr);
00128 }
00129 
00130 inline void TDrawBuffer::putChar( ushort indent, ushort c )
00131 {
00132     loByte(data[indent]) = uchar(c);
00133 }
00134 
00135 #endif  // Uses_TDrawBuffer

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