diff options
author | Daniel Lange <DLange@git.local> | 2024-01-10 11:17:08 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2024-01-10 11:17:08 +0100 |
commit | e7372d18a1a661d8c3dba9f51e1f17b5f94171a7 (patch) | |
tree | e8270dd60ec096bee8157dbadf029e15ed584592 /Settings.h | |
parent | 937052b231259a47d881d539ad5748245ef55b99 (diff) | |
download | debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.gz debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.bz2 debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.zip |
New upstream version 3.3.0
Diffstat (limited to 'Settings.h')
-rw-r--r-- | Settings.h | 38 |
1 files changed, 25 insertions, 13 deletions
@@ -7,24 +7,28 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ -#include "config.h" // IWYU pragma: keep - #include <stdbool.h> +#include <stddef.h> #include <stdint.h> #include "Hashtable.h" #include "HeaderLayout.h" -#include "Process.h" +#include "Row.h" +#include "RowField.h" #define DEFAULT_DELAY 15 #define CONFIG_READER_MIN_VERSION 3 +struct DynamicScreen_; // IWYU pragma: keep +struct Table_; // IWYU pragma: keep + typedef struct { const char* name; const char* columns; const char* sortKey; + const char* treeSortKey; } ScreenDefaults; typedef struct { @@ -33,14 +37,16 @@ typedef struct { int* modes; } MeterColumnSetting; -typedef struct { - char* name; - ProcessField* fields; +typedef struct ScreenSettings_ { + char* heading; /* user-editable screen name (pretty) */ + char* dynamic; /* from DynamicScreen config (fixed) */ + struct Table_* table; + RowField* fields; uint32_t flags; int direction; int treeDirection; - ProcessField sortKey; - ProcessField treeSortKey; + RowField sortKey; + RowField treeSortKey; bool treeView; bool treeViewAlwaysByPID; bool allBranchesCollapsed; @@ -51,7 +57,9 @@ typedef struct Settings_ { int config_version; HeaderLayout hLayout; MeterColumnSetting* hColumns; - Hashtable* dynamicColumns; + Hashtable* dynamicColumns; /* runtime-discovered columns */ + Hashtable* dynamicMeters; /* runtime-discovered meters */ + Hashtable* dynamicScreens; /* runtime-discovered screens */ ScreenSettings** screens; unsigned int nScreens; @@ -73,9 +81,11 @@ typedef struct Settings_ { bool shadowOtherUsers; bool showThreadNames; bool hideKernelThreads; + bool hideRunningInContainer; bool hideUserlandThreads; bool highlightBaseName; bool highlightDeletedExe; + bool shadowDistPathPrefix; bool highlightMegabytes; bool highlightThreads; bool highlightChanges; @@ -101,9 +111,9 @@ typedef struct Settings_ { #define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromOne ? (cpu)+1 : (cpu)) -static inline ProcessField ScreenSettings_getActiveSortKey(const ScreenSettings* this) { +static inline RowField ScreenSettings_getActiveSortKey(const ScreenSettings* this) { return (this->treeView) - ? (this->treeViewAlwaysByPID ? PID : this->treeSortKey) + ? (this->treeViewAlwaysByPID ? 1 : this->treeSortKey) : this->sortKey; } @@ -115,15 +125,17 @@ void Settings_delete(Settings* this); int Settings_write(const Settings* this, bool onCrash); -Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicColumns); +Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* dynamicScreens); ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* defaults); +ScreenSettings* Settings_newDynamicScreen(Settings* this, const char* tab, const struct DynamicScreen_* screen, struct Table_* table); + void ScreenSettings_delete(ScreenSettings* this); void ScreenSettings_invertSortOrder(ScreenSettings* this); -void ScreenSettings_setSortKey(ScreenSettings* this, ProcessField sortKey); +void ScreenSettings_setSortKey(ScreenSettings* this, RowField sortKey); void Settings_enableReadonly(void); |