-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgenconfstruct.sh
141 lines (138 loc) · 3.37 KB
/
genconfstruct.sh
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/sh
set -eu
cat<<EOF
type rgb = (float * float * float)
and rgba = (float * float * float * float)
and fitmodel = | FitWidth | FitProportional | FitPage
and irect = (int * int * int * int)
and colorspace = | Rgb | Gray
and keymap =
| KMinsrt of key | KMinsrl of key list | KMmulti of (key list * key list)
and key = (int * int)
and keyhash = (key, keymap) Hashtbl.t
and keystate = | KSnone | KSinto of (key list * key list)
and css = string and dcf = string and hcs = string
and columns =
| Csingle of singlecolumn
| Cmulti of multicolumns
| Csplit of splitcolumns
and mark =
| MarkPage
| MarkBlock
| MarkLine
| MarkWord
and multicolumns = (multicol * pagegeom)
and singlecolumn = pagegeom
and splitcolumns = (columncount * pagegeom)
and pagegeom = (pdimno * x * y * (pageno * w * h * leftx)) array
and multicol = (columncount * covercount * covercount)
and columncount = int
and pdimno = int and pageno = int
and x = int and y = int and leftx = int and w = int and h = int
and covercount = int
and memsize = int and texcount = int
and sliceheight = int
and zoom = float
let scrollbvv = 1 and scrollbhv = 2
EOF
init=
assi=
g() {
printf "mutable $1:$2;"
init="$init $1=$3;"
assi="$assi dst.$1 <- src.$1;"
}
i() { g "$1" int "$2"; }
b() { g "$1" bool "$2"; }
f() { g "$1" float "$2"; }
s() { g "$1" string "$2"; }
K() {
printf "mutable $1:$2;\n"
init="$init $1=$3;"
assi="$assi dst.keyhashes <- copykeyhashes src;"
}
P() {
printf "mutable $1 : float option;\n"
init="$init $1=None;"
assi="$assi dst.pax <- if src.pax = None then None else Some 0.0;"
}
echo "type conf = {"
i scrollbw 7
i scrollh 12
i scrollb "scrollbhv lor scrollbvv"
b icase true
b preload true
i pagebias 0
b verbose false
b debug false
i scrollstep 24
i hscrollstep 24
b maxhfit true
i autoscrollstep 2
b hlinks false
b underinfo false
i interpagespace 2
f zoom 1.0
b presentation false
i angle 0
i cwinw 1800
i cwinh 1500
g fitmodel fitmodel FitProportional
b trimmargins false
g trimfuzz irect "(0,0,0,0)"
g memlimit memsize "128 lsl 20"
g texcount texcount 256
g sliceheight sliceheight 24
g thumbw w 76
g bgcolor rgb "(0.5, 0.5, 0.5)"
g papercolor rgba "(1.0, 1.0, 1.0, 0.0)"
g sbarcolor rgba "(0.64, 0.64, 0.64, 0.7)"
g sbarhndlcolor rgba "(0.0, 0.0, 0.0, 0.7)"
g texturecolor rgba "(0.0, 0.0, 0.0, 0.0)"
i tilew 2048
i tileh 2048
g mustoresize memsize "256 lsl 20"
i aalevel 8
s urilauncher "{|$uopen|}"
s pathlauncher "{|$print|}"
g colorspace colorspace Rgb
b invert false
f colorscale 1.
g columns columns "Csingle [||]"
g beyecolumns "columncount option" None
s selcmd "{|$clip|}"
s pastecmd "{|$paste|}"
s paxcmd '{|echo PAX "%s">&2|}'
s passcmd Utils.E.s
s savecmd Utils.E.s
b updatecurs true
K keyhashes '(string * keyhash) list' \
'(let mk n = (n, Hashtbl.create 1) in
[ mk "global"; mk "info" ; mk "help"; mk "outline"; mk "listview"
; mk "birdseye"; mk "textentry"; mk "links"; mk "view" ])'
i hfsize 'Wsi.fontsizescale 12'
f pgscale 1.
b wheelbypage false
s stcmd "{|echo SyncTex|}"
b riani false
g paxmark mark MarkWord
b leftscroll false
s title Utils.E.s
f lastvisit 0.0
b annotinline true
b coarseprespos false
g css css Utils.E.s
b usedoccss true
s key Utils.E.s
P pax
g dcf dcf Utils.E.s
s hcs "{|aoeuidhtns|}"
i rlw 420
i rlh 595
i rlem 11
cat <<EOF
}
let copykeyhashes c = List.map (fun (k, v) -> k, Hashtbl.copy v) c.keyhashes
let defconf = {$init}
let setconf dst src = $assi;
EOF