summaryrefslogtreecommitdiffstats
path: root/MemorySwapMeter.c
Commit message (Collapse)AuthorAgeFilesLines
* MemorySwapMeter_init() code shrinkExplorer097 days1-3/+1
|
* Define MeterModeId to unsigned int and use it throughoutExplorer097 days1-1/+1
| | | | | | | | | All uses of meter drawing "mode" numbers now have the type `MeterModeId`, including the uses in structures and arrays. `MeterModeId` is defined as `unsigned int`, as (currently) it doesn't save any code size by defining it to any smaller type. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* MemorySwapMeter: Read height from sub-meter objectsExplorer097 days1-1/+1
| | | | | | | The Meter objects have their own 'h' properties. Avoid access to the `Meter_modes` array. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Don't initialize meter mode in custom meter init functionsExplorer097 days1-8/+3
| | | | | | | | | | | Let the respective `MeterClass.updateMode` functions initialize the meter mode instead. The `updateMode` function is always called after the `MeterClass.init` function by `Meter_new()`. This not only simplifies the init functions of meter subclasses, but avoids the use of the global `Meter_modes` array when it's unnecessary. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Obsolete the CUSTOM_METERMODE use in default modeExplorer097 days1-2/+4
| | | | | | | | | | | | | | | | | | | | | The use of CUSTOM_METERMODE value in meter default mode was a bad design. There are no meter that really has a "custom" mode to work with and currently that value serves as a useless placeholder that hides the real default mode for a meter. Replace CUSTOM_METERMODE in `defaultMode` of all meters with the real intended default modes. Currently only CPU meters and MemorySwapMeter used this, and their real defaults are BAR_METERMODE. In Meter_setMode(), remove the special treatment of `defaultMode == CUSTOM_METERMODE`, Meter_setMode() still calls the `updateMode` function for custom treatment when it's present for a meter class. As CUSTOM_METERMODE is obsolete from `defaultMode`, the init functions of CPU meters and MemorySwapMeter need to be adjusted to avoid incomplete initialization (Meter.draw function bring NULL). Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Update includes based on IWYUBenny Baumann2023-12-261-0/+1
|
* Add includes for config.h as per the discussion in PR #1337Daniel Lange2023-12-261-0/+2
| | | | | | Many thanks to @Explorer09 Kang-Che Sung (宋岡哲). Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
* Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott2023-05-081-2/+2
| | | | | | | | | | | 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.
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Header: do not let multi-column meters expand to empty neighborsChristian Göttsche2021-09-181-0/+1
| | | | | | | | | | Extending to right neighbors is intended for text meters with an overlong content, so the whole text is shown if possible. Multi column meters, like the combined memory and swap meter, position its text depending on the given total width; keep the position to the original assigned header slot. Short term resolution for #796
* MemorySwapMeter: align with CPU meterChristian Göttsche2021-09-101-2/+6
| | | | | | | | | Use the same width for each sub meter to align with CPU meter. Currently if the total width is even, so it does not split exactly into 2 equal parts plus 1 (for the middle space character column), the extra column is added to the second meter width. Closes: #783
* IWYU updateChristian Göttsche2021-08-251-4/+4
|
* MemorySwapMeter: use full width on odd total widthChristian Göttsche2021-08-221-4/+2
|
* Add combined memory and swap meterChristian Göttsche2021-08-171-0/+104
Closes: #699

© 2014-2024 Faster IT GmbH | imprint | privacy policy