4
* All rights reserved. Copyright (C) 1996 by NARITA Tomio.
5
* $Id: display.c,v 1.4 2003/11/13 03:08:19 nrt Exp $
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
* $B%Z!<%8FbMF$r%(%s%3!<%I$7$F2hLL$K=PNO$9$k(B.
35
* screen.c $B$G%m!<%I$7$?%Z!<%8FbMF$rI=<($9$k(B.
36
* ($B$?$@$7(B, display.c $B$+$i$bF0E*$K%Z!<%8$r%a%b%j$K%m!<%I$7$F$$$k(B).
39
#define ScreenGetTop( f, seg, blk, off, phy ) \
40
PositionGet( (f)->screen.top, (seg), (blk), (off), (phy) )
42
#define ScreenGetBot( f, seg, blk, off, phy ) \
43
PositionGet( (f)->screen.bot, (seg), (blk), (off), (phy) )
45
private void LineEncode( file_t *f, int blk, int off, int phy )
50
line = &f->page[ blk ].line[ off ];
51
head = LineHead( line, phy );
52
tail = head + LineLength( line, phy );
54
encode_length = CODE_SIZE;
55
Encode( line->istr, head, tail,
56
f->outputCodingSystem, FALSE,
57
encode_str, &encode_length );
60
public void DisplayFull( file_t *f )
63
int seg, blk, off, phy;
67
ScreenGetTop( f, seg, blk, off, phy );
71
for( i = 0 ; i < f->screen.lines ; i++ ){
72
LineEncode( f, blk, off, phy );
73
if( 0 == i || TRUE == carefully_divide || 0 == phy ){
74
ConsoleSetCur( 0, i );
76
ConsolePrintsStr( encode_str, encode_length );
77
PositionInc( f, seg, blk, off, phy );
79
for( i = f->screen.lines ; i < f->height ; i++ ){
80
ConsoleSetCur( 0, i );
89
public void DisplayTop( file_t *f, int arg )
91
int seg, blk, off, phy;
94
if( TRUE == no_scroll || arg > f->height || f->screen.lines < f->height ){
99
if( arg == f->height ){
100
if( FALSE == smooth_paging ){
104
ScreenGetBot( f, seg, blk, off, phy );
106
ScreenGetTop( f, seg, blk, off, phy );
107
for( i = 1 ; i < arg ; i++ )
108
PositionInc( f, seg, blk, off, phy );
113
for( i = 0 ; i < arg ; i++ ){
114
LineEncode( f, blk, off, phy );
115
ConsoleSetCur( 0, HEIGHT - 1 );
117
ConsoleSetCur( 0, 0 );
119
ConsolePrintsStr( encode_str, encode_length );
120
PositionDec( f, seg, blk, off, phy );
126
public void DisplayBot( file_t *f, int arg )
128
int seg, blk, off, phy;
131
if( TRUE == no_scroll || arg > f->height || f->screen.lines < f->height ){
136
if( arg == f->height ){
137
if( FALSE == smooth_paging ){
141
ScreenGetTop( f, seg, blk, off, phy );
143
ScreenGetBot( f, seg, blk, off, phy );
144
for( i = 1 ; i < arg ; i++ )
145
PositionDec( f, seg, blk, off, phy );
150
for( i = 0 ; i < arg ; i++ ){
151
LineEncode( f, blk, off, phy );
152
ConsoleSetCur( 0, 0 );
154
ConsoleSetCur( 0, f->height - 1 );
156
ConsolePrintsStr( encode_str, encode_length );
157
PositionInc( f, seg, blk, off, phy );