aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/tedit/display/curses/winstat.x
blob: e89e3ca624d0d19f3c01beca1b8e197103a13d8e (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
43
44
45
46
47
48
49
50
51
include	"../curses.h"
include "window.h"

# WINSTAT -- Retrieve a field from a window structure

int procedure winstat (win, what)

int	win		# i: Window descriptor
int	what		# i: Field to retrieve
#--
include "window.com"

int	value
pointer	pwin

string	badcode  "Unrecognized argument to winstat"

begin
	pwin = warray[win]

	switch (what) {
	case W_TOP:
	    value = WIN_TOP(pwin)
	case W_LEFT:
	    value = WIN_LEFT(pwin)
	case W_BOT:
	    value = WIN_BOT(pwin)
	case W_RIGHT:
	    value = WIN_RIGHT(pwin)
	case W_CURROW:
	    value = WIN_CURROW(pwin)
	case W_CURCOL:
	    value = WIN_CURCOL(pwin)
	case W_CLEAR:
	    value = WIN_CLEAR(pwin)
	case W_LEAVE:
	    value = WIN_LEAVE(pwin)
	case W_SCROLL:
	    value = WIN_SCROLL(pwin)
	case W_HIDDEN:
	    value = WIN_HIDDEN(pwin)
	case W_BOXED:
	    value = WIN_BOXED(pwin)
	case W_ATRIB:
	    value = WIN_ATRIB(pwin)
	default:
	    call error (1, badcode)
	}

	return (value)
end