summaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-08-23 00:06:01 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-09-15 18:28:28 +0200
commitca4cd5bec239b88b72fccb2f4849e634a504b260 (patch)
tree576c3f58b06807eb24fed7caf441b2801c5452a0 /ui.h
parent5ca82e492cd88813f22d40dc2fecaaa2b3dcd51d (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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui.h b/ui.h
index ff55606..7f4814c 100644
--- a/ui.h
+++ b/ui.h
@@ -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);