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
52
53
54
55
56
57
58
59
60
|
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
include <ctotok.h>
include <ctype.h>
include <gki.h>
include "../lib/ids.h"
# ZOOM -- zoom, then pan, the display. If zoom power == 1, then
# don't bother panning.
procedure zoom()
char token[SZ_LINE]
int tok, count, power, cnum
short frames[IDS_MAXIMPL+2] # frames, graphics, EOD
real x, y
int ctoi, ip
include "cv.com"
begin
# get power for zoom
call gargtok (tok, token, SZ_LINE)
if (tok != TOK_NUMBER) {
call eprintf ("Bad zoom power: %s\n")
call pargstr (token)
return
}
ip = 1
count = ctoi(token, ip, power)
# which frames to zoom
frames[1] = IDS_EOD # default all frames
call gargtok (tok, token, SZ_LINE)
call strlwr (token)
if (token[1] == 'f') {
call cv_frame (token[2], frames)
if (frames[1] == ERR)
return
} else if (tok == TOK_NUMBER) {
call cv_frame (token[1], frames)
if (frames[1] == ERR)
return
} else {
call eprintf ("Unexpected input: %s\n")
call pargstr (token)
return
}
# where to zoom ... find which frame to read cursor position from
cnum = frames[1]
if (cnum == IDS_EOD)
cnum = 0
call cv_rcur (cnum, x, y)
call cvzoom (frames, power, x, y)
call pansub (frames)
end
|