blob: 93bffaae8fc7f2c6764b08e2989d9e7bab57398b (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/*
* misc.cc
*
* Turbo Vision - Version 2.0
*
* Copyright (c) 1994 by Borland International
* All Rights Reserved.
*
* Modified by Sergio Sigala <sergio@sigala.it>
*
* Little files are merged here.
*/
#define Uses_TGroup
#define Uses_TEvent
#define Uses_TObject
#define Uses_TView
#define Uses_pstream
#include <tvision/tv.h>
#include <string.h>
/* from MISC.CPP */
void *message( TView *receiver, ushort what, ushort command, void *infoPtr)
{
if( receiver == 0 )
return 0;
TEvent event;
event.what = what;
event.message.command = command;
event.message.infoPtr = infoPtr;
receiver->handleEvent( event );
if( event.what == evNothing )
return event.message.infoPtr;
else
return 0;
}
/* from NEWSTR.CPP */
char *newStr( const char *s )
{
if( s == 0 )
return 0;
char *temp = new char[ strlen(s)+1 ];
strcpy( temp, s );
return temp;
}
/* from MAPCOLOR.CPP */
uchar TView::mapColor( uchar color )
{
if( color == 0 )
return errorAttr;
TView *cur = this;
do {
TPalette& p = cur->getPalette();
if( p[0] != 0 )
{
if( color > p[0] )
return errorAttr;
color = p[color];
if( color == 0 )
return errorAttr;
}
cur = cur->owner;
} while( cur != 0 );
return color;
}
/* from STRMSTAT.CPP */
TStreamableTypes * pstream::types;
|