Remove stray spaces
[llpp.git] / genconfstr.sh
blobdab395257973d768871ad2e1546586c9b9197180
1 #!/bin/sh
2 set -eu
4 cat<<EOF
5 open Utils;;
6 type rgb = float * float * float
7 type rgba = float * float * float * float
8 type fitmodel = | FitWidth | FitProportional | FitPage
9 type irect = (int * int * int * int)
10 and bbox = irect
11 type colorspace = | Rgb | Gray
12 type keymap =
13 | KMinsrt of key | KMinsrl of key list | KMmulti of key list * key list
14 and key = int * int
15 and keyhash = (key, keymap) Hashtbl.t
16 and keystate = |KSnone |KSinto of (key list * key list)
17 and css = string
18 type columns =
19 | Csingle of singlecolumn
20 | Cmulti of multicolumns
21 | Csplit of splitcolumns
22 and mark =
23 | Mark_page
24 | Mark_block
25 | Mark_line
26 | Mark_word
27 and multicolumns = multicol * pagegeom
28 and singlecolumn = pagegeom
29 and splitcolumns = columncount * pagegeom
30 and pagegeom = (pdimno * x * y * (pageno * width * height * leftx)) array
31 and multicol = columncount * covercount * covercount
32 and columncount = int
33 and pdimno = int
34 and pageno = int
35 and x = int and y = int and leftx = int
36 and covercount = int
37 and width = int and height = int
38 and memsize = int and texcount = int
39 and sliceheight = int;;
40 let scrollbvv = 1 and scrollbhv = 2;;
41 EOF
43 init=
44 assi=
45 g() {
46 printf "mutable $1:$2;"
47 init="$init $1=$3;"
48 assi="$assi dst.$1 <- src.$1;"
50 i() { g "$1" int "$2"; }
51 b() { g "$1" bool "$2"; }
52 f() { g "$1" float "$2"; }
53 s() { g "$1" string "$2"; }
54 K() {
55 printf "mutable $1:$2;\n"
56 init="$init $1=$3;"
57 assi="$assi dst.keyhashes <- copykeyhashes src;"
59 P() {
60 printf "mutable $1 : float option;\n"
61 init="$init $1=None;"
62 assi="$assi dst.pax <- if src.pax = None then None else Some 0.0;"
64 echo "type conf = {"
65 i scrollbw 7
66 i scrollh 12
67 i scrollb "scrollbhv lor scrollbvv"
68 b icase true
69 b preload true
70 i pagebias 0
71 b verbose false
72 b debug false
73 i scrollstep 24
74 i hscrollstep 24
75 b maxhfit true
76 i autoscrollstep 2
77 b hlinks false
78 b underinfo false
79 i interpagespace 2
80 f zoom 1.0
81 b presentation false
82 i angle 0
83 i cwinw 1200
84 i cwinh 1000
85 g fitmodel fitmodel FitProportional
86 b trimmargins false
87 g trimfuzz irect "(0,0,0,0)"
88 g memlimit memsize "32 lsl 20"
89 g texcount texcount 256
90 g sliceheight sliceheight 24
91 g thumbw width 76
92 g bgcolor rgb "(0.5, 0.5, 0.5)"
93 g sbarcolor rgba "(0.64, 0.64, 0.64, 0.7)"
94 g sbarhndlcolor rgba "(0.0, 0.0, 0.0, 0.7)"
95 g texturecolor rgba "(0.0, 0.0, 0.0, 0.0)"
96 b bedefault false
97 i tilew 2048
98 i tileh 2048
99 g mustoresize memsize "256 lsl 20"
100 b checkers true
101 i aalevel 8
102 s urilauncher '(match[@warning "-4"] platform with |Pmacos -> {|open "%s"|}|_ -> {|echo "%s"|})'
103 s pathlauncher '{|lp "%s"|}'
104 g colorspace colorspace Rgb
105 b invert false
106 f colorscale 1.
107 g columns columns "Csingle [||]"
108 g beyecolumns "columncount option" None
109 s selcmd '(match platform with |Plinux|Pbsd -> "LC_CTYPE=UTF-8 xclip -i"|Pmacos -> "LC_CTYPE=UTF-8 pbcopy"|Punknown -> "cat")'
110 s pastecmd '(match platform with |Plinux|Pbsd -> "LC_CTYPE=UTF-8 xclip -o"|Pmacos -> "LC_CTYPE=UTF-8 pbpaste"|Punknown -> "echo")'
111 s paxcmd '"cat"'
112 s passcmd E.s
113 s savecmd E.s
114 b updatecurs true
115 K keyhashes '(string * keyhash) list' \
116 '(let mk n = (n, Hashtbl.create 1) in
117 [ mk "global"; mk "info" ; mk "help"; mk "outline"; mk "listview"
118 ; mk "birdseye"; mk "textentry"; mk "links"; mk "view" ])'
119 i hfsize '12 * Wsi.fontsizefactor ()'
120 f pgscale 1.
121 b usepbo false
122 b wheelbypage false
123 s stcmd "{|echo SyncTex|}"
124 b riani false
125 g paxmark mark Mark_word
126 b leftscroll false
127 s title E.s
128 f lastvisit 0.0
129 b annotinline true
130 b coarseprespos false
131 g css css E.s
132 b usedoccss true
133 s key E.s
134 P pax
136 cat <<EOF
138 let copykeyhashes c = List.map (fun (k, v) -> k, Hashtbl.copy v) c.keyhashes;;
139 let defconf = {$init};;
140 let setconf dst src = $assi;