1 | #ifndef NVIM_UGRID_H |
2 | #define NVIM_UGRID_H |
3 | |
4 | #include "nvim/ui.h" |
5 | #include "nvim/globals.h" |
6 | |
7 | typedef struct ucell UCell; |
8 | typedef struct ugrid UGrid; |
9 | |
10 | #define CELLBYTES (sizeof(schar_T)) |
11 | |
12 | struct ucell { |
13 | char data[CELLBYTES + 1]; |
14 | sattr_T attr; |
15 | }; |
16 | |
17 | struct ugrid { |
18 | int row, col; |
19 | int width, height; |
20 | UCell **cells; |
21 | }; |
22 | |
23 | // -V:UGRID_FOREACH_CELL:625 |
24 | |
25 | #define UGRID_FOREACH_CELL(grid, row, startcol, endcol, code) \ |
26 | do { \ |
27 | UCell *row_cells = (grid)->cells[row]; \ |
28 | for (int curcol = startcol; curcol < endcol; curcol++) { \ |
29 | UCell *cell = row_cells + curcol; \ |
30 | (void)(cell); \ |
31 | code; \ |
32 | } \ |
33 | } while (0) |
34 | |
35 | #ifdef INCLUDE_GENERATED_DECLARATIONS |
36 | # include "ugrid.h.generated.h" |
37 | #endif |
38 | #endif // NVIM_UGRID_H |
39 | |