diff options
author | Nathan Scott <nathans@redhat.com> | 2023-05-02 09:02:22 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-05-08 13:06:07 +1000 |
commit | 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 (patch) | |
tree | 0e0225f7dbf6867402c5ed3481a705d01941f42e /Action.h | |
parent | e4ebe18b67c366d367231a1123b057c82018cf5b (diff) |
Introduce Machine class for host-specific info (split from ProcessList)
First stage in sanitizing the process list structure so that htop
can support other types of lists too (cgroups, filesystems, ...),
in the not-too-distant future.
This introduces struct Machine for system-wide information while
keeping process-list information in ProcessList (now much less).
Next step is to propogate this separation into each platform, to
match these core changes.
Diffstat (limited to 'Action.h')
-rw-r--r-- | Action.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -13,10 +13,10 @@ in the source distribution for its full text. #include <sys/types.h> #include "Header.h" +#include "Machine.h" #include "Object.h" #include "Panel.h" #include "Process.h" -#include "ProcessList.h" #include "Settings.h" #include "UsersTable.h" @@ -36,9 +36,7 @@ typedef enum { struct MainPanel_; // IWYU pragma: keep typedef struct State_ { - Settings* settings; - UsersTable* ut; - ProcessList* pl; + Machine* host; struct MainPanel_* mainPanel; Header* header; bool pauseUpdate; @@ -47,12 +45,13 @@ typedef struct State_ { } State; static inline bool State_hideFunctionBar(const State* st) { - return st->settings->hideFunctionBar == 2 || (st->settings->hideFunctionBar == 1 && st->hideSelection); + const Settings* settings = st->host->settings; + return settings->hideFunctionBar == 2 || (settings->hideFunctionBar == 1 && st->hideSelection); } typedef Htop_Reaction (*Htop_Action)(State* st); -Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess); +Object* Action_pickFromVector(State* st, Panel* list, int x, bool follow); bool Action_setUserOnly(const char* userName, uid_t* userId); |