diff options
author | Sohaib Mohamed <sohaib.amhmd@gmail.com> | 2023-08-22 16:46:59 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-08-30 13:11:57 +1000 |
commit | 53bdcab942298e0e452d62237bc18e3a4cd551cf (patch) | |
tree | e7a62910b9f4a1a58560a4ded2e6f7e83d0b631e /ScreenTabsPanel.h | |
parent | 0f751e991d399769fb8d7800f7c4bccec2ca7f60 (diff) |
Support dynamic screens with 'top-most' entities beyond processes
This implements our concept of 'dynamic screens' in htop, with a
first use-case of pcp-htop displaying things like top-filesystem
and top-cgroups under new screen tabs. However the idea is more
general than use in pcp-htop and we've paved the way here for us
to collectively build mroe general tabular screens in core htop,
as well.
From the pcp-htop side of things, dynamic screens are configured
using text-based configuration files that define the mapping for
PCP metrics to columns (and metric instances to rows). Metrics
are defined either directly (via metric names) or indirectly via
PCP derived metric specifications. Value scaling and the units
displayed is automatic based on PCP metric units and data types.
This commit represents a collaborative effort of several months,
primarily between myself, Nathan and BenBE.
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Signed-off-by: Nathan Scott <nathans@redhat.com>
Diffstat (limited to 'ScreenTabsPanel.h')
-rw-r--r-- | ScreenTabsPanel.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ScreenTabsPanel.h b/ScreenTabsPanel.h new file mode 100644 index 00000000..3b89ffc2 --- /dev/null +++ b/ScreenTabsPanel.h @@ -0,0 +1,60 @@ +#ifndef HEADER_ScreenTabsPanel +#define HEADER_ScreenTabsPanel +/* +htop - ScreenTabsPanel.h +(C) 2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + +#include "DynamicScreen.h" +#include "ListItem.h" +#include "Panel.h" +#include "ScreensPanel.h" +#include "ScreenManager.h" +#include "Settings.h" + + +typedef struct ScreenNamesPanel_ { + Panel super; + + ScreenManager* scr; + Settings* settings; + char buffer[SCREEN_NAME_LEN + 1]; + DynamicScreen* ds; + char* saved; + int cursor; + ListItem* renamingItem; +} ScreenNamesPanel; + +typedef struct ScreenNameListItem_ { + ListItem super; + ScreenSettings* ss; +} ScreenNameListItem; + +typedef struct ScreenTabsPanel_ { + Panel super; + + ScreenManager* scr; + Settings* settings; + ScreenNamesPanel* names; + int cursor; +} ScreenTabsPanel; + +typedef struct ScreenTabListItem_ { + ListItem super; + DynamicScreen* ds; +} ScreenTabListItem; + + +ScreenTabsPanel* ScreenTabsPanel_new(Settings* settings); + +extern ObjectClass ScreenNameListItem_class; + +ScreenNameListItem* ScreenNameListItem_new(const char* value, ScreenSettings* ss); + +extern PanelClass ScreenNamesPanel_class; + +ScreenNamesPanel* ScreenNamesPanel_new(Settings* settings); + +#endif |