-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.h
More file actions
29 lines (21 loc) · 703 Bytes
/
view.h
File metadata and controls
29 lines (21 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef _VIEW_H
#define _VIEW_H
#include <curses.h>
#include <stdbool.h>
#include "buffer.h"
#define view_get_col(view, col) (col - view->top_col)
#define view_get_row(view, row) (row - view->top_row)
typedef struct View {
WINDOW *win;
Line *top_line;
size_t top_row;
size_t top_col;
} View;
View *view_new(int rows, int cols, int begin_row, int begin_col, Line *top);
void view_destroy(View *view);
void view_scroll(View *view, Line *cur_line, int row, int col);
void view_redraw_line(View *view, Line *line, int col);
void view_redraw_lines(View *view, Line *line, int col);
void view_redraw_all_lines(View *view);
void view_update_cursor(View *view, int row, int col);
#endif