-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathmul2.gs
58 lines (51 loc) · 1.34 KB
/
mul2.gs
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
*
* Help is in the end of this script.
*
function mul2( args )
_version = '0.01b1'
if( args = '' )
help()
return
endif
*** arguement ***
imax = subwrd( args, 1 )
jmax = subwrd( args, 2 )
ipos = subwrd( args, 3 )
jpos = subwrd( args, 4 )
***** get real page *****
'set vpage off'
if( imax = 1 & jmax = 1 ) ; return ; endif
'q gxinfo'
temp = sublin( result, 2 )
vpagex = subwrd( temp, 4 )
vpagey = subwrd( temp, 6 )
xmin = ( vpagex / imax ) * ( ipos - 1 )
xmax = ( vpagex / imax ) * ( ipos )
ymin = ( vpagey / jmax ) * ( jpos - 1 )
ymax = ( vpagey / jmax ) * ( jpos )
'set vpage 'xmin' 'xmax' 'ymin' 'ymax
'set grads off'
return
*
* help
*
function help()
say ' Name:'
say ' mul2 '_version' - set multi-virtual window'
say ' '
say ' Usage:'
say ' mul2 imax jmax ipos jpos'
say ''
say ' imax : Number of horizontal windows.'
say ' jmax : Number of vertical windows'
say ' ipos : Horizontal position (count from left window)'
say ' jpos : Vertical position (count from bottom window)'
say ''
say ' Note:'
say ' [arg-name] : specify if needed'
say ' (arg1 | arg2) : arg1 or arg2 must be specified'
say ''
say ' Copyright (C) 2015-2015 Chihiro Kodama'
say ' Distributed under GNU GPL (http://www.gnu.org/licenses/gpl.html)'
say ''
return