From fd4e6b432bcc0d6bac1a15a2ea492b4a540b75a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 5 Feb 2021 14:12:49 +0100 Subject: Use MainPanel type in State struct The State struct holds a pointer to the main process panel. Use the distinct MainPanel type, to improve maintainability regrading its usage. This avoids usages of down-casts from Panel to MainPanel, only up-casts from MainPanel to Panel are now required. --- Action.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Action.h') diff --git a/Action.h b/Action.h index 02d9030d..8e86569e 100644 --- a/Action.h +++ b/Action.h @@ -20,6 +20,7 @@ in the source distribution for its full text. #include "Settings.h" #include "UsersTable.h" + typedef enum { HTOP_OK = 0x00, HTOP_REFRESH = 0x01, @@ -31,11 +32,13 @@ typedef enum { HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH } Htop_Reaction; +struct MainPanel_; + typedef struct State_ { Settings* settings; UsersTable* ut; ProcessList* pl; - Panel* panel; + struct MainPanel_* mainPanel; Header* header; bool pauseProcessUpdate; bool hideProcessSelection; -- cgit v1.2.3