aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/tedit/display/curses/refresh.x
blob: b65885d83d07c35a9488f58f2aaecd14d0c9fecf (plain) (blame)
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
include "../curses.h"
include "window.h"

# REFRESH -- Bring the terminal screen up to date
#
# B.Simon	02-Oct-90	Original

procedure refresh ()

#--

begin
	call wrefresh (STDSCR)
end

procedure wrefresh (win)

int	win		# i: Window descriptor
#--
include "window.com"

int	rect[RSIZE]
pointer	pwin

begin
	pwin = warray[win]

	# If the clear flag is set, redraw the contents of the window

	if (WIN_CLEAR(pwin) == YES) {
	    WIN_CLEAR(pwin) = NO
	    call wrect (win, YES, rect)
	    call putscreen (rect, NULL)

	    if (WIN_LEAVE(pwin) == NO) {
		call ps_setcur (WIN_TOP(pwin)+WIN_CURROW(pwin)-1,
				WIN_LEFT(pwin)+WIN_CURCOL(pwin)-1)
	    }
	}

	call ps_synch
end