diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-14 11:01:32 +0100 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2021-01-15 20:41:10 +0100 |
commit | b5a5e83470ef2db6cace89a5f513b038a96bbff9 (patch) | |
tree | cf43635a79afc062e7d54c8b937bf3c73638e644 /RichString.h | |
parent | b9adc30b86ef550655de1e8a8122dae20a6b13df (diff) |
LED Meter: display wide characters and restore non-wide ncurses support
Print wide characters, like degree sign, properly via mvadd_wch().
Ignore attributes when returning value from RichString_getCharVal() in
non-wide ncurses mode to test against raw characters.
Diffstat (limited to 'RichString.h')
-rw-r--r-- | RichString.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/RichString.h b/RichString.h index d317cb2e..497d0d2f 100644 --- a/RichString.h +++ b/RichString.h @@ -22,13 +22,13 @@ in the source distribution for its full text. #ifdef HAVE_LIBNCURSESW #define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + (off), n) -#define RichString_getCharVal(this, i) ((this).chptr[i].chars[0] & 255) +#define RichString_getCharVal(this, i) ((this).chptr[i].chars[0]) #define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while (0) #define CharType cchar_t #else #define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + (off), n) -#define RichString_getCharVal(this, i) ((this).chptr[i]) +#define RichString_getCharVal(this, i) ((this).chptr[i] & 0xff) #define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = ch; } while (0) #define CharType chtype #endif |