summaryrefslogtreecommitdiff
path: root/ui.h
AgeCommit message (Collapse)AuthorFilesLines
2017-05-30flowtop: Improve and unify up/down scrollingVadim Kochan1-0/+13
Move scrolling logic to the ui.c module, it requires to have some data iteration provided in flowtop.c and delegated to ui.c part. So approach is that now flowtop provides 2 additional callbacks for: 1) Iterate over flows/procs list 2) Draw flow/proc on each iteration which is controlled from ui.c it allows to unify scrolling logic and delegate it to the ui.c, in the future it should allow to easy handle press event on selected row and drow some additional information, or draw a cursor line per selected row. Also fixed case when down scrolling was bigger that printed rows, not it is handled by ui part. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-01-25flowtop: Add tab control to switch between tablesVadim Kochan1-2/+32
Add ui_tab API to create ui tab control to switch between different ui tables which may contain different aggregated info per unique pid/port/proto/dst/src. Meanwhile there is only 1 ui tab entry for flows table. Added some missing cds_list_{next,prev,last}_entry functions into urcu-list-compat.h header. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-01-17list: Remove cds_list_* wrappersTobias Klauser1-4/+4
Use the cds_list_* types and macros directly instead of redefining them. This makes it clear that we're not using the Linux kernel implementation of list_head but the one from urcu. Also make sure _LGPL_SOURCE is defined everywhere the urcu functionality is used, such that we get the statically linkable version with reduced overhead. Reference: https://lwn.net/Articles/573424/#qq2answer Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-09-15ui: Rename ui_table_row_print -> ui_table_row_col_setVadim Kochan1-2/+2
Really ui_table_row_print(x) no more prints anything, it just sets column value in a row. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-09-15flowtop: Add horizontal scrolling over flows tableVadim Kochan1-0/+8
Add left/right scrolling for flows list table to make possible see all the columns with a smaller display size. Handle 'Left' & 'Right' keypress to scroll left or right. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-09-15flowtop: Render table row via raw ncurses bufferVadim Kochan1-0/+8
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>
2016-04-22ui: Print empty rows when clearing tableVadim Kochan1-1/+3
Fill table with empty rows while clearing. It will allow to get rid of clear() & refresh() each time before print the flows list. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-04-22ui: Implement UI table for flows printingVadim Kochan1-0/+51
Add new module ui.c which is responsible to render different kinds of UI widgets - tables, etc. Implemented generic API for print table-like list of elements. This table API might be used for print flows in curses or text mode. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> [tk: change bug_on(true) to bug(), whitespace fix] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>