Respect inversion when drawing page separators
[llpp.git] / genconfstruct.sh
blob73bbf259820763f794e7e220e6da2d1ab602f65a
1 #!/bin/sh
2 set -eu
4 cat<<EOF
5 let zs = ""
6 type rgb = (float * float * float)
7 and rgba = (float * float * float * float)
8 and fitmodel = | FitWidth | FitProportional | FitPage
9 and irect = (int * int * int * int)
10 and colorspace = | Rgb | Gray
11 and keymap =
12 | KMinsrt of key | KMinsrl of key list | KMmulti of (key list * key list)
13 and key = (int * int)
14 and keyhash = (key, keymap) Hashtbl.t
15 and keystate = | KSnone | KSinto of (key list * key list)
16 and css = string and dcf = string and hcs = string
17 and columns =
18 | Csingle of singlecolumn
19 | Cmulti of multicolumns
20 | Csplit of splitcolumns
21 and mark =
22 | MarkPage
23 | MarkBlock
24 | MarkLine
25 | MarkWord
26 and multicolumns = (multicol * pagegeom)
27 and singlecolumn = pagegeom
28 and splitcolumns = (columncount * pagegeom)
29 and pagegeom = (pdimno * x * y * (pageno * w * h * leftx)) array
30 and multicol = (columncount * covercount * covercount)
31 and columncount = int
32 and pdimno = int and pageno = int
33 and x = int and y = int and leftx = int and w = int and h = int
34 and covercount = int
35 and memsize = int and texcount = int
36 and sliceheight = int
37 and zoom = float
38 let scrollbvv = 1 and scrollbhv = 2
39 EOF
41 init=
42 assi=
43 g() {
44 printf "mutable $1:$2;"
45 init="$init $1=$3;"
46 assi="$assi dst.$1 <- src.$1;"
48 i() { g "$1" int "$2"; }
49 b() { g "$1" bool "$2"; }
50 f() { g "$1" float "$2"; }
51 s() { g "$1" string "$2"; }
52 K() {
53 printf "mutable $1:$2;\n"
54 init="$init $1=$3;"
55 assi="$assi dst.keyhashes <- copykeyhashes src;"
57 P() {
58 printf "mutable $1 : float option;\n"
59 init="$init $1=None;"
60 assi="$assi dst.pax <- if src.pax = None then None else Some 0.0;"
62 echo "type conf = {"
63 i scrollbw 7
64 i scrollh 12
65 i scrollb "scrollbhv lor scrollbvv"
66 b icase true
67 b preload true
68 i pagebias 0
69 b verbose false
70 b debug false
71 i scrollstep 24
72 i hscrollstep 24
73 b maxhfit true
74 i autoscrollstep 2
75 b hlinks false
76 b underinfo false
77 i interpagespace 2
78 f zoom 1.0
79 b presentation false
80 i angle 0
81 i cwinw 1800
82 i cwinh 1500
83 g fitmodel fitmodel FitProportional
84 b trimmargins false
85 g trimfuzz irect "(0,0,0,0)"
86 g memlimit memsize "128 lsl 20"
87 g texcount texcount 256
88 g sliceheight sliceheight 24
89 g thumbw w 76
90 g bgcolor rgb "(0.5, 0.5, 0.5)"
91 g papercolor rgba "(1.0, 1.0, 1.0, 0.0)"
92 g sbarcolor rgba "(0.64, 0.64, 0.64, 0.7)"
93 g sbarhndlcolor rgba "(0.0, 0.0, 0.0, 0.7)"
94 g texturecolor rgba "(0.0, 0.0, 0.0, 0.0)"
95 i tilew 2048
96 i tileh 2048
97 g mustoresize memsize "256 lsl 20"
98 i aalevel 8
99 s urilauncher "{|$uopen|}"
100 s pathlauncher "{|$print|}"
101 g colorspace colorspace Rgb
102 b invert false
103 f colorscale 1.
104 g columns columns "Csingle [||]"
105 g beyecolumns "columncount option" None
106 s selcmd "{|$clip|}"
107 s pastecmd "{|$paste|}"
108 s paxcmd '{|echo PAX "%s">&2|}'
109 s passcmd zs
110 s savecmd zs
111 b updatecurs true
112 K keyhashes '(string * keyhash) list' \
113 '(let mk n = (n, Hashtbl.create 1) in
114 [ mk "global"; mk "info" ; mk "help"; mk "outline"; mk "listview"
115 ; mk "birdseye"; mk "textentry"; mk "links"; mk "view" ])'
116 i hfsize 'Wsi.fontsizescale 12'
117 f pgscale 1.
118 b wheelbypage false
119 s stcmd "{|echo SyncTex|}"
120 b riani false
121 g paxmark mark MarkWord
122 b leftscroll false
123 s title zs
124 f lastvisit 0.0
125 b annotinline true
126 b coarseprespos false
127 g css css zs
128 b usedoccss true
129 s key zs
130 P pax
131 g dcf dcf zs
132 s hcs "{|aoeuidhtns|}"
133 i rlw 420
134 i rlh 595
135 i rlem 11
137 cat <<EOF
139 let copykeyhashes c = List.map (fun (k, v) -> k, Hashtbl.copy v) c.keyhashes
140 let defconf = {$init}
141 let setconf dst src = $assi;