From 1b805a31720727008b32b1129a167758519fd4db Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 2 May 2022 16:04:21 +0200 Subject: New upstream version 3.2.0 --- Settings.h | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'Settings.h') diff --git a/Settings.h b/Settings.h index a1f7040..345a535 100644 --- a/Settings.h +++ b/Settings.h @@ -19,7 +19,13 @@ in the source distribution for its full text. #define DEFAULT_DELAY 15 -#define CONFIG_READER_MIN_VERSION 2 +#define CONFIG_READER_MIN_VERSION 3 + +typedef struct { + const char* name; + const char* columns; + const char* sortKey; +} ScreenDefaults; typedef struct { size_t len; @@ -27,6 +33,19 @@ typedef struct { int* modes; } MeterColumnSetting; +typedef struct { + char* name; + ProcessField* fields; + uint32_t flags; + int direction; + int treeDirection; + ProcessField sortKey; + ProcessField treeSortKey; + bool treeView; + bool treeViewAlwaysByPID; + bool allBranchesCollapsed; +} ScreenSettings; + typedef struct Settings_ { char* filename; int config_version; @@ -34,16 +53,14 @@ typedef struct Settings_ { MeterColumnSetting* hColumns; Hashtable* dynamicColumns; - ProcessField* fields; - uint32_t flags; + ScreenSettings** screens; + unsigned int nScreens; + unsigned int ssIndex; + ScreenSettings* ss; + int colorScheme; int delay; - int direction; - int treeDirection; - ProcessField sortKey; - ProcessField treeSortKey; - bool countCPUsFromOne; bool detailedCPUTime; bool showCPUUsage; @@ -52,9 +69,6 @@ typedef struct Settings_ { bool showCPUTemperature; bool degreeFahrenheit; #endif - bool treeView; - bool treeViewAlwaysByPID; - bool allBranchesCollapsed; bool showProgramPath; bool shadowOtherUsers; bool showThreadNames; @@ -72,6 +86,7 @@ typedef struct Settings_ { bool updateProcessNames; bool accountGuestInCPUMeter; bool headerMargin; + bool screenTabs; #ifdef HAVE_GETMOUSE bool enableMouse; #endif @@ -85,13 +100,13 @@ typedef struct Settings_ { #define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromOne ? (cpu)+1 : (cpu)) -static inline ProcessField Settings_getActiveSortKey(const Settings* this) { +static inline ProcessField ScreenSettings_getActiveSortKey(const ScreenSettings* this) { return (this->treeView) ? (this->treeViewAlwaysByPID ? PID : this->treeSortKey) : this->sortKey; } -static inline int Settings_getActiveDirection(const Settings* this) { +static inline int ScreenSettings_getActiveDirection(const ScreenSettings* this) { return this->treeView ? this->treeDirection : this->direction; } @@ -101,9 +116,13 @@ int Settings_write(const Settings* this, bool onCrash); Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicColumns); -void Settings_invertSortOrder(Settings* this); +ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* defaults); + +void ScreenSettings_delete(ScreenSettings* this); + +void ScreenSettings_invertSortOrder(ScreenSettings* this); -void Settings_setSortKey(Settings* this, ProcessField sortKey); +void ScreenSettings_setSortKey(ScreenSettings* this, ProcessField sortKey); void Settings_enableReadonly(void); -- cgit v1.2.3