diff options
author | Explorer09 <explorer09@gmail.com> | 2024-04-18 21:08:54 +0800 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2024-04-20 19:36:00 +0200 |
commit | faaf6dd25e064f4e6e73061b15547b965b353ae5 (patch) | |
tree | 28f8e3a6e958302a29f75999039675264b9d5163 /Meter.h | |
parent | 52486dbc0f056c37b8cc81bf2f8c2830d77c7d52 (diff) |
Obsolete the CUSTOM_METERMODE use in default mode
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>
Diffstat (limited to 'Meter.h')
-rw-r--r-- | Meter.h | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -87,7 +87,6 @@ typedef struct MeterClass_ { #define Meter_getUiName(this_,n_,l_) As_Meter(this_)->getUiName((const Meter*)(this_),n_,l_) #define Meter_getCaptionFn(this_) As_Meter(this_)->getCaption #define Meter_getCaption(this_) (Meter_getCaptionFn(this_) ? As_Meter(this_)->getCaption((const Meter*)(this_)) : (this_)->caption) -#define Meter_defaultMode(this_) As_Meter(this_)->defaultMode #define Meter_attributes(this_) As_Meter(this_)->attributes #define Meter_name(this_) As_Meter(this_)->name #define Meter_uiName(this_) As_Meter(this_)->uiName |