mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-24 01:40:12 -05:00
wip: grid is now represented as a grid, not a linear array
The grid is now represented with an array of row *pointers*. Each row contains an array of cells (the row's columns). The main point of having row pointers is we can now move rows around almost for free. This is useful when scrolling with scroll margins for example, where we previously had to copy the lines in the margins. Now it's just a matter of swapping two pointers.
This commit is contained in:
parent
98db7f58cb
commit
4e25019ba6
8 changed files with 457 additions and 81 deletions
22
main.c
22
main.c
|
|
@ -589,6 +589,10 @@ out:
|
|||
wl_pointer_destroy(term.wl.pointer.pointer);
|
||||
if (term.wl.pointer.surface != NULL)
|
||||
wl_surface_destroy(term.wl.pointer.surface);
|
||||
if (term.wl.keyboard != NULL)
|
||||
wl_keyboard_destroy(term.wl.keyboard);
|
||||
if (term.wl.seat != NULL)
|
||||
wl_seat_destroy(term.wl.seat);
|
||||
if (term.wl.surface != NULL)
|
||||
wl_surface_destroy(term.wl.surface);
|
||||
if (term.wl.shell != NULL)
|
||||
|
|
@ -601,9 +605,23 @@ out:
|
|||
wl_registry_destroy(term.wl.registry);
|
||||
if (term.wl.display != NULL)
|
||||
wl_display_disconnect(term.wl.display);
|
||||
if (term.kbd.xkb_keymap != NULL)
|
||||
xkb_keymap_unref(term.kbd.xkb_keymap);
|
||||
if (term.kbd.xkb_state != NULL)
|
||||
xkb_state_unref(term.kbd.xkb_state);
|
||||
if (term.kbd.xkb != NULL)
|
||||
xkb_context_unref(term.kbd.xkb);
|
||||
|
||||
free(term.normal.cells);
|
||||
free(term.alt.cells);
|
||||
for (int row = 0; row < term.normal.num_rows; row++) {
|
||||
free(term.normal.rows[row]->cells);
|
||||
free(term.normal.rows[row]);
|
||||
}
|
||||
free(term.normal.rows);
|
||||
for (int row = 0; row < term.alt.num_rows; row++) {
|
||||
free(term.alt.rows[row]->cells);
|
||||
free(term.alt.rows[row]);
|
||||
}
|
||||
free(term.alt.rows);
|
||||
|
||||
for (size_t i = 0; i < sizeof(term.fonts) / sizeof(term.fonts[0]); i++) {
|
||||
if (term.fonts[i] != NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue