Codebergdnkl

foot

master
ply6 git calls489 ms33 KiB4 cachedprotocol v2
492 lines11 KiBRaw
1#pragma once
3#include <regex.h>
4#include <stdbool.h>
5#include <stdint.h>
6#include <uchar.h>
8#include <xkbcommon/xkbcommon.h>
9#include <tllist.h>
10#include <fcft/fcft.h>
12#include "user-notification.h"
14#define DEFINE_LIST(type) \
15 type##_list { \
16 size_t count; \
17 type *arr; \
18 }
20/* If px != 0 then px is valid, otherwise pt is valid */
21struct pt_or_px {
22 int16_t px;
23 float pt;
24};
26struct font_size_adjustment {
27 struct pt_or_px pt_or_px;
28 float percent;
29};
31enum cursor_style { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BEAM, CURSOR_HOLLOW };
32enum cursor_unfocused_style {
33 CURSOR_UNFOCUSED_UNCHANGED,
34 CURSOR_UNFOCUSED_HOLLOW,
35 CURSOR_UNFOCUSED_NONE
36};
38enum conf_size_type {CONF_SIZE_PX, CONF_SIZE_CELLS};
40struct config_font {
41 char *pattern;
42 float pt_size;
43 int px_size;
44};
45DEFINE_LIST(struct config_font);
47#if 0
48struct config_key_modifiers {
49 bool shift;
50 bool alt;
51 bool ctrl;
52 bool super;
53};
54#endif
56struct argv {
57 char **args;
58};
60enum binding_aux_type {
61 BINDING_AUX_NONE,
62 BINDING_AUX_PIPE,
63 BINDING_AUX_TEXT,
64 BINDING_AUX_REGEX,
65};
67struct binding_aux {
68 enum binding_aux_type type;
69 bool master_copy;
71 union {
72 struct argv pipe;
74 struct {
75 uint8_t *data;
76 size_t len;
77 } text;
79 char *regex_name;
80 };
81};
83enum key_binding_type {
84 KEY_BINDING,
85 MOUSE_BINDING,
86};
88typedef tll(char *) config_modifier_list_t;
90struct config_key_binding {
91 int action; /* One of the various bind_action_* enums from wayland.h */
92 //struct config_key_modifiers modifiers;
93 config_modifier_list_t modifiers;
94 union {
95 /* Key bindings */
96 struct {
97 xkb_keysym_t sym;
98 } k;
100 /* Mouse bindings */
101 struct {
102 int button;
103 int count;
104 } m;
105 };
107 struct binding_aux aux;
109 /* For error messages in collision handling */
110 const char *path;
111 int lineno;
112};
113DEFINE_LIST(struct config_key_binding);
115typedef tll(char *) config_override_t;
117struct config_spawn_template {
118 struct argv argv;
119};
121struct env_var {
122 char *name;
123 char *value;
124};
125typedef tll(struct env_var) env_var_list_t;
127struct custom_regex {
128 char *name;
129 char *regex;
130 regex_t preg;
131 struct config_spawn_template launch;
132};
134struct color_theme {
135 uint32_t fg;
136 uint32_t bg;
137 uint32_t flash;
138 uint32_t flash_alpha;
139 uint32_t table[256];
140 uint16_t alpha;
141 uint32_t selection_fg;
142 uint32_t selection_bg;
143 uint32_t url;
145 uint32_t dim[8];
146 uint32_t sixel[16];
148 enum {
149 DIM_BLEND_TOWARDS_BLACK,
150 DIM_BLEND_TOWARDS_WHITE,
151 } dim_blend_towards;
153 enum {
154 ALPHA_MODE_DEFAULT,
155 ALPHA_MODE_MATCHING,
156 ALPHA_MODE_ALL
157 } alpha_mode;
159 struct {
160 uint32_t text;
161 uint32_t cursor;
162 } cursor;
164 struct {
165 uint32_t fg;
166 uint32_t bg;
167 } jump_label;
169 struct {
170 uint32_t fg;
171 uint32_t bg;
172 } scrollback_indicator;
174 struct {
175 struct {
176 uint32_t fg;
177 uint32_t bg;
178 } no_match;
180 struct {
181 uint32_t fg;
182 uint32_t bg;
183 } match;
184 } search_box;
186 struct {
187 bool cursor:1;
188 bool jump_label:1;
189 bool scrollback_indicator:1;
190 bool url:1;
191 bool search_box_no_match:1;
192 bool search_box_match:1;
193 uint8_t dim;
194 } use_custom;
196 bool blur;
197};
199enum which_color_theme {
200 COLOR_THEME_DARK,
201 COLOR_THEME_LIGHT,
202 COLOR_THEME_1, /* Deprecated */
203 COLOR_THEME_2, /* Deprecated */
204};
206enum shm_bit_depth {
207 SHM_BITS_AUTO,
208 SHM_BITS_8,
209 SHM_BITS_10,
210 SHM_BITS_16,
211};
213enum center_when {
214 CENTER_INVALID,
215 CENTER_NEVER,
216 CENTER_FULLSCREEN,
217 CENTER_MAXIMIZED_AND_FULLSCREEN,
218 CENTER_ALWAYS,
219};
221enum underline_style {
222 UNDERLINE_NONE,
223 UNDERLINE_SINGLE, /* Legacy underline */
224 UNDERLINE_DOUBLE,
225 UNDERLINE_CURLY,
226 UNDERLINE_DOTTED,
227 UNDERLINE_DASHED,
228};
230struct config {
231 char *conf_path;
232 char *term;
233 char *shell;
234 char *title;
235 char *app_id;
236 char *toplevel_tag;
237 char32_t *word_delimiters;
238 bool login_shell;
239 bool locked_title;
241 struct {
242 enum conf_size_type type;
243 uint32_t width;
244 uint32_t height;
245 } size;
247 unsigned pad_left;
248 unsigned pad_top;
249 unsigned pad_right;
250 unsigned pad_bottom;
251 enum center_when center_when;
253 bool resize_by_cells;
254 bool resize_keep_grid;
256 uint16_t resize_delay_ms;
258 struct {
259 float amount;
260 } dim;
262 struct {
263 bool enabled;
264 bool palette_based;
265 float amount;
266 } bold_in_bright;
268 enum { STARTUP_WINDOWED, STARTUP_MAXIMIZED, STARTUP_FULLSCREEN } startup_mode;
270 bool dpi_aware;
271 bool gamma_correct;
272 bool uppercase_regex_insert;
273 struct config_font_list fonts[4];
274 struct font_size_adjustment font_size_adjustment;
276 /* Custom font metrics (-1 = use real font metrics) */
277 struct pt_or_px line_height;
278 struct pt_or_px letter_spacing;
280 /* Adjusted letter x/y offsets */
281 struct pt_or_px horizontal_letter_offset;
282 struct pt_or_px vertical_letter_offset;
284 bool use_custom_underline_offset;
285 struct pt_or_px underline_offset;
286 struct pt_or_px underline_thickness;
288 struct pt_or_px strikeout_thickness;
290 bool box_drawings_uses_font_glyphs;
291 bool can_shape_grapheme;
293 struct {
294 enum {
295 OSC52_DISABLED,
296 OSC52_COPY_ENABLED,
297 OSC52_PASTE_ENABLED,
298 OSC52_ENABLED,
299 } osc52;
300 } security;
302 struct {
303 bool urgent;
304 bool notify;
305 bool flash;
306 bool system_bell;
307 struct config_spawn_template command;
308 bool command_focused;
309 } bell;
311 struct {
312 uint32_t lines;
314 struct {
315 enum {
316 SCROLLBACK_INDICATOR_POSITION_NONE,
317 SCROLLBACK_INDICATOR_POSITION_FIXED,
318 SCROLLBACK_INDICATOR_POSITION_RELATIVE
319 } position;
321 enum {
322 SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE,
323 SCROLLBACK_INDICATOR_FORMAT_LINENO,
324 SCROLLBACK_INDICATOR_FORMAT_TEXT,
325 } format;
327 char32_t *text;
328 } indicator;
329 float multiplier;
330 } scrollback;
332 struct {
333 char32_t *label_letters;
334 struct config_spawn_template launch;
335 enum {
336 OSC8_UNDERLINE_URL_MODE,
337 OSC8_UNDERLINE_ALWAYS,
338 } osc8_underline;
339 enum underline_style style;
341 char *regex;
342 regex_t preg;
343 } url;
345 tll(struct custom_regex) custom_regexes;
347 struct color_theme colors_dark;
348 struct color_theme colors_light;
349 enum which_color_theme initial_color_theme;
351 struct {
352 enum cursor_style style;
353 enum cursor_unfocused_style unfocused_style;
354 struct {
355 bool enabled;
356 uint32_t rate_ms;
357 } blink;
358 struct pt_or_px beam_thickness;
359 struct pt_or_px underline_thickness;
360 } cursor;
362 struct {
363 bool hide_when_typing;
364 bool alternate_scroll_mode;
365 //struct config_key_modifiers selection_override_modifiers;
366 config_modifier_list_t selection_override_modifiers;
367 } mouse;
369 struct {
370 /* Bindings for "normal" mode */
371 struct config_key_binding_list key;
372 struct config_key_binding_list mouse;
374 /*
375 * Special modes
376 */
378 /* While searching (not - action to *start* a search is in the
379 * 'key' bindings above */
380 struct config_key_binding_list search;
382 /* While showing URL jump labels */
383 struct config_key_binding_list url;
384 } bindings;
386 struct {
387 enum { CONF_CSD_PREFER_NONE, CONF_CSD_PREFER_SERVER, CONF_CSD_PREFER_CLIENT } preferred;
389 uint16_t title_height;
390 uint16_t border_width;
391 uint16_t border_width_visible;
392 uint16_t button_width;
394 bool hide_when_maximized;
395 bool double_click_to_maximize;
397 struct {
398 bool title_set:1;
399 bool buttons_set:1;
400 bool minimize_set:1;
401 bool maximize_set:1;
402 bool close_set:1;
403 bool border_set:1;
404 uint32_t title;
405 uint32_t buttons;
406 uint32_t minimize;
407 uint32_t maximize;
408 uint32_t quit; /* 'close' collides with #define in epoll-shim */
409 uint32_t border;
410 } color;
412 struct config_font_list font;
413 } csd;
415 uint16_t render_worker_count;
416 char *server_socket_path;
417 bool presentation_timings;
418 bool hold_at_exit;
419 enum {
420 SELECTION_TARGET_NONE,
421 SELECTION_TARGET_PRIMARY,
422 SELECTION_TARGET_CLIPBOARD,
423 SELECTION_TARGET_BOTH
424 } selection_target;
426 struct {
427 struct config_spawn_template command;
428 struct config_spawn_template command_action_arg;
429 struct config_spawn_template close;
430 bool inhibit_when_focused;
431 } desktop_notifications;
433 env_var_list_t env_vars;
435 char *utmp_helper_path;
437 struct {
438 enum fcft_scaling_filter fcft_filter;
439 bool overflowing_glyphs;
440 bool grapheme_shaping;
441 enum {
442 GRAPHEME_WIDTH_WCSWIDTH,
443 GRAPHEME_WIDTH_DOUBLE,
444 GRAPHEME_WIDTH_MAX,
445 } grapheme_width_method;
446 enum {
447 RENDER_TIMER_NONE,
448 RENDER_TIMER_OSD,
449 RENDER_TIMER_LOG,
450 RENDER_TIMER_BOTH
451 } render_timer;
452 bool damage_whole_window;
453 uint32_t delayed_render_lower_ns;
454 uint32_t delayed_render_upper_ns;
455 off_t max_shm_pool_size;
456 float box_drawing_base_thickness;
457 bool box_drawing_solid_shades;
458 bool font_monospace_warn;
459 bool sixel;
460 enum shm_bit_depth surface_bit_depth;
461 uint32_t min_stride_alignment;
462 bool preapply_damage;
463 } tweak;
465 struct {
466 uint32_t long_press_delay;
467 } touch;
469 user_notifications_t notifications;
470};
472bool config_override_apply(struct config *conf, config_override_t *overrides,
473 bool errors_are_fatal);
474bool config_load(
475 struct config *conf, const char *path,
476 user_notifications_t *initial_user_notifications,
477 config_override_t *overrides, bool errors_are_fatal,
478 bool as_server);
479void config_free(struct config *conf);
480struct config *config_clone(const struct config *old);
482bool config_font_parse(const char *pattern, struct config_font *font);
483void config_font_list_destroy(struct config_font_list *font_list);
485#if 0
486struct seat;
487xkb_mod_mask_t
488conf_modifiers_to_mask(
489 const struct seat *seat, const struct config_key_modifiers *modifiers);
490#endif
491bool check_if_font_is_monospaced(
492 const char *pattern, user_notifications_t *notifications);
Diagnostics6 git calls · 489 ms
CallStatusSizeTime0489 ms
discover200178 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=178
git.server.agent=git/2.56.1-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=178
git.pkt.payload.max=35
ls-refs20010 KiB463 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=432
git.response.bytes=10322
git.response.cache=EXPIRED
git.response.duration_ms=463
git.protocol.version=2
git.pkt.frames=108
git.pkt.data=107
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=10322
git.pkt.payload.max=106
git.ls_refs.count=107
git.ls_refs.head=refs/heads/master
fetchtree:0 · deepen 102009.3 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=9489
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=9489
git.pkt.payload.max=9389
git.sideband.band1.bytes=9389
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=9389
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a
git.pack.full=10
Open pack map
fetchtree:0 · deepen 12001.1 KiB · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=1154
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=tree:0
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
git.fetch.haves.count=0
git.fetch.deepen=1
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=1154
git.pkt.payload.max=1054
git.sideband.band1.bytes=1054
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=1054
git.pack.trailer=f9afe4130b8e969286b1fa36663bbb8999db09ea
Open pack map
fetchcombine:blob:none+tree:2 · deepen 12008.6 KiB · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=8830
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=combine:blob:none+tree:2
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
git.fetch.haves.count=0
git.fetch.deepen=1
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=8830
git.pkt.payload.max=8730
git.sideband.band1.bytes=8730
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=14
git.pack.bytes=8730
git.fetch.wide.objects=14
git.fetch.wide.extra_bytes=9909
git.fetch.wide.blobs=0
fetch2003.3 KiB · hit22 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=22
git.response.bytes=3343
git.response.cache=HIT
git.response.duration_ms=22
git.fetch.wants=f8e99df38ac76e4f416480ae631a65c36fb5e115
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=3343
git.pkt.payload.max=3316
git.sideband.band1.bytes=3316
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://codeberg.org/dnkl/foot
Ref
refs/heads/master
Commit
c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
cf-ray
a5e14861ccf7a140
Request
31ac3fa0…
Protocol
v2 · sha1
Agent
git/2.56.1-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format