diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2016-08-23 00:06:01 +0300 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-09-15 18:28:28 +0200 |
commit | ca4cd5bec239b88b72fccb2f4849e634a504b260 (patch) | |
tree | 576c3f58b06807eb24fed7caf441b2801c5452a0 /ui.h | |
parent | 5ca82e492cd88813f22d40dc2fecaaa2b3dcd51d (diff) |
flowtop: Render table row via raw ncurses buffer
Render each column to the ncurses raw buffer first, this buffer
contains ncurses {char:attr} elements which will be printed
to the screen after ui_table_row_show() will
be called (at the end of columns rendering by flowtop).
The reason of this change is to have easy way to
make horizontal scrolling over this buffer.
Approach is used from the 'htop' tool.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'ui.h')
-rw-r--r-- | ui.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -11,6 +11,12 @@ enum ui_align { UI_ALIGN_RIGHT, }; +struct ui_text { + chtype *str; + size_t slen; + size_t len; +}; + struct ui_col { struct list_head entry; uint32_t id; @@ -26,6 +32,7 @@ struct ui_table { int x; int rows_y; struct list_head cols; + struct ui_text *row; int hdr_color; int col_pad; int width; @@ -44,6 +51,7 @@ extern void ui_table_col_color_set(struct ui_table *tbl, int col_id, int color); extern void ui_table_col_align_set(struct ui_table *tbl, int col_id, enum ui_align align); extern void ui_table_row_add(struct ui_table *tbl); +extern void ui_table_row_show(struct ui_table *tbl); extern void ui_table_row_print(struct ui_table *tbl, uint32_t col_id, const char *str); |