trafgen: proto: Increment proto field at runtime
[netsniff-ng-new.git] / ui.h
blob07248ac8b93c84631ce545d26d32dd82f0737fd7
1 #ifndef UI_H
2 #define UI_H
4 #include <stdbool.h>
5 #include <inttypes.h>
7 #include "list.h"
9 enum ui_event_id {
10 UI_EVT_SCROLL_LEFT,
11 UI_EVT_SCROLL_RIGHT,
14 enum ui_align {
15 UI_ALIGN_LEFT,
16 UI_ALIGN_RIGHT,
19 struct ui_text {
20 chtype *str;
21 size_t slen;
22 size_t len;
25 struct ui_col {
26 struct list_head entry;
27 uint32_t id;
28 char *name;
29 uint32_t len;
30 int pos;
31 int color;
32 enum ui_align align;
35 struct ui_table {
36 int y;
37 int x;
38 int rows_y;
39 struct list_head cols;
40 struct ui_text *row;
41 int hdr_color;
42 int col_pad;
43 int width;
44 int height;
45 int scroll_x;
48 extern void ui_table_init(struct ui_table *tbl);
49 extern void ui_table_uninit(struct ui_table *tbl);
50 extern void ui_table_clear(struct ui_table *tbl);
51 extern void ui_table_pos_set(struct ui_table *tbl, int y, int x);
52 extern void ui_table_height_set(struct ui_table *tbl, int height);
54 extern void ui_table_col_add(struct ui_table *tbl, uint32_t id, char *name,
55 uint32_t len);
56 extern void ui_table_col_color_set(struct ui_table *tbl, int col_id, int color);
57 extern void ui_table_col_align_set(struct ui_table *tbl, int col_id, enum ui_align align);
59 extern void ui_table_row_add(struct ui_table *tbl);
60 extern void ui_table_row_show(struct ui_table *tbl);
61 extern void ui_table_row_col_set(struct ui_table *tbl, uint32_t col_id,
62 const char *str);
64 extern void ui_table_header_color_set(struct ui_table *tbl, int color);
65 extern void ui_table_header_print(struct ui_table *tbl);
67 extern void ui_table_event_send(struct ui_table *tbl, enum ui_event_id id);
69 #endif /* UI_H */