frontend: update bluelib api usage

This commit is contained in:
2025-11-06 10:39:08 +00:00
parent 9622e30e0f
commit 24eef25147
10 changed files with 50 additions and 39 deletions

View File

@@ -14,24 +14,28 @@ void line_ed_remove_hook(struct line_ed *ed, struct line_ed_hook *hook)
void hook_keypress(struct line_ed *ed, b_keycode key)
{
b_queue_iterator it;
b_queue_foreach (&it, &ed->l_hooks) {
b_queue_entry *entry = b_queue_first(&ed->l_hooks);
while (entry) {
struct line_ed_hook *hook
= b_unbox(struct line_ed_hook, it.entry, hook_entry);
= b_unbox(struct line_ed_hook, entry, hook_entry);
if (hook->hook_keypress) {
hook->hook_keypress(ed, hook, key);
}
entry = b_queue_next(entry);
}
}
void hook_buffer_modified(struct line_ed *ed)
{
b_queue_iterator it;
b_queue_foreach (&it, &ed->l_hooks) {
b_queue_entry *entry = b_queue_first(&ed->l_hooks);
while (entry) {
struct line_ed_hook *hook
= b_unbox(struct line_ed_hook, it.entry, hook_entry);
= b_unbox(struct line_ed_hook, entry, hook_entry);
if (hook->hook_buffer_modified) {
hook->hook_buffer_modified(ed, hook);
}
entry = b_queue_next(entry);
}
}