diff options
| author | Albert Cervin <albert@acervin.com> | 2023-01-09 23:50:48 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-01-09 23:50:48 +0100 |
| commit | fd8ecb6d0f9af3245e8b1a662987b8cf4e89dec9 (patch) | |
| tree | 4d7236e75292153b917671251767218b979bdeb2 /src/buffer.h | |
| parent | 690786504fce73edea78c7ec13b34771771e4caf (diff) | |
| download | dged-fd8ecb6d0f9af3245e8b1a662987b8cf4e89dec9.tar.gz dged-fd8ecb6d0f9af3245e8b1a662987b8cf4e89dec9.tar.xz dged-fd8ecb6d0f9af3245e8b1a662987b8cf4e89dec9.zip | |
More stuff
Render things and line numbers.
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) \ |
