summaryrefslogtreecommitdiff
path: root/tvision/include/tv/drawbuf.h
blob: 09f109452565896c42c886862b54272a6d7c465b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 *      Turbo Vision - Version 2.0
 *
 *      Copyright (c) 1994 by Borland International
 *      All Rights Reserved.
 *

Modified by Robert H”hne to be used for RHIDE.

 *
 *
 */

#if defined( Uses_TDrawBuffer ) && !defined( __TDrawBuffer )
#define __TDrawBuffer

class CLY_EXPORT TDrawBuffer
{

    friend class TView;

public:

    void moveChar( unsigned indent, char c, unsigned attr, unsigned count );
    void moveStr( unsigned indent, const char *str, unsigned attrs );
    void moveCStr( unsigned indent, const char *str, unsigned attrs );
    void moveBuf( unsigned indent, const void *source,
                  unsigned attr, unsigned count );

    void putAttribute( unsigned indent, unsigned attr );
    void putChar( unsigned indent, unsigned c );

protected:

    ushort data[maxViewWidth];

};

#define loByte(w)    (((uchar *)&w)[0])
#define hiByte(w)    (((uchar *)&w)[1])

inline void TDrawBuffer::putAttribute( unsigned indent, unsigned attr )
{
    hiByte(data[indent]) = (uchar)attr;
}

inline void TDrawBuffer::putChar( unsigned indent, unsigned c )
{
    loByte(data[indent]) = (uchar)c;
}

#endif  // Uses_TDrawBuffer