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.
This commit is contained in:
Christian Göttsche
2021-02-05 14:12:49 +01:00
parent fd1ad863dc
commit fd4e6b432b
5 changed files with 48 additions and 46 deletions

View File

@ -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;