aboutsummaryrefslogtreecommitdiff
path: root/pkg/xtools/gtools/gtcur1.x
blob: edb42299c43d7983741c83438c76be617f473a36 (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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	"gtools.h"

# GT_GCUR1 -- Interface to clgcur to confirm EOF, map key 'q' to EOF.
# Transposes X and Y if needed.

int procedure gt_gcur1 (gt, cur, wx, wy, wcs, key, cmd, sz_cmd)

pointer	gt			# GTOOLS pointer
char	cur[ARB]		# Cursor parameter
real	wx, wy			# Cursor position
int	wcs, key		# WCS and cursor key
char	cmd[sz_cmd]		# Command string
int	sz_cmd			# Size of command string

int	curval, clgcur()
real	temp

begin
	curval = clgcur (cur, wx, wy, wcs, key, cmd, sz_cmd)

	if (curval == EOF) {
	    curval = clgcur (cur, wx, wy, wcs, key, cmd, sz_cmd)
	    if (curval != EOF) {
		if (key == 'q')
		    curval = EOF
	    }
	} else if (key == 'q')
	    curval = EOF

	if (GT_TRANSPOSE(gt) == YES) {
	    temp = wx
	    wx = wy
	    wy = temp
	}
	return (curval)
end