00001
00002
00003
00004
00005
00006
00007
00008
00009
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