about summary refs log tree commit diff stats
path: root/src/layout/renderdocument.nim
Commit message (Collapse)AuthorAgeFilesLines
* css/values -> css/cssvaluesbptato2024-05-161-1/+1
| | | | for consistency
* layout: unify some code pathsbptato2024-05-091-17/+6
| | | | | | | Turn Offset, Size, etc. into arrays indexed by a DimensionType enum, and use it to unify code that only differs in the dimension it is computing for. (e.g. this lets us use the same code for flex row & column layouts.)
* color: RGBAColor -> ARGBColorbptato2024-04-261-2/+2
|
* Initial image supportbptato2024-04-251-11/+28
| | | | | | | | | | | | | | | | | * png: add missing filters, various decoder fixes * term: fix kitty response interpretation, add support for kitty image detection * buffer, pager: initial image display support Emphasis on "initial"; it only "works" with kitty output and PNG input. Also, it's excruciatingly slow, and repaints images way too often. Left undocumented intentionally it for now, until it actually becomes useful. In the meantime, adventurous users can find out themselves why: [[siteconf]] url = "https://.*" images = true
* Update code stylebptato2024-04-171-10/+10
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* layout: remove ListItemBox, handle inline-flex correctlybptato2024-04-151-10/+0
| | | | | This allows us to unify BlockBox instantiation and block-level inner layout calls.
* renderdocument: do not layout with styledRoot == nilbptato2024-04-111-1/+4
| | | | it can happen when do_reshape is called before any parsing happens.
* layout: rework inline box area modelbptato2024-03-251-29/+10
| | | | | | | | | | | | | Specifying the background area as three LayoutUnit pairs sounds clever, but breaks down for text-align: center. * store line Y offset in LineBox - this is necessary to pass down areas we need to paint * refactor addHorizontalLine loop; remove mystery "If necessary, update ictx's width" line that used to be labeled "TODO this seems meaningless" and indeed seems meaningless now (I am prepared to deeply regret this later) * replace broken & convoluted startOffset/endOffset/size with a simple seq of offsets + sizes
* cell: update FormatFlag naming, remove useless templatesbptato2024-03-211-6/+6
|
* Move around some modulesbptato2024-03-141-1/+1
| | | | | | | | * extern -> gone, runproc absorbed by pager, others moved into io/ * display -> local/ (where else would we display?) * xhr -> html/ * move out WindowAttributes from term, so we don't depend on local from server
* strwidth, renderdocument: small refactoringbptato2024-03-031-73/+61
| | | | | | * put attrs pointer in state * simplify width() * use unsigned int as ptint to avoid UB
* term: improve pixels-per-column/line detectionbptato2024-02-251-2/+59
| | | | | | | | | Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI 18 t for good measure, just in case we can't ioctl for some reason.) Also added some fallback (optionally forced) config values for width, height, ppc, and ppl. (This is especially useful in dump mode.)
* Separate ANSI text decoding from main binarybptato2024-02-251-0/+437
Handling text/plain as ANSI colored text was problematic for two reasons: * You couldn't actually look at the real source of HTML pages or text files that used ANSI colors in the source. In general, I only want ANSI colors when piping something into my pager, not when viewing any random file. * More importantly, it introduced a separate rendering mode for plaintext documents, which resulted in the problem that only some buffers had DOMs. This made it impossible to add functionality that would operate on the buffer's DOM, to e.g. implement w3m's MARK_URL. Also, it locked us into the horribly inefficient line-based rendering model of entire documents. Now we solve the problem in two separate parts: * text/x-ansi is used automatically for documents received through stdin. A text/x-ansi handler ansi2html converts ANSI formatting to HTML. text/x-ansi is also used for .ans, .asc file extensions. * text/plain is a separate input mode in buffer, which places all text in a single <plaintext> tag. Crucially, this does not invoke the HTML parser; that would eat NUL characters, which we should avoid. One blind spot still remains: copiousoutput used to display ANSI colors, and now it doesn't. To solve this, users can put the x-ansioutput extension field to their mailcap entries, which behaves like x-htmloutput except it first pipes the output into ansi2html.
ommitter bptato <nincsnevem662@gmail.com> 2023-05-21 13:28:33 +0200 Rewrite new Request binding' href='/ahoang/chawan/commit/src/io/request.nim?id=d09319640c4b1e24b937d1fc37a3f8b82052e612'>d0931964 ^
17097052 ^

e80ae4b1 ^
d0931964 ^



d526deb9 ^
d242bb35 ^
3223a336 ^




2b10a9b7 ^
2b10a9b7 ^
36390a56 ^

7c612d65 ^
341299a4 ^
36390a56 ^
341299a4 ^


d0931964 ^

e2203257 ^



e38402df ^










































3223a336 ^
3223a336 ^
3f0a183d ^









3223a336 ^
d0931964 ^
17097052 ^
8027e52c ^
d526deb9 ^

d9e430c8 ^




8027e52c ^
bfaf210d ^

c235e638 ^

d9e430c8 ^

8027e52c ^
17097052 ^
d526deb9 ^

8027e52c ^
d0931964 ^
d9e430c8 ^


8027e52c ^
d9e430c8 ^
bfaf210d ^










51d83224 ^
ecaf2a63 ^
























































341299a4 ^
ecaf2a63 ^
341299a4 ^






















06c0dd17 ^
341299a4 ^

06c0dd17 ^
ecaf2a63 ^



06c0dd17 ^
ecaf2a63 ^

















06c0dd17 ^
ecaf2a63 ^
341299a4 ^











e2203257 ^
bfaf210d ^






51d83224 ^
36390a56 ^
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332