ViewPort -> TextPort

git-svn-id: svn://qnap.local/TwoTerm/trunk@1896 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
Kelvin Sherlock 2010-12-23 20:41:41 +00:00
parent 8ecd1e0174
commit 35918005de
2 changed files with 14 additions and 12 deletions

View File

@ -21,8 +21,8 @@
int _vp[4];
#ifdef __cplusplus
class ViewPort;
ViewPort *_viewPort;
class TextPort;
TextPort *_textPort;
#endif

View File

@ -156,10 +156,10 @@ enum {
{
_state = StateText;
if (_viewPort)
if (_textPort)
{
delete _viewPort;
_viewPort = NULL;
delete _textPort;
_textPort = NULL;
}
// set flags to plain text.
@ -179,7 +179,7 @@ enum {
-(void)dealloc
{
delete _viewPort;
delete _textPort;
[super dealloc];
}
@ -391,16 +391,18 @@ enum {
if (_vp[0] == 0 && _vp[1] == 80 && _vp[2] == 0 && _vp[3] == 24)
{
delete _viewPort;
_viewPort = NULL;
delete _textPort;
_textPort = NULL;
}
else
{
if (!_viewPort) _viewPort = new ViewPort;
_viewPort->frame = iRect(_vp[0], _vp[2], _vp[1] - _vp[0], _vp[3] - _vp[2]);
if (!_textPort) _textPort = new TextPort;
_textPort->frame = iRect(_vp[0], _vp[2], _vp[1] - _vp[0], _vp[3] - _vp[2]);
_textPort->rightMargin = TextPort::RMTruncate;
_textPort->advanceCursor = true;
_textPort->scroll = true;
_viewPort->flags.wrap = 1;
_viewPort->flags.scroll = 1;
}