diff options
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/buffer.h b/src/buffer.h index 141c1ea..e8ab62b 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -16,10 +16,22 @@ struct margin { uint32_t bottom; }; -typedef struct margin (*update_hook_cb)(struct buffer *buffer, - struct command_list *commands, - uint32_t width, uint32_t height, - uint64_t frame_time, void *userdata); +typedef void (*line_render_cb)(struct text_chunk *line_data, uint32_t line, + struct command_list *commands, void *userdata); + +struct line_render_hook { + line_render_cb callback; + void *userdata; +}; + +struct update_hook_result { + struct margin margins; + struct line_render_hook line_render_hook; +}; + +typedef struct update_hook_result (*update_hook_cb)( + struct buffer *buffer, struct command_list *commands, uint32_t width, + uint32_t height, uint64_t frame_time, void *userdata); struct update_hook { update_hook_cb callback; @@ -76,9 +88,6 @@ void buffer_end_of_line(struct buffer *buffer); void buffer_beginning_of_line(struct buffer *buffer); void buffer_newline(struct buffer *buffer); -void buffer_relative_dot_pos(struct buffer *buffer, uint32_t *relline, - uint32_t *relcol); - uint32_t buffer_add_update_hook(struct buffer *buffer, update_hook_cb hook, void *userdata); @@ -86,12 +95,8 @@ struct buffer buffer_from_file(const char *filename, struct reactor *reactor); void buffer_to_file(struct buffer *buffer); void buffer_update(struct buffer *buffer, uint32_t width, uint32_t height, - struct command_list *commands, uint64_t frame_time); - -struct margin buffer_modeline_hook(struct buffer *buffer, - struct command_list *commands, - uint32_t width, uint32_t height, - uint64_t frame_time, void *userdata); + struct command_list *commands, uint64_t frame_time, + uint32_t *relline, uint32_t *relcol); // commands #define BUFFER_WRAPCMD(fn) \ |
